LeafletJS: How to remove the zoom control

后端 未结 7 1210
隐瞒了意图╮
隐瞒了意图╮ 2020-12-28 11:32

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

相关标签:
7条回答
  • 2020-12-28 12:20

    Thanks to coordinate's answer I was able to figure out the correct method. The solution is:

    // Create the map
    var map = L.mapbox.map('map', null, { zoomControl:false });
    
    // Create my custom layer
    var layer = L.mapbox.tileLayer('MAPBOX-ID', {
        format: 'jpg80',
        minZoom: 13,
        maxZoom:15,
        tileSize: 256,
        reuseTiles: true, 
        unloadInvisibleTiles: true
    });
    
    
    // Add the layer
    map.addLayer(layer);
    
    0 讨论(0)
提交回复
热议问题