Is there a Way to Change the Zoom Level When the Map is Loaded? Like how google and bing start out at Zoom Level 10, is there a way to make it start at Zoom Level 20?
Way to change the default Zoom level
Hi Gordon,
Please try following code to zoom map to ZoomLevel20 and center map at Point(0,10).
Controller:
//Set the map center.
map.CenterAt(
new
PointShape(0, 10));
//Zoom to zoom level 20.
map.ZoomToScale(map.ZoomLevelSet.ZoomLevel20.Scale);
Hope this would be helpful and any other question please feel free to let us know.
Thanks,
Kevin
Is there anyway to do this in the view? since im using a model in my view i cant have the map in the controller
Hi Gordon,
Please try below code to zoom map to ZoomLevel20 in view side.
View:
@{
//Set center of map before rendering map.
Model.CenterAt(
new
PointShape(0, 10));
Html.ThinkGeo().Map(Model)
//Set scale as ZoomLevel20 to zoom to zoomlevel20.
.CurrentScale(Model.ZoomLevelSet.ZoomLevel20.Scale)
.Render();
}
Hope this would be helpful and any other question please feel free to let us know.
Thanks,
Kevin