8

Is there a way to hide the zoom-in/zoom-out buttons in ArcGIS javascript API? I have external zoom buttons elsewhere on the page, so these are no longer needed.

screenshot

6

Pass in slider: false as an option when creating the map. Here is the Map Options API Reference.

map = new Map("map", {
    basemap: "streets",                 
    slider: false
}
4

I did it with:

on(map, "load", function () {
        map.hideZoomSlider();
    });
  • Of course assuming you're sticking with the standard variable names from the samples... ie. on and map. – Branco Jul 18 '14 at 16:03
1

I believe you need to use method's showZoomSlider() / hideZoomSlider() property isZoomSlider. This should show or hide the zoom slider on the map.

Help link here. Examples of disabling here.

0

For anyone trying to accomplish this using the 4.x versions of the API, try the following when using the MapView (or SceneView) constructor:

var view = new MapView ({
    container: "viewDiv",
    map: map,
    ui: {
        components: [ "attribution" ]
    }
});

Source: https://developers.arcgis.com/javascript/latest/sample-code/view-disable-zoom/index.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.