don't de-select map feature when clicking on a street level photo

This commit is contained in:
Martin Raifer
2025-04-15 18:13:52 +02:00
parent 654c13ce08
commit f5eb4d2a51
9 changed files with 18 additions and 0 deletions

View File

@@ -215,6 +215,11 @@ export function behaviorSelect(context) {
}
var targetDatum = lastEvent.target.__data__;
if (targetDatum === 0 && lastEvent.target.parentNode.__data__) {
// some targets (like markers of the street level photo
// layers) have the data bound to the parent node
targetDatum = lastEvent.target.parentNode.__data__;
}
var multiselectEntityId;
@@ -350,6 +355,9 @@ export function behaviorSelect(context) {
.selectedErrorID(datum.id)
.enter(modeSelectError(context, datum.id, datum.service));
} else if (datum.service === 'photo') {
// street level photo was selected:
// don't change mode and selection
} else {
// targeting nothing
context.selectedNoteID(null);

View File

@@ -100,6 +100,7 @@ function loadNextTilePage(which, currZoom, url, tile) {
if (which === 'images') {
d = {
service: 'photo',
loc: loc,
key: item.id,
ca: +item.heading,

View File

@@ -140,6 +140,7 @@ function loadTileDataToCache(data, tile) {
let isPano = sourceWidth % sourceHeight === 0;
const d = {
service: 'photo',
loc: loc,
capture_time: feature.properties.capture_time,
id: feature.properties.id,

View File

@@ -105,6 +105,7 @@ function loadTileDataToCache(data, tile, which) {
feature = layer.feature(i).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
loc = feature.geometry.coordinates;
d = {
service: 'photo',
loc: loc,
captured_at: feature.properties.captured_at,
ca: feature.properties.compass_angle,
@@ -147,6 +148,7 @@ function loadTileDataToCache(data, tile, which) {
loc = feature.geometry.coordinates;
d = {
service: 'photo',
loc: loc,
id: feature.properties.id,
first_seen_at: feature.properties.first_seen_at,
@@ -172,6 +174,7 @@ function loadTileDataToCache(data, tile, which) {
loc = feature.geometry.coordinates;
d = {
service: 'photo',
loc: loc,
id: feature.properties.id,
first_seen_at: feature.properties.first_seen_at,

View File

@@ -178,6 +178,7 @@ function loadTileDataToCache(data, tile, zoom) {
loc = feature.geometry.coordinates;
d = {
service: 'photo',
loc: loc,
capture_time: feature.properties.ts,
capture_time_parsed: new Date(feature.properties.ts),

View File

@@ -120,6 +120,7 @@ function loadNextTilePage(which, url, tile) {
bubble.lat || bubble.latitude
];
const d = {
service: 'photo',
loc: loc,
key: bubbleId,
imageUrl: bubble.imageUrl

View File

@@ -142,6 +142,7 @@ async function loadTile(cache, typename, tile) {
const lane_number = parseInt(lane_code.match(/^[0-9]+/)[0], 10);
const direction = lane_number % 2 === 0 ? directionEnum.backward : directionEnum.forward;
const data = {
service: 'photo',
loc,
key,
ca,

View File

@@ -271,6 +271,7 @@ export function svgLocalPhotos(projection, context, dispatch) {
try {
const exifData = await exifr.parse(file); // eslint-disable-line no-await-in-loop
const photo = {
service: 'photo',
id: _idAutoinc++,
name: file.name,
getSrc: () => readFileAsDataURL(file),