LeafletJS: How to remove the zoom control

后端 未结 7 1337
隐瞒了意图╮
隐瞒了意图╮ 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:16

    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.

提交回复
热议问题