Solved! Go to Solution.
Ok. I've set the ContentTemplate in code-behind. No changes.
1- I don't think my InfoWindow is opening behind the map. There's no zIndex set in myMap and looks like there's no zIndex property in the InfoWindow aswell.
2- Yes, my map is contained inside a Grid. I saw the thread you refer, but in my case the infowindow doesnt even appear, while in the other cases the infowindow is appearing in the wrong position...
Thanks for trying to help me.
Try setting a breakpoint in your MouseDown event and see if myinfowindow.isopen returns true. If it is true, then check the anchorpoint property and see if it falls within the extnent of your map.
OK.
The IsOpen property returns true.
Under the Anchor property, theres an Extent property with the following values:
XMax -46.6654243469238
XMin -46.6654243469238
YMax -23.5543193817139
YMin -23.5543193817139
And the height and width properties are 0.0, is it normal?
In the Extent property of myMap, there are the following values:
XMax -5188689.952898005
XMin -5195560.7625789493
YMax -2697750.5551072815
YMin -2701171.6058885315
Height 3421.05078125
Width 6870.8096809443086
Is there anything wrong?
Thanks
Based on your anchor point, it looks like you are somewhere in Brazil? But.... Is your map in a different spatial reference? The coords between the infowindow and the map extent don't seem to line up. The infowindow is opening, but somewhere else in the world! Make sure your map spatial ref is inWKID=4326
Graphic graphic = new Graphic(); graphic.Geometry = new MapPoint(X, Y, new SpatialReference(4326)); graphic.Symbol = myImage;
What is the source of your point-graphic data? If it's a feature class (shapefile, GeoDB, etc.) You can either project the source data from 4326 to 102100 or you can define 4326 as the spatial reference for your data frame and let ArcGIS project it on the fly.
Alternatively, you can use a GeometryService to project your graphics coords from 4326 to 102100 right in ArcGIS Server. See: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Project
Use the geometry of your graphic (in 4326) as the input, and use the output(in 102100) as the anchor point of your info window.
I was just looking back at some of the previous posts and I see you said you are trying to implement the infoWindow inside a userControl which is not the same page as your map. Have you tried to use it inside the same page as your map? Maybe see if you can get it to work in there. If you can, then maybe that'll give you some hints. I've never tried to implement the infoWindow on a page that's not the same as my map. I'm not sure why you would want to.
You don't need to implement the infowindow inside your usercontrol, you can do it right on the same page as the map (the MainPage).
Is your graphicslayer defined in your XAML or is it done via codebehind?