Skip to content

Commit

Permalink
ensure marker & geojson layers have appropriate z index when used wit…
Browse files Browse the repository at this point in the history
…h satellite basemaps
  • Loading branch information
jessicamcinchak committed Aug 28, 2024
1 parent 677879c commit ed409e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ <h1 style="color:red;font-size:16px;">
maxZoom="23"
drawMode
drawMany
basemap="MapboxSatellite"
showCentreMarker
osCopyright="© Crown copyright and database rights 2024 OS (0)100024857"
osProxyEndpoint="https://api.editor.planx.dev/proxy/ordnance-survey"
/>
Expand Down
2 changes: 2 additions & 0 deletions src/components/my-map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ export class MyMap extends LitElement {
});

map.addLayer(geojsonLayer);
geojsonLayer.setZIndex(1001);

if (geojsonSource.getFeatures().length > 0) {
// fit map to extent of geojson features, overriding default zoom & center
Expand Down Expand Up @@ -703,6 +704,7 @@ export class MyMap extends LitElement {
});

map.addLayer(markerLayer);
markerLayer.setZIndex(1001);
};

// show a marker at a point
Expand Down

0 comments on commit ed409e2

Please sign in to comment.