Select to view content in your preferred language

InfoWindow

896
3
07-09-2010 07:21 AM
NateArnold
Frequent Contributor
Hi:
It looks like there is not an InfoWindow in the Silverlight API, like there are in JavaScript and Flex. 

Flex:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/components/InfoWindow.html

JavaScript:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/query/query_showinfowindow.html


Map tips can show the contents I need, but they do not automatically move when the map is pan/zoomed, and in the case of point geometry, they disappear when the mouse is moved off of the feature (I want to show hyperlinks in the window - need to click inside the window!).  The toolkit MapTips stay visible when you click on the feature, but they do not move with the map pan/zom.  I came across this post where Morten outlined the process for showing a user control on mouse down for a graphics layer, but I'm having difficulty getting the control to stay in place in reference to map location when the map is pan/zoomed.  Using a canvas to assign the left and top properties of the initial window location works as long as the user does not pan/zoom, but the control location does not change when the map location does. 

It would be AWESOME if ESRI would create an InfoWindow for Silverlight API.  The InfoWindow in Flex and Javascript has some nice functionality like automatically moving the callout based on map extent.  Any advice or examples would be much appreciated. 

Thanks!

Nate Arnold
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
At the root element of you maptip, set the following hide delay property :
<Grid esri:GraphicsLayer.MapTipHideDelay="0:0:0.5"> ...

This will give plenty of time for the user to move the mouse over to the maptip before it closes.
0 Kudos
NateArnold
Frequent Contributor
I see this approach is used on the states graphics layer on this sample page, but it is assigned to a polygon layer, underneath a point layer.  If the delay parameter is defined on the map tip for a point graphics layer which overlays a polygon graphics layer, the delay is never activated. 

For example, assign the same MapTipHideDelay to the CitiesGraphicslayer:
            <esri:GraphicsLayer ID="CitiesGraphicsLayer" Initialized="CitiesGraphicsLayer_Initialized"  >
                <esri:GraphicsLayer.MapTip>
                    <Border esri:GraphicsLayer.MapTipHideDelay="00:00:1.5" BorderBrush="DarkGray" CornerRadius="13" BorderThickness="1" Margin="0,0,15,15" >



The delay works fine for cities like Miami and Savannah, where the user can mouse directly to the east and not mouse over one of the states polygons, but anywhere else it behaves as if the delay was not configured.  I understand this is happening because mousing off the cities triggers mouse on the states, but in my site I do have overlapping polygon/point graphics layers and I want to show a clickable map tip for the point layer.

Again, a Flex/Javascript-style InfoWindow would be the ideal solution for this, but do you have any suggestions on how to deal with maptips on overlapping graphics layers?

Thanks!
0 Kudos
wangzhifang
Frequent Contributor
I see this approach is used on the states graphics layer on this sample page, but it is assigned to a polygon layer, underneath a point layer.  If the delay parameter is defined on the map tip for a point graphics layer which overlays a polygon graphics layer, the delay is never activated. 

For example, assign the same MapTipHideDelay to the CitiesGraphicslayer:
            <esri:GraphicsLayer ID="CitiesGraphicsLayer" Initialized="CitiesGraphicsLayer_Initialized"  >
                <esri:GraphicsLayer.MapTip>
                    <Border esri:GraphicsLayer.MapTipHideDelay="00:00:1.5" BorderBrush="DarkGray" CornerRadius="13" BorderThickness="1" Margin="0,0,15,15" >



The delay works fine for cities like Miami and Savannah, where the user can mouse directly to the east and not mouse over one of the states polygons, but anywhere else it behaves as if the delay was not configured.  I understand this is happening because mousing off the cities triggers mouse on the states, but in my site I do have overlapping polygon/point graphics layers and I want to show a clickable map tip for the point layer.

Again, a Flex/Javascript-style InfoWindow would be the ideal solution for this, but do you have any suggestions on how to deal with maptips on overlapping graphics layers?

Thanks!


There do has a way:
Just like morten said, define a UserControl as your infowindow, but put it in an EnvelopeLayer, which will automatically process the children's position base on the map extent changing.
BTW, the ElementLayer on top of a GraphicsLayer won't block the click event of the GraphicsLayer:)
0 Kudos