Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure marker & geojson layers are on top of satellite basemap #481

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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