Hi
I am using the xammap control for silverlight and use Bing Maps as underlying tilesource layer.
Before using Bing Maps, the initial zoom was to the shape file, which fits perfectly our needs.
We have different shape files which are added dynamically, but we only have one layer at a time.
Our ideal solution would be that if the user accesses the chart the initial zoom would be exactly the shapefile and not the "entire world" like we have now. (we sometimes have shapefiles of smaller regions where it takes a long time to zoom to the region of interest).
How can we achieve this?
Thanks!
Roel
another question I have:
we are able to pan on the regions that are not covered by the shape file, but when we click on a region that is covered by the shape file, we cannot pan anymore. (zooming in/out with scroll still works). Can we solve this? I rather not have the zooming/panning control on the xammap control, but use the mouse.
Hi RoelMartens,
To set a focus on a particular shapefile, you could use the following approach:XAML: <igMap:XamMap x:Name="Map" Loaded="Map_Loaded" IsClickable="False"> <igMap:XamMap.Layers> <igMap:MapLayer x:Name="europe" Brushes="Green"> <igMap:MapLayer.Reader> <igMap:ShapeFileReader Uri="Shapefiles/europe/europe"/> </igMap:MapLayer.Reader> </igMap:MapLayer> </igMap:XamMap.Layers> </igMap:XamMap>CB: private void Map_Loaded(object sender, RoutedEventArgs e) { this.Map.WindowRect = this.Map.Layers[0].WorldRect; } Setting the IsClickable property of XamMap to False allows for panning the map, using mouse click even on the surface of the shapefile.
Edit: If you want to keep the IsClickable set to True, you could press and hold the Ctrl key while clicking/dragging with the mouse somewhere on the shapefile's surface. This would allow for the same functionality.
Hope that helps,Milana Zhileva