New StackOverflow Question: How to remove zoom control from the Mapbox Map?

3 views
Skip to first unread message

stacko...@mg.bodar.com

unread,
Mar 7, 2017, 5:10:40 AM3/7/17
to total...@googlegroups.com

How to remove zoom control from the Mapbox Map?

Asked by Tae on 2017-01-28T21:30:33Z

Reply on StackOverflow

I have a quick question about how you can remove the zoom control from the MapBox Map.

Below is the current code I have.

I have placed "zoomControl: false" inside the styleLayer section, but it doesn't seem to work...

Can someone help me solve this issue?

<script>
    L.mapbox.accessToken = 'pk.eyJ1IjoidGhsZWUxMTIyIiwiYSI6ImNpeWdyd2tycDAzZTUzMm12eDcybjJocTgifQ.r1njnGgI95MNlwVBTm1slw';
    var map = L.mapbox.map('map') 
        .setView([14.43232, 14.4165], 3);

    // Use styleLayer to add a Mapbox style created in Mapbox Studio
          L.mapbox.styleLayer('mapbox://styles/thlee1122/ciyhpbj15003d2sluqt6ylrqa', {zoomControl: false}).addTo(map);

    map.dragging.disable();
    map.touchZoom.disable();
    map.doubleClickZoom.disable();
    map.scrollWheelZoom.disable();

</script>

Reply on StackOverflow
Reply all
Reply to author
Forward
0 new messages