Select to view content in your preferred language

InfoBox and Map extent

758
1
02-28-2011 06:35 AM
FaizanTayyab
Deactivated User
Is it possible to restrict the custom info popup to always lie within the current map extent. At the moment depending upon where the user clicks, the pop up is generated and displayed either left or right to the click. However if the user clicks near the bottom of the map, half of the pop up lies outside the current display.

Is it possible to move the custom info pop up box in current stage, if some part of it lies outside the current view.

I have tried a few things but have been having problems because of differences in the map coordinates and screen coordinates.


Has anyone got any ideas??
Tags (2)
0 Kudos
1 Reply
Drew
by
Frequent Contributor
I would not try and move the InfoWindow, but try and pan the map up instead. This should move the InfoWindow too.
The map component has some decent methods that might help detect the screen coordinates.
See the below map methods to help with your code.

toMap(screenPoint:Point):MapPoint
Converts a screen point to a map point.

toMapFromStage(stageX:Number, stageY:Number):MapPoint
Converts the global stage coordinates to a map point.

toScreen(mapPoint:MapPoint):Point
Converts a map point to a screen point.

Map Component URL:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/Map.html

Drew
0 Kudos