Skip to content

Commit a2e72aa

Browse files
Add TODOs and information about sellting segments in imported vector file
1 parent 5362a91 commit a2e72aa

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

react/src/components/Map/PMTilesLayer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ const PMTilesLayer: React.FC<PMTilesLayerProps> = ({
153153
.flat()
154154
.find((f) => f.feature);
155155
if (firstHit) {
156+
// TODO(highlight): visually highlight the clicked geometry here (a
157+
// filtered PaintRule + rerenderTile). Blocked on a stable per-geometry
158+
// id (see SelectedVectorFeatureContext).
156159
onSelect(featureId, firstHit.feature.props as Record<string, unknown>);
157160
}
158161
};

react/src/context/SelectedVectorFeatureContext.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,11 @@ export const SelectedVectorFeatureContext =
4040
* that segment's attributes in the detail panel.
4141
*
4242
* TODO(vectorSubId): make the sub-selection deep-linkable / reload-safe like
43-
* `selectedFeature`. A clicked geometry has no stable id today: PMTiles
44-
* geometries are split across tiles and simplified per zoom, and tippecanoe
45-
* doesn't emit a stable feature id unless the source carries one and we
46-
* preserve it. To do this properly, stamp a stable per-geometry id into the
47-
* tiles at ingest (geoapi/tippecanoe — pairs naturally with the per-feature
48-
* styling work in PMTilesLayer), surface it on the picked feature here, and
49-
* add a `vectorSubId` URL param alongside SELECTED_FEATURE_PARAM in
50-
* useFeatureSelection. Until then this stays transient (lost on reload/share).
43+
* `selectedFeature`, and enable highlighting the clicked geometry. Both need a
44+
* stable per-geometry id stamped at ingest (a clicked geometry has none today:
45+
* PMTiles geometries are split across tiles and simplified per zoom, and
46+
* tippecanoe doesn't emit a stable id unless the source carries one and we
47+
* preserve it). Until then this stays transient (lost on reload/share).
5148
*/
5249
export const SelectedVectorFeatureProvider = ({
5350
children,

0 commit comments

Comments
 (0)