How to control map to move west�?�east�?�south�?�north

634
1
06-09-2014 07:13 PM
xiaoyunnsongb
New Contributor III
Every  superiors:
      Now I have a question like this, [ATTACH=CONFIG]34461[/ATTACH],this can control the map  span �?when click the west button[ATTACH=CONFIG]34462[/ATTACH]�?the map can move to left�?when click the east [ATTACH=CONFIG]34463[/ATTACH]�?the map can move to right�?and other like this�?if there is a  component in the esri�?or you can the solve  method�?wait for your answer�?thanks very very much�??
0 Kudos
1 Reply
OwenEarley
Occasional Contributor III
The ESRI web map control has navigation UI controls but they are a bit different to the Google panning control - see this example: http://jsbin.com/voxosido

You can enable these pan controls using the 'nav: true' option when creating your map, for example:

  <script src="http://js.arcgis.com/3.9/"></script>
  <script>
    var map;
    require(["esri/map", "dojo/domReady!"], function(Map) {
      map = new Map("mapDiv", {
        center: [-56.049, 38.485],
        zoom: 3,
        basemap: "streets",
        nav: true
      });
    });
  </script>


If you really need the control to look like the Google one then you may need to create a custom widget - for more information on custom widgets see: https://developers.arcgis.com/javascript/jstutorials/intro_custom_dijit.html

Owen
www.spatialxp.com.au
0 Kudos