Hi,
I display the world map on the xamMap. Upon clicking a particular country, the map element of the country will be zoom in. I change the value of WindowZoomMaximum property. The thing is that whether I chose small or big country the zoom level is the same.
I wanna find out the zoom level based on the country size or area and also wanna make sure the element is shown at the center of screen.
How could i calculate the zoom level based on country size?
Thanks.
NNT
Hi NNT
XamMap's WindowZoomMaximum gets or sets the maximum possible zoom for the map. I assume that you want to use WindowZoom or WindowScale instead.
To show element at the center of the screen you can use XamMap's WindowFit method.
Please let me know if you have more questions.
Regards,
Ivan Kotev
Hi Ivan,
I'd like to ask two questions.
1. What's the difference between WindowZoom and WindowScale. How could i use them for centering a particular element?
2. Here is my current approach to try to get an element to the center of the map.
void Map_ElementClick(object sender, MapElementClickEventArgs e){ MainMap.WindowZoomMaximum = 8; MainMap.WindowFit(e.Element); }
The above code works perfect when a small country is selected. But when big countries like USA, Canada, Rusis, China are selected, they go out of the boundary. So What i 'd like to know is how to adjust zoom based on the country i selected.
Thanks a lot.