Buggy centerAndZoom after setExtent

Discussion created by christopher.bennett on Mar 6, 2011
I have an app that implements a "bookmarks" feature in code by defining an array of extents, then calling map.setExtent(extents[n]) after the user clicks a button.  The problem is that if the user clicks a ZoomIn button, the map control actually zooms out.  Same thing for double-clicking the map itself.  However, clicking the ZoomOut button restores normal behavior until the setExtent is called again.  Zooming is performed with a call to map.centerAndZoom.

I'm attaching a sample that demonstrates the behavior.  This is just the "Show Mouse Coordinates" example straight off the Javascript API sample page under the Map category.  I've simply added a couple of buttons to implement the behavior.  Important note: extent1 is in the original map projection, while extent2 is in my application's map service projection (2264).  Extent1 does not exhibit the behavior, while extent2 does.

This behavior does not occur with setting the extent within the original service's projection.  I might have concluded that this is the problem, but since my application's map is published in this projection, I have to wonder if there is some interaction between the map and the projection.

Anybody ever seen this sort of behavior?



    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <!--The viewport meta tag is used to improve the presentation and behavior of the samples
      on iOS devices-->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
    <title>Create Map Display Mouse Coordinates</title>
    <link rel="stylesheet" type="text/css" href="">
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">

  var myMap;

  var extent1 = new esri.geometry.Extent({ "xmin": -11054509, "ymin": 4558692, "xmax": -10943217, "ymax": 4665092, "spatialReference": { "wkid": 102100} });
  var extent2 = new esri.geometry.Extent(1973137.425, 801985.798, 1983912.550, 792960.648, new esri.SpatialReference( {wkid: 2264}) );
  function init() {
   myMap= new esri.Map("map");
        dojo.connect( myMap, "onLoad", function() {
          dojo.connect(myMap, "onMouseMove", showCoordinates);
          dojo.connect(myMap, "onMouseDrag", showCoordinates);

        var mapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("");

 function zoomIn() {
        var ext = myMap.extent;
        var ctr = ext.getCenter();

        myMap.centerAndZoom(ctr, 0.25);

    function showCoordinates(evt) {
   var mp = evt.mapPoint;
         dojo.byId("info").innerHTML = mp.x + ", " + mp.y;

  <body class="claro">
<button onclick="myMap.setExtent(extent1)" >Set Extent 1</button>
<button onclick="myMap.setExtent(extent2)">Set Extent 2</button> 
<button onclick="zoomIn()">Zoom In</button>

   <span id="info" style="position:absolute; right:150px; bottom:5px; color:#000; z-index:50;"></span>
    <div id="map" style="position:relative; width:900px; height:600px; border:1px solid #000;">