Ideas and Suggestions for Leaflet
Leaflet UserVoice is a place for you to show support for your favorite feature and improvement suggestions for Leaflet.
- Please don’t add duplicates of existing ideas.
- Please don’t report issues with map data — they have nothing to do with Leaflet and will be declined. It uses OpenStreetMap on the website examples.
- If you need to report a bug, please use GitHub issues instead.
-
Marker Visibility Control
It would be nice to be able to control the visibility of a marker (hide/show) at either the marker or the layer level. I currently do this in both Google Map API and Openlayer Map API to allow the user to filter between different types of markers on the map.
123 votesTechnically, doing removeLayer and addLayer for hiding/showing markers has the same performance as hiding them with display = ‘none’, as addLayer only initializes the marker once and only appends it to the DOM on subsequent calls. So I don’t see much need to add such methods for individual markers.
However this would be a very useful feature for LayerGroup’s, where I could implement putting all layers from the same group into a div container to be able to hide them all at once for a considerable performance gain. This is definitely in the plans.
-
post example showing custom projection
It would be cool if one of the examples show the use of a custom projection. This could show how one could use leaflet to pan/zoom around a layer representing a simple image; or a local tile set (e.g. one city). This would also show how to create a map that doesn't wrap around the east/west.
59 votesThis will certainly be done after the current refactoring and simplification of Leaflet projection code is finished for 0.4 release. I see quite a high demand for this.
-
Number the markers
it sould be nice if we ware abble to number the markers, for a search around a point for exemple.
86 votesAgreed that’s a very useful feature, planned for one of the future versions.
-
Make layer control docs/example clearer about which layer is shown initially
When there is multiple base layers, one is only visible, but all are always loaded. Please optimise this this.
9 votesThanks for the explanation in the comments, I’ll add some clarification in the docs.
-
Zoom and panTo animation time parameter
It will be grate set animation time for setZoom and panTo map methods like in mapbox (http://mapbox.com/mapbox.js/api/v0.6.5/#ease.run and http://mapbox.com/mapbox.js/example/optimal-easing/).
40 votesAgreed, definitely worth adding.
-
An API function to close a popup. At the moment I'm using `popup._close()`
Perhaps there are better ways entirely around it but here's a hack I'm currently using:
var popup;
popup = L.popup();
map.on('click', function(event) {
popup
.setLatLng(event.latlng)
.setContent($('#wanna-edit').html())
.openOn(map);
$('#map').on('keypress', function(e) {
e.which == 0 && popup._close();
});
});6 votesAgreed, although you can also use map.closePopup() in this case.
-
Marker Keyboard Accessibility
Keyboard accessibility is almost perfect-- however you just cannot get focus to markers and activate them. However, you can close an aleady open marker's popup.
1 voteAgreed. Planned for implementation.
- Don't see your idea?