Hi
I want to add multiple layer to the map dynamically. ie i don't know how many layers im going to add at compile time. how can i do this and i want to couple mouse click event to each element. The exact scenario is i have one layer primarily when i zoom in to the primary layer i have to show next layer at one particular zoom level and when i zoom in to the newly added layer i have to add another layer and so on. i can use visiblefromscale property here. i am using Geo spatial data to load map.i have created a service to load shapes but here we will create client to the service in the name of layer and in the GetDateCompleted event we used to import the source. since i don't know the number of layers how can i do this... Can any one help me in this....
you can add a layer to the map in C# using code like this:
MapLayer layer = new MapLayer(); layer.Reader = new ShapeFileReader() { Uri = "usa_st" }; this.xamWebMap1.Layers.Add(layer); layer.ImportAsync();
the mouse clicks can all be handled inside the XamWebMap's ElementClick event handler.
hi
how to get the zoom level when im zooming in or out. Because i want to display some controls or images over map when i am in particular zoom level. Let say i want to display chart at zoom level 3 and i want to display grid at zoom level five.
You can get notified of the map scale changing by using the WindowRectChanged event. And you can examine the current map zoom level by examining the property WindowZoom. e.g.
private void theMap_WindowRectChanged(object sender, Infragistics.Silverlight.Map.MapWindowRectChangedEventArgs e) { System.Diagnostics.Debug.WriteLine(theMap.WindowZoom.ToString()); }
This help?
-Graham
ya its working... thanks