Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  7] [ 4]  / answers: 1 / hits: 91506  / 11 Years ago, tue, may 14, 2013, 12:00:00

I'm trying to remove the zoom controls (+/-) on a LeafletJS map.


I'm using the MapBox.js version of Leaflet but most of the operations are the same as Leaflet. I implement my map like this:


var map = L.mapbox.map('map');

var layer = L.mapbox.tileLayer('MAPBOX-ID', {
format: 'jpg70',
minZoom: 13,
maxZoom: 15,
reuseTiles: true,
unloadInvisibleTiles: true
});
map.addLayer(layer);
map.setView([40.73547,-73.987856]);

The documentation says there's a zoomControl option, that will remove the zoom control from the map but I've had no luck in getting it to work.


How can I remove the zoom control with this implementation?


More From » dictionary

 Answers
3

This worked for me:



var map = new L.map('map', { zoomControl: false });


With mapbox try:



var map = L.mapbox.map('map', { zoomControl: false });


See map creation and the zoomControl option in the Leaflet documentation.


[#78249] Sunday, May 12, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
walker

Total Points: 726
Total Questions: 91
Total Answers: 106

Location: Czech Republic
Member since Thu, Aug 11, 2022
2 Years ago
;