FeatureLayer featureLayer = MyMap.Layers["MyFeatureLayer"] as FeatureLayer; System.Windows.Point screenPnt = e.GetPosition(MyMap); // Account for difference between Map and application origin GeneralTransform generalTransform = MyMap.TransformToVisual(Application.Current.RootVisual); System.Windows.Point transformScreenPnt = generalTransform.Transform(screenPnt); IEnumerable<Graphic> selected = featureLayer.FindGraphicsInHostCoordinates(transformScreenPnt); foreach (Graphic g in selected) { //this must be your graphic of interest }
When you were using mouse event on the FeatureLayer, you had direct access to the graphic in the GraphicMouseButtonEventArgs. If you moved your mouse event to the symbol control template, you need to use screen point and FindGraphicsInHostCoordinates
FeatureLayer featureLayer = MyMap.Layers["MyFeatureLayer"] as FeatureLayer; System.Windows.Point screenPnt = e.GetPosition(MyMap); // Account for difference between Map and application origin GeneralTransform generalTransform = MyMap.TransformToVisual(Application.Current.RootVisual); System.Windows.Point transformScreenPnt = generalTransform.Transform(screenPnt); IEnumerable<Graphic> selected = featureLayer.FindGraphicsInHostCoordinates(transformScreenPnt); foreach (Graphic g in selected) { //this must be your graphic of interest }
I think InfoWindow is open but is not visible until you pan the map.
Try the SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple. Pan the map to where the feature is not fully visible and click on it, InfoWindow is open but is not within view until you pan the map.
That's a bug.
We'll try to get it fixed in a future version.
Thanks for reproting that.
That's a bug.
We'll try to get it fixed in a future version.
Thanks for reproting that.
I have recently checked this bug still present in (map rotated to double -38 and infowindow unable to display on top left and bottom right corners of the map) the ArcGIS API for Silverlight v3.0 , it is still not fixed. Map rotation is highly required in various cases and Infowindow issue should be fixed.
That will be fixed in the 3.0 release.