function activateNavigation(navType) { if (navType) { navToolbar.activate(navType); // for some reason, when switch ZoomIn to ZoomOut or vice versa, the pan operation is enabled. // I believe it is a bug. Here is a workaround. if (navType !== "pan" && map.isPan) { map.disablePan(); } // set map cursor based on the navigation type switch (navType) { case esri.toolbars.Navigation.PAN: map.setMapCursor("move"); break; case esri.toolbars.Navigation.ZOOM_IN: case esri.toolbars.Navigation.ZOOM_OUT: map.setMapCursor("crosshair"); break; default: map.setMapCursor("default"); break; } } }
dojo.require("esri.toolbars.navigation"); var navToolbar;
navToolbar = new esri.toolbars.Navigation(map);
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.