Click or drag to resize

MapCtrl Class

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Map Control Object for Windows Forms.
Inheritance Hierarchy

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.84.0.0
Syntax
public class MapCtrl : UserControl, IMap

The MapCtrl type exposes the following members.

Constructors
  NameDescription
Public methodMapCtrl
Create a new Map Control.
Top
Properties
  NameDescription
Public propertyAccessibilityObject (Inherited from Control.)
Public propertyAccessibleDefaultActionDescription (Inherited from Control.)
Public propertyAccessibleDescription (Inherited from Control.)
Public propertyAccessibleName (Inherited from Control.)
Public propertyAccessibleRole (Inherited from Control.)
Public propertyActiveControl (Inherited from ContainerControl.)
Public propertyActiveMouseHandler
Gets the active IMapMouseHandler, or null if there is no handler under the cursor.
Public propertyAllowDrop (Inherited from Control.)
Public propertyAllowEdgePan
Gets or sets whether the edges of the map should act as hotspots for panning.
Public propertyAnchor (Inherited from Control.)
Public propertyAutoScaleDimensions (Inherited from ContainerControl.)
Public propertyAutoScaleMode (Inherited from ContainerControl.)
Public propertyAutoScroll (Inherited from ScrollableControl.)
Public propertyAutoScrollMargin (Inherited from ScrollableControl.)
Public propertyAutoScrollMinSize (Inherited from ScrollableControl.)
Public propertyAutoScrollOffset (Inherited from Control.)
Public propertyAutoScrollPosition (Inherited from ScrollableControl.)
Public propertyAutoSize (Inherited from UserControl.)
Public propertyAutoSizeMode (Inherited from UserControl.)
Public propertyAutoValidate (Inherited from UserControl.)
Public propertyBackBufferRenderer
Gets or sets the back buffer's renderer.
Public propertyBackColor (Inherited from Control.)
Public propertyBackgroundImage
Gets a copy of the Image of the current map.
(Overrides ControlBackgroundImage.)
Public propertyBackgroundImageLayout (Inherited from Control.)
Public propertyBindingContext (Inherited from ContainerControl.)
Public propertyBorderStyle (Inherited from UserControl.)
Public propertyBottom (Inherited from Control.)
Public propertyBounds (Inherited from Control.)
Public propertyBusy
Returns true if the map is busy (for example, during a render or update).
Public propertyCanFocus (Inherited from Control.)
Public propertyCanSelect (Inherited from Control.)
Public propertyCapture (Inherited from Control.)
Public propertyCausesValidation (Inherited from Control.)
Public propertyCenter
Gets or sets the current Center of the map.
Public propertyCenterLat
Gets or sets the center latitude.
Public propertyCenterLon
Gets or sets the center longitude.
Public propertyClientRectangle (Inherited from Control.)
Public propertyClientSize (Inherited from Control.)
Public propertyCompanyName (Inherited from Control.)
Public propertyContainer (Inherited from Component.)
Public propertyContainsFocus (Inherited from Control.)
Public propertyContextMenu (Inherited from Control.)
Public propertyContextMenuStrip (Inherited from Control.)
Public propertyControls (Inherited from Control.)
Public propertyCreated (Inherited from Control.)
Public propertyCurrentAutoScaleDimensions (Inherited from ContainerControl.)
Public propertyCursor (Inherited from Control.)
Public propertyCustomMapBehavior
If any custom behavior is desired, handlers for the events can be assigned here. If behavior for an event is added, default behavior will not be executed.
Public propertyDataBindings (Inherited from Control.)
Public propertyDefaultMapCtrlBehavior
The default behavior of this MapCtrl.
Public propertyDisplayRectangle (Inherited from ScrollableControl.)
Public propertyCode exampleDisplayScale
Gets or sets the scale of map overlay objects (such as labels, shields, direction arrows, and highlights) relative to the underlying map tiles.
Public propertyDisposing (Inherited from Control.)
Public propertyDock (Inherited from Control.)
Public propertyDockPadding (Inherited from ScrollableControl.)
Public propertyDoubleBuffering
Double buffering allows Renderers to redraw without incurring the cost of a complete map redraw. Renderers on a double buffered map cannot interact with labels.
Public propertyDragBehavior
Set the behavior of the left button on the map when dragging.
Public propertyEdgePanPixels
The number of pixels around the border where the edge panning is active.
Public propertyEnabled (Inherited from Control.)
Public propertyFocused (Inherited from Control.)
Public propertyFont (Inherited from Control.)
Public propertyForeColor (Inherited from Control.)
Public propertyHandle (Inherited from Control.)
Public propertyHasChildren (Inherited from Control.)
Public propertyHeading
Gets or sets the heading (orientation) of the map.
Public propertyHeight (Inherited from Control.)
Public propertyHitHandler
Gets or sets the IMapMouseHandler hit handler to use.
Public propertyHorizontalScroll (Inherited from ScrollableControl.)
Public propertyImeMode (Inherited from Control.)
Public propertyInvokeRequired (Inherited from Control.)
Public propertyIsAccessible (Inherited from Control.)
Public propertyIsDisposed (Inherited from Control.)
Public propertyIsHandleCreated (Inherited from Control.)
Public propertyIsMirrored (Inherited from Control.)
Public propertyLastMapCached
Get whether the last map was drawn from cache.
Public propertyLastMapError
Gets the exception that occured last time the map was drawn, if any.
Public propertyLastMapTime
Gets the time taken to render the last map.
Public propertyLayers
Gets or sets an array of map layer names. These layers are rendered in accordance with the LayersRenderMode property.
Public propertyLayersRenderMode
Gets or sets the render mode used to render the map's Layers.
Public propertyLayoutEngine (Inherited from Control.)
Public propertyLeft (Inherited from Control.)
Public propertyLocation (Inherited from Control.)
Public propertyMap
Gets the underlying IMap.
Public propertyMapQuality
Gets or sets the quality at which the map will be rendered.
Public propertyMapScale
Gets the scale of the map.
Public propertyMargin (Inherited from Control.)
Public propertyMaximumSize (Inherited from Control.)
Public propertyMaxZoom
Gets or sets the maximum zoom level when operating in local mode.
Public propertyMinimumSize (Inherited from Control.)
Public propertyMinZoom
Gets or sets the minimum zoom level when operating in local mode.
Public propertyMouseButton
Gets the mouse button that was used to generate the event.
Public propertyName (Inherited from Control.)
Public propertyPadding (Inherited from Control.)
Public propertyPanEnable
Specifies whether the user should be able to pan the map with the mouse. If this is false, then all dragging behaviors for the map are disabled (including the zoom-to-rect action).
Public propertyParent (Inherited from Control.)
Public propertyParentForm (Inherited from ContainerControl.)
Public propertyPerspective
Gets or sets the map's perspective (if supported by the map).
Public propertyPixelSizeMeters
Public propertyPixelSizeMiles
Public propertyPreferredSize (Inherited from Control.)
Public propertyProductName (Inherited from Control.)
Public propertyProductVersion (Inherited from Control.)
Public propertyProgressive Obsolete.
For internal use only.
Public propertyProjected
Gets or sets whether the map is projected.
Public propertyRecreatingHandle (Inherited from Control.)
Public propertyRegion (Inherited from Control.)
Public propertyRenderer
The IMapRenderer to use for this map.
Public propertyRenderLabels
Gets or sets whether to render labels on the map.
Public propertyRight (Inherited from Control.)
Public propertyRightDragBehavior
Set the behavior of the right button on the map when dragging.
Public propertyRightToLeft (Inherited from Control.)
Public propertySatellite
Switch satellite imagery on / off.
Public propertySatelliteLayerName
The name of the map layer that will be used to provide satellite imagery. If specified then the imagery will be taken from the appropriate WMS layer in the GeoStream's layers.config file. Otherwise, standard GeoBase satellite imagery will be used.
Public propertySite (Inherited from Control.)
Public propertySize (Inherited from Control.)
Public propertyStyle
Gets or sets the MapStyle used to draw the map. Set this value to null to use the default map style.
Public propertyStyleName
Gets or sets the name of the style used to draw the map. Set this value to null to use the default map style.
Public propertyTabIndex (Inherited from Control.)
Public propertyTabStop (Inherited from Control.)
Public propertyTag (Inherited from Control.)
Public propertyText (Inherited from UserControl.)
Public propertyTilePerSuperTile
Gets or sets the number of tiles per supertile.
Public propertyTileSize
Gets or sets the size of a tile.
Public propertyTop (Inherited from Control.)
Public propertyTopLevelControl (Inherited from Control.)
Public propertyUiEnable
Specifies whether the user should be able to zoom and pan using the built-in map UI. This acts as an override for the individual settings of PanEnable and ZoomEnable: if UiEnable is false, both panning and zooming will be disabled, regardless of these more specific flags. If it is true, interactivity is determined by PanEnable and ZoomEnable.
Public propertyUseWaitCursor (Inherited from Control.)
Public propertyVerticalScroll (Inherited from ScrollableControl.)
Public propertyVisible (Inherited from Control.)
Public propertyWarnings
The Warnings generated during the last map render.
Public propertyWidth (Inherited from Control.)
Public propertyWindowTarget (Inherited from Control.)
Public propertyZoom
Gets or sets the current zoom level.
Public propertyZoomEnable
Specifies whether the user should be able to zoom the map in and out, either by scrolling the mouse wheel or by dragging out a zoom-box. If this is false, then the zoom-to-rect behavior will be disabled, and scrolling the mouse-wheel over the map will have no effect.
Public propertyZoomLevel
Defines the current zoom level for a MapCtrl operating in GeoStream mode. This differs from Zoom, in that ZoomLevel is expressed in terms of the array of Zooms; ZoomLevel is an index into the array.
Public propertyZooms
Defines the set of zoom levels to use when the MapCtrl is operating in GeoStream mode.
Top
Methods
  NameDescription
Public methodBeginInvoke(Delegate) (Inherited from Control.)
Public methodBeginInvoke(Delegate, Object) (Inherited from Control.)
Public methodBringToFront (Inherited from Control.)
Public methodCancelAsync
Cancels an asynchronous update, if one is in progress. Non-functional.
Public methodContains(Control) (Inherited from Control.)
Public methodContains(LatLon)
Check whether the LatLon coordinates lie within this IMap.
Public methodCreateControl (Inherited from Control.)
Public methodCreateGraphics (Inherited from Control.)
Public methodCreateObjRef (Inherited from MarshalByRefObject.)
Public methodDispose (Inherited from Component.)
Public methodDoDragDrop (Inherited from Control.)
Public methodDrawToBitmap (Inherited from Control.)
Public methodEndInvoke (Inherited from Control.)
Public methodEquals (Inherited from Object.)
Public methodFindForm (Inherited from Control.)
Public methodFocus (Inherited from Control.)
Public methodGetBackgroundImage
Gets the background image of the current map.
Public methodGetBoundingBox
Gets the BoundingBox of the Map
Public methodGetChildAtPoint(Point) (Inherited from Control.)
Public methodGetChildAtPoint(Point, GetChildAtPointSkip) (Inherited from Control.)
Public methodGetContainerControl (Inherited from Control.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetLastError
Returns the error that occurred during the last attempt to draw the map. This will return null if the last map was successfully drawn.
Public methodGetLifetimeService (Inherited from MarshalByRefObject.)
Public methodGetMap
Gets the current map Image.
Public methodCode exampleGetMap(Boolean, MapProgress, Boolean)
Gets an Image of the current map.
Public methodGetNextControl (Inherited from Control.)
Public methodGetPreferredSize (Inherited from Control.)
Public methodGetType (Inherited from Object.)
Public methodHide (Inherited from Control.)
Public methodInitializeLifetimeService (Inherited from MarshalByRefObject.)
Public methodInvalidate
Invalidating the map causes it to be redrawn.
Public methodInvalidate(Region) (Inherited from Control.)
Public methodInvalidate(Rectangle) (Inherited from Control.)
Public methodInvalidate(Boolean)
Invalidate the map and specify whether the redraw should be carried out immediately.
Public methodInvalidate(Region, Boolean) (Inherited from Control.)
Public methodInvalidate(Rectangle, Boolean) (Inherited from Control.)
Public methodInvalidateBackBuffer
Clears the back buffer that is used for DoubleBuffering.
Public methodInvoke(Delegate) (Inherited from Control.)
Public methodInvoke(Delegate, Object) (Inherited from Control.)
Public methodIsSelected
Check if the given IMapMouseHandler is selected.
Public methodLatLontoXY
Convert from a LatLon to an X,Y location on the map.
Public methodPerformAutoScale (Inherited from ContainerControl.)
Public methodPerformLayout (Inherited from Control.)
Public methodPerformLayout(Control, String) (Inherited from Control.)
Public methodPointToClient (Inherited from Control.)
Public methodPointToScreen (Inherited from Control.)
Public methodPreProcessControlMessage (Inherited from Control.)
Public methodPreProcessMessage (Inherited from Control.)
Public methodRectangleToClient (Inherited from Control.)
Public methodRectangleToScreen (Inherited from Control.)
Public methodRefresh
Refresh the current map.
(Overrides ControlRefresh.)
Public methodResetBackColor (Inherited from Control.)
Public methodResetBindings (Inherited from Control.)
Public methodResetCursor (Inherited from Control.)
Public methodResetFont (Inherited from Control.)
Public methodResetForeColor (Inherited from Control.)
Public methodResetImeMode (Inherited from Control.)
Public methodResetRightToLeft (Inherited from Control.)
Public methodResetText (Inherited from Control.)
Public methodResumeLayout (Inherited from Control.)
Public methodResumeLayout(Boolean) (Inherited from Control.)
Public methodScale(Single) Obsolete. (Inherited from Control.)
Public methodScale(SizeF) (Inherited from Control.)
Public methodScale(Single, Single) Obsolete. (Inherited from Control.)
Public methodScrollControlIntoView (Inherited from ScrollableControl.)
Public methodSelect (Inherited from Control.)
Public methodSelectNextControl (Inherited from Control.)
Public methodSendToBack (Inherited from Control.)
Public methodSetAutoScrollMargin (Inherited from ScrollableControl.)
Public methodSetBounds(Int32, Int32, Int32, Int32) (Inherited from Control.)
Public methodSetBounds(Int32, Int32, Int32, Int32, BoundsSpecified) (Inherited from Control.)
Public methodSetProperty
Allows map-specific (internal) properties to be set. For internal use.
Public methodSetRepository
Set the repository to draw the maps with. If not set, then the default repository is used.
Public methodSetSelection
Sets the current selection, and return the old selection.
Public methodShow (Inherited from Control.)
Public methodSuspendLayout (Inherited from Control.)
Public methodToString (Inherited from Component.)
Public methodUpdate (Inherited from Control.)
Public methodValidate (Inherited from ContainerControl.)
Public methodValidate(Boolean) (Inherited from ContainerControl.)
Public methodValidateChildren (Inherited from UserControl.)
Public methodValidateChildren(ValidationConstraints) (Inherited from UserControl.)
Public methodXYtoBoundingBox
Gets the BoundingBox of two pixel locations, x1,y1 and x2,y2.
Public methodXYtoLatLon
Gets the LatLon of a point on the map given by x & y coordinates.
Public methodCode exampleZoomToBoundingBox(BoundingBox, Int32)
Zooms the map and centers on the given BoundingBox.
Public methodZoomToBoundingBox(BoundingBox, MapBuffer)
Zooms the map to display the given bounding box with a separate buffer on each side.
Top
Events
  NameDescription
Public eventAutoSizeChanged (Inherited from UserControl.)
Public eventAutoValidateChanged (Inherited from UserControl.)
Public eventBackColorChanged (Inherited from Control.)
Public eventBackgroundImageChanged (Inherited from Control.)
Public eventBackgroundImageLayoutChanged (Inherited from Control.)
Public eventBindingContextChanged (Inherited from Control.)
Public eventCausesValidationChanged (Inherited from Control.)
Public eventCenterChanged
This event handler is called when the map is panned, changing the center location.
Public eventChangeUICues (Inherited from Control.)
Public eventClick (Inherited from Control.)
Public eventClientSizeChanged (Inherited from Control.)
Public eventContextMenuChanged (Inherited from Control.)
Public eventContextMenuStripChanged (Inherited from Control.)
Public eventControlAdded (Inherited from Control.)
Public eventControlRemoved (Inherited from Control.)
Public eventCursorChanged (Inherited from Control.)
Public eventDisposed (Inherited from Component.)
Public eventDockChanged (Inherited from Control.)
Public eventDoubleClick (Inherited from Control.)
Public eventDragDrop (Inherited from Control.)
Public eventDragEnter (Inherited from Control.)
Public eventDragLeave (Inherited from Control.)
Public eventDragOver (Inherited from Control.)
Public eventEnabledChanged (Inherited from Control.)
Public eventEnter (Inherited from Control.)
Public eventFontChanged (Inherited from Control.)
Public eventForeColorChanged (Inherited from Control.)
Public eventGiveFeedback (Inherited from Control.)
Public eventGotFocus (Inherited from Control.)
Public eventHandleCreated (Inherited from Control.)
Public eventHandleDestroyed (Inherited from Control.)
Public eventHelpRequested (Inherited from Control.)
Public eventImeModeChanged (Inherited from Control.)
Public eventInvalidated (Inherited from Control.)
Public eventKeyDown (Inherited from Control.)
Public eventKeyPress (Inherited from Control.)
Public eventKeyUp (Inherited from Control.)
Public eventLayout (Inherited from Control.)
Public eventLeave (Inherited from Control.)
Public eventLoad (Inherited from UserControl.)
Public eventLocationChanged (Inherited from Control.)
Public eventLostFocus (Inherited from Control.)
Public eventMapSizeChanged
This event handler is called when the map is resized.
Public eventMarginChanged (Inherited from Control.)
Public eventMouseCaptureChanged (Inherited from Control.)
Public eventMouseClick (Inherited from Control.)
Public eventMouseDoubleClick (Inherited from Control.)
Public eventMouseDown (Inherited from Control.)
Public eventMouseEnter (Inherited from Control.)
Public eventMouseHover (Inherited from Control.)
Public eventMouseLeave (Inherited from Control.)
Public eventMouseMove (Inherited from Control.)
Public eventMouseUp (Inherited from Control.)
Public eventMouseWheel (Inherited from Control.)
Public eventMove (Inherited from Control.)
Public eventOnRedraw
Called when the map has changed.
Public eventOnRenderComplete
This EventHandler is called when rendering is complete.
Public eventOnRenderException
This EventHandler is called when an exception is encountered during rendering.
Public eventOnRenderStart
This EventHandler is called when rendering is begun.
Public eventOnZoomLevelChanged
This EventHandler is called when the ZoomLevel has changed. Note that this is only valid if the current repository is a GeoStreamRepository
Public eventPaddingChanged (Inherited from Control.)
Public eventPaint (Inherited from Control.)
Public eventParentChanged (Inherited from Control.)
Public eventPreviewKeyDown (Inherited from Control.)
Public eventQueryAccessibilityHelp (Inherited from Control.)
Public eventQueryContinueDrag (Inherited from Control.)
Public eventRegionChanged (Inherited from Control.)
Public eventResize (Inherited from Control.)
Public eventRightToLeftChanged (Inherited from Control.)
Public eventScroll (Inherited from ScrollableControl.)
Public eventSizeChanged (Inherited from Control.)
Public eventStyleChanged (Inherited from Control.)
Public eventSystemColorsChanged (Inherited from Control.)
Public eventTabIndexChanged (Inherited from Control.)
Public eventTabStopChanged (Inherited from Control.)
Public eventTextChanged (Inherited from UserControl.)
Public eventValidated (Inherited from Control.)
Public eventValidating (Inherited from Control.)
Public eventVisibleChanged (Inherited from Control.)
Public eventZoomChanged
This event handler is called when the zoom level changes.
Top
Fields
  NameDescription
Public fieldClickToCenter
A left-click will center the map on the mouse location, if set to true and DragBehavior is set to Box.
Public fieldDrawMaps
Set to false to prevent maps being drawn.
Top
Remarks

Use this object for Windows Forms applications. For ASP.NET and other server applications, use the Map Object or the Map class.

There are a number of functions common to most MapCtrl applications. These functions include:

  • Displaying custom objects on the map.
  • Responding to mouse clicks.

Custom objects can be displayed on the map by implementing the IMapRenderer interface. An example of such an object is the PushPin location marker. To display multiple objects it is necessary to use a RendererList - essentially a collection of renderable objects. The Tutorials section contains a tutorial on IMapRenderers which also covers RendererLists.

Rendered objects that need to respond to mouse clicks should implement the IMapMouseHandler interface. The MapMouseEventsHandler may be used to simplify this procedure. The application example in the Tutorials section contains examples of mouse event handling.

Two keyboard-modifiers affect mouse behavior in MapCtrl by default.

  • When the Shift key is pressed, the selected mouse function temporarily inverts: The pan tool becomes the area selection tool, and the area selection tool becomes the pan tool.
  • When the Ctrl key is pressed, mouse wheel zoom intervals are temporarily decreased.

Related articles: Common Concepts, Map Concept, Map Control Tutorial, Using Notifications and Events, Creating the Interface.

See Also