Hello fine people!
Functionality that has suddenly cease to work is using the map.ZoomIn() when a GoogleMapOverlay is used.
The following code causes the map to zoom out completely.
I am using version 8 of Web Edition and have downloaded the latest daily build but the problem persists. Any ideas?
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
initialize();
}
}
protected void initialize()
{
Map1.MapUnit = GeographyUnit.Meter;
GoogleOverlay go = new GoogleOverlay();
Map1.CustomOverlays.Add(go);
Map1.CurrentExtent = new RectangleShape(2038381.27792588, -2719583.29928519, 3473460.1518379, -3949227.61563008);
Map1.ZoomIn();
}
Map.ZoomIn() and GoogleMapsOverlay
Hi Eugene,
Yes, the below codes will encounter your issue but we don’t recommend to do the Zoom or Pan operations in the page_load events. In most of cases, we would like to give the exact extent for the map directly.
Anyway, this is still a workaround here if you have to zoomIn when the page load, we can do this in the client side with the below codes:
<
script
language
=
“javascript”
type
=
“text/javascript”
>
function OnMapCreated(map) {
map.zoomIn();
}
<!–</code–>
script
>
Please feel free to let us know if any questions.
Thanks,
Troy