Thanks to all for the suggestions. Unfortunately, none of them seemed to work for me, but perhaps I misunderstood. I tried normalizing the geometry both before and after the conversion from geographic to web mercator. Normalizing the geographic geometry produces a 2-ring polygon as you'd expect but then projecting it and passing to centerAndZoom does work correctly either.Abandoning centerAndZoom in favor as Brett suggested works but the center point is incorrectly calculated by getCenter in this case.--john
//fake coords to avoid discontinuity - doesn't seem to help
// var bbox = new esri.geometry.Extent({xmin:175.0,ymin:-5.0,xmax:185.0,ymax:5.0, spatialReference:{ wkid:4326 }});
var bbox = new esri.geometry.Extent({xmin:175.0,ymin:-5.0,xmax:-175.0,ymax:5.0, spatialReference:{ wkid:4326 }});
var merc = esri.geometry.geographicToWebMercator(bbox);
esri.geometry.normalizeCentralMeridian([merc], 'http://maps.ngdc.noaa.gov/rest/services/Geometry/GeometryServer',
function(geometries){
map.centerAndZoom(geometries[0],true);
},
function() {
console.log("error normalizing");
});
var bbox = new esri.geometry.Extent({xmin:175.0,ymin:-5.0,xmax:-175.0,ymax:5.0, spatialReference:{ wkid:4326 }});
esri.geometry.normalizeCentralMeridian([bbox], 'http://maps.ngdc.noaa.gov/rest/services/Geometry/GeometryServer',
function(geometries){
var merc = esri.geometry.geographicToWebMercator(geometries[0]);
map.centerAndZoom(merc,true);
},
function() {
console.log("error normalizing");
});