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?
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.
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#ProjectUse the geometry of your graphic (in 4326) as the input, and use the output(in 102100) as the anchor point of your info window.
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 in WKID=4326
WKID=4326
Graphic graphic = new Graphic(); graphic.Geometry = new MapPoint(X, Y, new SpatialReference(4326)); graphic.Symbol = myImage;
OK.The IsOpen property returns true.Under the Anchor property, theres an Extent property with the following values:XMax -46.6654243469238XMin -46.6654243469238YMax -23.5543193817139YMin -23.5543193817139And the height and width properties are 0.0, is it normal?In the Extent property of myMap, there are the following values:XMax -5188689.952898005XMin -5195560.7625789493YMax -2697750.5551072815YMin -2701171.6058885315Height 3421.05078125Width 6870.8096809443086Is there anything wrong?Thanks
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. 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.
<esri:InfoWindow x:Name="MyInfoWindow" Padding="2" CornerRadius="20" Background="LightSalmon" ContentTemplate="{StaticResource MyFeatureLayerInfoWindowTemplate}" />
Are you having problems implementing a simple infoWindow? If so, then check this out:http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple
<Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources> <DataTemplate x:Name="MyFeatureLayerInfoWindowTemplate"> <StackPanel Orientation="Horizontal"> <TextBlock Text="TEST" Foreground="Black" FontSize="12" /> </StackPanel> </DataTemplate> </Grid.Resources> <esri:InfoWindow x:Name="MyInfoWindow" Padding="2" CornerRadius="20" Background="LightSalmon" ContentTemplate="{StaticResource MyFeatureLayerInfoWindowTemplate}" /> </Grid>
void graphic_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { Graphic gra = sender as Graphic; MyInfoWindow MyInfo = new MyInfoWindow(); MyInfo.MyInfoWindow.Content = gra.Attributes; MyInfo.MyInfoWindow.Anchor = gra.Geometry as MapPoint; MyInfo.MyInfoWindow.Map = CurrentPage.myMap; MyInfo.MyInfoWindow.IsOpen = true; }
Hi..Could you please post the code showing how you did this InfoWindow?I'm having some problems to implement this control...Thanks.
Is there a way to constrain the InfoWindow, when visible, to the size of the browser window? If a user clicks a point that is close to the top of the browser window, the InfoWindow expands past the top of the page. [ATTACH=CONFIG]12103[/ATTACH] Ideally I'd like to shift the map south so that the entire InfoWindow displays. [ATTACH=CONFIG]12104[/ATTACH]Any ideas?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.