map.centerAt  causes Tiled service to disappear in IE.

639
1
07-27-2012 06:40 AM
danielconrad
New Contributor
Hi,

I am developing a web application that uses map.centerAt() to pan the user to different search results.  While debugging my application, I noticed that from time to time my base map would disappear.  I created a sample app that uses map.centerAt() to pan the map between LA and New York when the map is clicked.  I inserted the html below and also attached it as a txt file.  What I am seeing is that map.centerAt() works well when the user is zoomed out, but if they are zoomed in past level 17 the map goes white and the tiled service flickers when I pan with the mouse. 

I was wondering if anyone else has experienced this behavior.  I am only seeing this in IE9.

Thanks!

[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
    <!--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>Test Center At</title>
      <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.0/js/dojo/dijit/themes/claro/claro.css">
    <script type="text/javascript">djConfig = { parseOnLoad:true }</script>
    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.0"></script>

    <script type="text/javascript" charset="utf-8">
      dojo.require("esri.map");
  
   var map;
   var lastPoint;
      function init() {
        map = new esri.Map("map");
 
  dojo.connect(map,"onLoad",mapLoaded);
        var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer");
  map.addLayer(tiledMapServiceLayer);            
      }
  
   function mapLoaded() {
  
     <!-- Create the two points to pan between -->
  var laPoint = new esri.geometry.Point(-13163009.16521190,4035986.6473330655, map.spatialReference);    
        var nyPoint = new esri.geometry.Point(-8238434.715895471,4970328.593163353, map.spatialReference);
        lastPoint = laPoint;
 
  dojo.connect(map, "onClick", function(evt) {
           if(lastPoint == laPoint) {
    lastPoint = nyPoint;
    map.centerAt(nyPoint);
     } else {
    lastPoint = laPoint;
    map.centerAt(laPoint);
     }
  });
             
   }

      dojo.addOnLoad(init);
    </script>

  </head>
  <body class="claro">
    <div style="position:relative;">
      <div id="map" style="width:1024px; height:512px; border:1px solid #000;">
      </div>
    </div>
  </body>
</html>[/HTML]
0 Kudos
1 Reply
KonstantinLapine
New Contributor
I realize my response is late but I have experienced this issue in the latest (3.9 at the moment) version of the API as well.

It seems to be specific to the location centerAt pans to and, depending on browser, may cause map content disappear at different zoom levels close to the maximum scale. In FireFox I observed the whole map content disappearing at certain zoom levels and it was not limited to tiled services; in fact, I've seen it happening when only a dynamic service was present on the map.

I didn't find a true solution for this. I use a work-around based on zooming out beyond certain level (depending on API version), calling centerAt, and zooming back. It is not gracious, but works. Here is your modified example: http://jsfiddle.net/klapine/4bBtx/
0 Kudos