AnsweredAssumed Answered

centerAndZoom Issue

Question asked by theor74 on Mar 4, 2013
Latest reply on Mar 4, 2013 by theor74
Hello.  I am new to working with esri mapping, and to dojo.

I have a link on my right content pannel, to zoom the map to a location:

<a href="javascript:zoomTo(870974.25311024, 278611.38852797);">10:30 156 W NORTH ROWLETT                ST</a>


Here is my "zoomTo" function:
      function zoomToBAD(lat, lon) {        //alert('zoomTo function');         var point = new esri.geometry.Point(lon, lat, {           wkid: "2274"         });         //alert('2');         var wmpoint = esri.geometry.geographicToWebMercator(point);         //alert('3');                  try{    map.centerAndZoom(wmpoint,0.2);   }catch(err){    alert('Error centering map');   }         //alert('done');       }                    function zoomTo(lat,lon){        try{        var zoomLevel = 15;         var point = new esri.geometry.Point([lat, lon], new esri.SpatialReference({             wkid: 2274         }));         console.log("Zooming to location...", point, zoomLevel);         map.centerAndZoom(point, zoomLevel);         console.log("Zoom complete");          }         catch(err){          alert(err);         }             }


I've tried both of these functions.  Neither generate an error, but my map does not do anything. 
Any help would be appreciated.

Thanks,
Theo

Outcomes