Hi , How can i set a default zoom to my XampMap when its displayed ,
thanks
Hi bouhmid86,
A sample approach to achieve this could be the following.
XAML: <igMap:XamMap x:Name="map1" Loaded="map1_Loaded"> <igMap:XamMap.Layers> <igMap:MapLayer x:Name="statesLayer"> <igMap:MapLayer.Reader> <igMap:ShapeFileReader Uri="Shapefiles/usa/usa_st" DataMapping="Name=STATE_NAME; Value=POP1997; Caption=STATE_NAME"/> </igMap:MapLayer.Reader> </igMap:MapLayer> </igMap:XamMap.Layers> </igMap:XamMap>
CB: private void map1_Loaded(object sender, RoutedEventArgs e) { ZoomMapToRegion(3); }
public void ZoomMapToRegion(double zoom) { DispatcherTimer timer = new DispatcherTimer() { Interval = TimeSpan.FromSeconds(1.0) };
timer.Tick += (o, e) => { map1.WindowZoom = zoom; ((DispatcherTimer)o).Stop(); };
timer.Start(); }
Hope that helps,Milana Zhileva
Thanks, it works but iwant this zoom centred in france , how can i do this , thanks a lot