Select to view content in your preferred language

Map Rotation  - Info window problem

1135
9
10-16-2011 02:14 AM
vipulsoni
Regular Contributor
Hi,

In our application we have the Map control rotated to a value of -38 and have info window (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple) shown on the map on FeatureLayer_MouseEnter event.

map.Rotation = -38;// map is rotated in the constructor
LayoutRoot.Children.Add(MyInfoWindow); // info window is added in the feature layer (DefaultMarkerSymbol) mouse enter event

till this point there are no issues and all works well and info window shows with all formatting correct with right details.

But recently during testing we have found that the info window does not show/display if the Featurelayer Symbol (mouse enter of this symbol is supposed to show the info window) is at top left or bottom right corner of the map.

If I remove the rotation code then the info window shows properly at all the corners of the map.
-------------------------------------------------------
ESRI Silverlight API 2.2
MS Silverlight 4
.net 4.0
ArcGIS Server 10.0 sp2
0 Kudos
9 Replies
JenniferNery
Esri Regular Contributor
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
}
0 Kudos
vipulsoni
Regular Contributor
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
}


Thank you Jennifer, the code and guidelines given by you, I tried them too but still I have the same behavior from the map that I dont see the info window only if the graphic is on the top left corner or bottom right corner of the map.

If at the same moment I pan the map to center the info window shows but if I pan the map back to the earlier location where the graphic comes to corner of the map, the info window disappears again. it is due to the map rotation only.. please let me know your views...
Thanks again 🙂
0 Kudos
JenniferNery
Esri Regular Contributor
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.
0 Kudos
vipulsoni
Regular Contributor
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.


I had tried all the possible ways and also the infowindowsimple sample which does not help. I pan the map and a already open infowindow disappears near, atleast half a inch away from the top left and (atleast half a inch away from map edge) bottom right corners of the map.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
That's a bug.

We'll try to get it fixed in a future version.

Thanks for reproting that.
0 Kudos
vipulsoni
Regular Contributor
That's a bug.

We'll try to get it fixed in a future version.

Thanks for reproting that.


Thank you Dominique 🙂
0 Kudos
vipulsoni
Regular Contributor
That's a bug.

We'll try to get it fixed in a future version.

Thanks for reproting that.


Hi,

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.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
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.
0 Kudos
vipulsoni
Regular Contributor
That will be fixed in the 3.0 release.


Thanks again Dominique , waiting for the final release now :rolleyes:.
0 Kudos