Overview
MapNavigator is a server control that displays a map and supports handling mouse events on the map in various ways depending on the DrawMode set at runtime. MapNavigator can optionally display a border with icons for panning and a footer with an x/y status area and, in the appropriate DrawModes, links to submit shapes drawn on the map or to clear drawn shapes.
MapNavigator should be used in a page that inherits from
MDNAjaxPage. The page should have a
MapControlBridge control as well. The MapNavigatorControlID of the
MapControlBridge should be set to the ID of the MapNavigator control. If a
MapToolset is also bound to the
MapControlBridge, then clicking toolset buttons will set produce various actions on the MapNavigator, for example setting the appropriate DrawMode for a mode button such as "Recenter" or "Draw Polygon" or updating the map for a command button such as "Zoom All" or "Clear All".
Configuration
Many configuration properties modify the layout and appearance of the MapNavigator. Most are straightforward, but some of the less obvious ones are
MarkerNodeSize - this is the size of the markers that indicate points in shape drawing modes.
NavItemColor - this is the color for markers, segments, and shading in shape drawing modes or for shapes added at runtime via ShapePreload or during callbacks via
MDNAjaxPage.MapClientStateUpdate.ShapeArray.
NavItemAlpha - transparency for filled drawn shapes, such as the rectangle displayed in "Zoom In" mode.
Behavior properties include several for using the mouse wheel to zoom the map.
UseMouseWheelZoom - set true to use the mouse wheel to zoom.
MouseWheelPause indicates how long the user should stop sending wheel events before a callback is made to handle the zoom.
MouseWheelZoomRation is how far to zoom in or out for each "wheel step" when using the wheel.
UseVML is a behavior property to indicate whether to use VML to draw shapes on the map. VML is only supported by IE, other browsers will fall back to non-VML drawing.
Configuring Client Events
A number of client events (OnClientXX) are provided. When bound to a
MapControlBridge within a page that inherits from
MDNAjaxPage some of these events are assigned by the
MDNAjaxPage. Any function you assign becomes a prehandler that can prevent default processing by returning false. These events are:
OnClientNavItemClick - handler for pan icons.
OnClientPointsSubmit - handler for submission of pixel points drawn on the map.
OnClientWheelPointsSubmit - handler for submission of the zoom envelope, in pixel points, inferred from the wheel action.
The following client events are not assigned by
MDNAjaxPage and are provided for you to use as needed.
OnClientMouseHover - called when the mouse hovers over the map. Also set MouseHoverDelay to the period of time the mouse should not move before this is called.
OnClientPointsChange - called when a point is drawn on the map, see
MapMeasurementPalette for one way this can be used.
OnClientXYChange - called as the mouse moves over the map.