jadams

Bing Geocoder State of Alaska

Discussion created by jadams on Apr 12, 2012
Latest reply on Apr 12, 2012 by jeff.pace
I working on an application that uses the Bing Geocoder to return the best extent for a state and zoom to that location.  I'm finding an issue with the state of Alaska.  All of the other states return the correct spatial extent in the 'bestView' property.  Here is the code I have:

veGeocoder3.addressToLocations(where);//*** 'where' = 'AK' or 'Alaska'

function(geocodeResults) {
    
 if(geocodeResults.length == 0){
  alert("No address results returned.");
 }else if(searchType == 'Address' && radius != ''){
  var location = geocodeResults[0].location;
  var pointMeters = esri.geometry.geographicToWebMercator(location);
    var pointSymbol = new esri.symbol.SimpleMarkerSymbol().setSize(10).setColor(new dojo.Color("black"));
    var locationGraphic = new esri.Graphic(pointMeters,pointSymbol);
  var level = radiuszoom[radius];
  addResults.add(locationGraphic);
    var buffDist = radius;
    doBuffer(buffDist,pointMeters);        
    map.centerAndZoom(pointMeters,level);
 }else{
  map.setExtent(esri.geometry.geographicToWebMercator(geocodeResults[0].bestView));
 }
 
 });


Looking at the extent of the returned information I see the xmin value is missing a negative.  Has anyone experienced this same situation?  Any suggestions on a solution?  I would still like to stick with the Bing Geocoder instead of publishing a state layer for searching.  Thanks!

Attachments

Outcomes