Hi,
when I try to zoom to a given extent in the event handler for the Initailized event of an OpenStreetMapLayer, the XMax of the map's extent becomes Infinity and YMin becomes -Infinity.
In XAML I have a Map control with a single OpenStreetMapLayer:
<esri:Map Background="White"
HorizontalAlignment="Left"
Margin="12,12,0,0"
Name="map1"
VerticalAlignment="Top"
Height="308"
Width="471" >
<esri:OpenStreetMapLayer ID="OSM"
Style="Mapnik"
Initialized="OpenStreetMapLayer_Initialized"/>
</esri:Map>
and in the code behind I have this event handler:
private void OpenStreetMapLayer_Initialized(object sender, EventArgs e)
{
Envelope extent = new Envelope(1400000, 7420000, 1470000, 7450000)
{
SpatialReference = map1.SpatialReference
};
map1.ZoomTo(extent);
}
This works for ArcGISDynamicMapServiceLayer and Bing TileLayer. I'm using the Silverlight/WPF API version 2.0.
Does anybody know if this is a correct way of using ZoomTo() or why it doesn't work for OpenStreetMapLayer?