hi
Its possible to add user controls on the map ie... whether we can add text box button over xamwebmap.if any one know means pls guide me
Do you mean hovering over the map at specific coordinates? Or do you mean hovering over a specific element? Or do you mean positioned in a map layer?
-Graham
Hi,
Hovering over the specific element. Is it possible. If so please give some link for online tutorials
Hi
I haven't used data template and attached properties. I'm quite new to silverlight so please recommend some reading about this.
http://www.silverlightshow.net/items/Attached-Properties-in-Silverlight.aspx
http://msdn.microsoft.com/en-us/library/cc265152(VS.95).aspx
I tried to do the same with datagrid instead of of textblock (what you did in sample code) but its not working. i can view the datagrid but no data are bind to that. i have to load the data from db related to that particular element to that datagrid. how can i do that can you please help me in that....
Here's another sample that uses the XamWebGrid in the value template. Let me know if this helps.
Hi Graham
I am using value template to load data grid over map as you suggested. Its working fine when i use single layer but when i use more than one layer its not working. it loads the data grid when i click each element. ie when i click element 1 it loads the data grid and when i click the element 2 it loads the data grid again and the data grid loaded first is also visible. And one more problem is when i use shape file it loads the data grid over the element which was clicked but when use Geo spatial data instead of shape files it always loads the grid at center of the map. can you please check.
Ya the elements are visible again if i zoom in or zoom out...
Are they visible again if you zoom in further?
Great work really working nice.... but the problem is now when i pan the map some elements are not visible if i do zoom in or zoom out only its coming to visible if i do the code suggested by you.
you can see the difference in the following two snapshots
before pan
after pan(in selected area some elements are missing)
Shapes read from the SQL shape reader are not currently designed to work with the value templates. This is easy enough to work around with this MapLayer.Imported handler:
void MainPage_Imported(object sender, MapLayerImportEventArgs e) { foreach (MapElement ele in xamMap.Layers["USALayer"].Elements) { if (ele is SurfaceElement) { double minX = double.MaxValue; double minY = double.MaxValue; double maxX = double.MinValue; double maxY = double.MinValue; foreach (MapPolyline mpl in (ele as SurfaceElement).Polylines) { foreach (Point p in mpl) { minX = Math.Min(minX, p.X); minY = Math.Min(minY, p.Y); maxX = Math.Max(maxX, p.X); maxY = Math.Max(maxY, p.Y); } } ele.WorldRect = new Rect(minX, minY, maxX - minX, maxY - minY); } } xamMap.Layers["USALayer"].RenderWindow(); }
This help? (Obviously, replace USALayer with whatever your layer name is.)
Actually, I've run some experiments and I'm seeing similar behavior. I will try to determine whether this is a bug with the SQL shape reader, or whether we just don't currently support valuetemplates from this source.