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

[Enhancement] Keep layers on top (Mapbox/Maplibre) #63

Closed
alanOracle opened this issue Jul 24, 2023 · 3 comments
Closed

[Enhancement] Keep layers on top (Mapbox/Maplibre) #63

alanOracle opened this issue Jul 24, 2023 · 3 comments
Labels
enhancement New feature or request MapboxGL Related to the MapboxGL JS Adapter MapLibreGL Related to the MapLibreGL JS Adapter

Comments

@alanOracle
Copy link

If you add layers to the map while you are using terra draw in maplibre or mapbox then those layers could be added above terra draw ones. It would be nice to have them always on top.

One solution could be implemented at the end of render method of mapbox gl adapter

// Make sure terradraw layers are on top of all others
["point", "linestring", "polygon"].forEach(geometryKey => {
    const id = `td-${geometryKey.toLowerCase()}`;
    if (this._map.getLayer(id)) this._map.moveLayer(id);
    if (geometryKey === "polygon") if (this._map.getLayer(id + "-outline")) this._map.moveLayer(id + "-outline");
});
@JamesLMilner
Copy link
Owner

Hey @alanOracle - thanks for this! Think you are saying you want to keep the Terra Draw layers on top right?

@JamesLMilner JamesLMilner added MapboxGL Related to the MapboxGL JS Adapter MapLibreGL Related to the MapLibreGL JS Adapter labels Jul 24, 2023
@alanOracle
Copy link
Author

Affirmative.

@JamesLMilner JamesLMilner changed the title Keep layers on top (Mapbox/Maplibre) [Improvement] Keep layers on top (Mapbox/Maplibre) Jul 25, 2024
@JamesLMilner JamesLMilner added the enhancement New feature or request label Jul 25, 2024
@JamesLMilner JamesLMilner changed the title [Improvement] Keep layers on top (Mapbox/Maplibre) [Enhancement] Keep layers on top (Mapbox/Maplibre) Jul 25, 2024
@JamesLMilner
Copy link
Owner

I'm going to close this in favour of [Feature Request] Control layer and feature ordering in MapLibre/Mapbox #394 which would mean making it configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request MapboxGL Related to the MapboxGL JS Adapter MapLibreGL Related to the MapLibreGL JS Adapter
Projects
None yet
Development

No branches or pull requests

2 participants