Public Member Functions | Properties | Events
AxMap Class Reference

Map component for visualization of vector, raster or grid data. More...

List of all members.

Public Member Functions

int AddLayer (object Object, bool Visible)
 Adds a layer to the map.
int AddLayerFromDatabase (string connectionString, string layerNameOrQuery, bool visible)
 Adds a layer from spatial database accessed via GDAL/OGR drivers.
int AddLayerFromFilename (string filename, tkFileOpenStrategy openStrategy, bool visible)
 Adds layer from the specified datasource.
void Clear ()
 Removes all data from the map and sets its properties to the default state.
void ClearDrawing (int DrawHandle)
 Clears all the drawings on the drawing layer specified.
void ClearDrawingLabels (int DrawHandle)
 Clears labels on the specified drawing layer.
void ClearDrawings ()
 Clears all drawings on all drawing layers. This method is slower than using ClearDrawing on a specific layer.
bool DegreesToPixel (double degreesLngX, double degreesLatY, ref double pixelX, ref double pixelY)
 Converts pixel coordinates to decimal degrees (map projection must be specified for this method to work).
bool DegreesToProj (double degreesLngX, double degreesLatY, ref double projX, ref double projY)
 Converts coordinates in decimal degrees to projected map coordinates (map projection must be specified for this method to work).
bool DeserializeLayer (int LayerHandle, string newVal)
 Restores the state of the layer from the string generated by AxMap.SerializeLayer().
bool DeserializeMapState (string State, bool LoadLayers, string BasePath)
 Restores map state from the string generated by AxMap.SerializeMapState.
void DrawBackBuffer (IntPtr hdc, int ImageWidth, int ImageHeight)
 Draws the content of the back buffer to specified device context.
void DrawCircle (double x, double y, double pixelRadius, uint Color, bool fill)
 Draws a circle on the last drawing layer created by NewDrawing.
void DrawCircleEx (int LayerHandle, double x, double y, double pixelRadius, uint Color, bool fill)
 Draws a circle on the specified drawing layer.
int DrawLabel (string Text, double x, double y, double Rotation)
 Draws a label on the current drawing layer.
int DrawLabelEx (int DrawHandle, string Text, double x, double y, double Rotation)
 Draws a label on the specified drawing layer.
void DrawLine (double x1, double y1, double x2, double y2, int pixelWidth, uint Color)
 Draws a line on the last drawing layer created using NewDrawing.
void DrawLineEx (int LayerHandle, double x1, double y1, double x2, double y2, int pixelWidth, uint Color)
 Draws a line on the specified drawing layer.
void DrawPoint (double x, double y, int pixelSize, uint Color)
 Draws a point on the last drawing layer created by NewDrawing.
void DrawPointEx (int LayerHandle, double x, double y, int pixelSize, uint Color)
 Draws a point on the specified drawing layer.
void DrawPolygon (ref object xPoints, ref object yPoints, int numPoints, uint Color, bool fill)
 Draws a polygon on the last drawing layer created using NewDrawing.
void DrawPolygonEx (int LayerHandle, ref object xPoints, ref object yPoints, int numPoints, uint Color, bool fill)
 Draws a polygon on the specified drawing layer.
void DrawWideCircle (double x, double y, double pixelRadius, uint Color, bool fill, short Width)
 Draws a circle with custom outline width on the last drawing layer created by NewDrawing.
void DrawWideCircleEx (int LayerHandle, double x, double y, double radius, uint Color, bool fill, short OutlineWidth)
 Draws a circle with custom outline width on the specified drawing layer.
void DrawWidePolygon (ref object xPoints, ref object yPoints, int numPoints, uint Color, bool fill, short Width)
 Draws a polygon with custom width of outline on the last drawing layer created using NewDrawing.
void DrawWidePolygonEx (int LayerHandle, ref object xPoints, ref object yPoints, int numPoints, uint Color, bool fill, short OutlineWidth)
 Draws a polygon with custom width of outline on the last drawing layer created using NewDrawing.
bool FindSnapPoint (double tolerance, double xScreen, double yScreen, ref double xFound, ref double yFound)
 Returns coordinate of the shapefile point closest to specified point on screen.
double GeodesicArea (Shape polygon)
 Calculates area of polygon taking into account the shape of Earth.
double GeodesicDistance (double projX1, double projY1, double projX2, double projY2)
 Calculates geodesic distance between 2 points defined in map coordinate system.
double GeodesicLength (Shape polyline)
 Calculates length of polyline or perimeter of polygon taking into account the shape of Earth.
string get_DrawingKey (int DrawHandle)
 Gets the drawing key which may be used by the programmer to store any string for a drawing layer with specified handle.
Labels get_DrawingLabels (int DrawingLayerIndex)
 Gets labels associated with the drawing layer.
bool get_DrawingLabelsVisible (int DrawHandle)
 Gets a boolean value which indicates whether labels of the drawing layer are visible.
string get_ErrorMsg (int ErrorCode)
 Retrieves the error message associated with the specified error code.
object get_GetObject (int LayerHandle)
 Returns the layer object with the given handle. The object could be a Shapefile, Grid, or Image object.
Image get_Image (int LayerHandle)
 Gets image object associated with the layer.
string get_LayerDescription (int LayerHandle)
 Gets the description of the layer from the associated .mwsymb file.
bool get_LayerDynamicVisibility (int LayerHandle)
 Gets the boolean value which indicates whether the layer will be displayed at all scales or only within the chosen range of scales.
string get_LayerFilename (int layerHandle)
 Gets filename of datasource for the specified layer.
int get_LayerHandle (int LayerPosition)
 Gets the handle of the layer at the given position in the map. Returns -1 if there is no layer at the specified position.
string get_LayerKey (int LayerHandle)
 Gets a string associated with a layer in the map.
MapWinGIS.Labels get_LayerLabels (int LayerHandle)
 Returns labels associated with layer.
double get_LayerMaxVisibleScale (int LayerHandle)
 Gets the maximum scale at which the layer is visible on the map.
int get_LayerMaxVisibleZoom (int layerHandle)
 Gets maximum zoom at which the layer will be displayed.
double get_LayerMinVisibleScale (int LayerHandle)
 Gets the minimum scale at which the layer is visible on the map.
int get_LayerMinVisibleZoom (int layerHandle)
 Gets minimum zoom at which the layer will be displayed.
string get_LayerName (int LayerHandle)
 Gets the name of the specified layer.
int get_LayerPosition (int LayerHandle)
 Gets the position of the specified layer in the map.
bool get_LayerSkipOnSaving (int LayerHandle)
 Gets a boolean value which indicates whether the layer will be serialized by appropriate routines.
bool get_LayerVisible (int LayerHandle)
 Gets the visibility of the specified layer.
bool get_LayerVisibleAtCurrentScale (int layerHandle)
 Gets a value which indicates whether a layer is visible at current map scale.
OgrLayer get_OgrLayer (int layerHandle)
 Gets instance of OGR layer object associated with the specified layer.
Shapefile get_Shapefile (int LayerHandle)
 Gets shapefile object associated with the layer.
bool get_ShapeLayerDrawFill (int LayerHandle)
 Gets whether the specified layer is drawn with a fill. Only works on polygon shapefiles.
bool get_ShapeLayerDrawLine (int LayerHandle)
 Gets whether the lines for the shapefile in specified layer are drawn.
bool get_ShapeLayerDrawPoint (int LayerHandle)
 Gets whether the points/vertices for the shapefile in specified layer are drawn.
uint get_ShapeLayerFillColor (int LayerHandle)
 Gets the fill color for the specified layer. Only works on polygon shapefiles.
MapWinGIS.tkFillStipple get_ShapeLayerFillStipple (int LayerHandle)
 Gets the fill stipple for the specified layer. Only works on polygon shapefiles.
float get_ShapeLayerFillTransparency (int LayerHandle)
 Gets the percentage of fill transparency for the specified layer. Only works on polygon shapefiles.
uint get_ShapeLayerLineColor (int LayerHandle)
 Gets the line color for the specified layer. Only works on shapefiles.
MapWinGIS.tkLineStipple get_ShapeLayerLineStipple (int LayerHandle)
 Gets the line stipple for the specified layer. Only works on shapefiles.
float get_ShapeLayerLineWidth (int LayerHandle)
 Gets the line width for the specified layer. Only works on shapefiles. Suggested values for line width: 1 - 5.
uint get_ShapeLayerPointColor (int LayerHandle)
 Gets the point color for the specified layer. Only works on shapefiles.
float get_ShapeLayerPointSize (int LayerHandle)
 Gets the line point/vertex size for the specified layer. Only works on shapefiles.
MapWinGIS.tkPointType get_ShapeLayerPointType (int LayerHandle)
 Gets the line point type for the specified layer. Only works on shapefiles.
uint get_ShapeLayerStippleColor (int LayerHandle)
 Gets the color of the polygon stipple for shapefile layer.
bool get_ShapeLayerStippleTransparent (int LayerHandle)
 Gets a boolean value which indicates whether the background of fill stipple for polygon shapefile layer will be transparent.
object GetColorScheme (int LayerHandle)
 Returns a color scheme for the specified layer.
Extents GetKnownExtents (tkKnownExtents extents)
 Gets known extents.
int HWnd ()
 Returns the handle of the window of map control.
bool LoadLayerOptions (int LayerHandle, string OptionsName, ref string Description)
 Applies to the layer a set of settings from file with the specified name.
bool LoadMapState (string Filename, object Callback)
 Loads the state of the map from the file created by AxMap.SaveMapState method.
void LoadTilesForSnapshot (Extents extents, int width, string key, tkTileProvider provider)
 Loads tiles for the specified map extents.
void LockWindow (MapWinGIS.tkLockMode LockMode)
 Locks the window so that any changes will not be displayed until it is unlocked.
bool MoveLayer (int InitialPosition, int TargetPosition)
 Moves a layer in the map from the initial position to a target position.
bool MoveLayerBottom (int InitialPosition)
 Moves the specified layer below all other layers.
bool MoveLayerDown (int InitialPosition)
 Moves the specified layer down one layer in the map.
bool MoveLayerTop (int InitialPosition)
 Moves the specified layer to the top of all other layers.
bool MoveLayerUp (int InitialPosition)
 Moves the specified layer up one layer in the map.
int NewDrawing (MapWinGIS.tkDrawReferenceList Projection)
 Creates a new drawing layer on the map returning its handle.
bool PixelToDegrees (double pixelX, double pixelY, ref double degreesLngX, ref double degreesLatY)
 Converts coordinates in decimal degrees to pixel coordinates (map projection must be specified for this method to work).
void PixelToProj (double pixelX, double pixelY, ref double projX, ref double projY)
 Converts pixel coordinates to projected map coordinates.
bool ProjToDegrees (double projX, double projY, ref double degreesLngX, ref double degreesLatY)
 Converts projected map coordinates to decimal degrees (map projection must be specified for this method to work).
void ProjToPixel (double projX, double projY, ref double pixelX, ref double pixelY)
 Converts projected map coordinates into screen pixel units.
void Redraw ()
 Redraws all layers in the map if the map is not locked.
void Redraw2 (tkRedrawType redrawType)
 Performs specific type of map redraw.
void RemoveAllLayers ()
 Removes all layers from the map.
void RemoveLayer (int LayerHandle)
 Removes the specified layer from the map.
bool RemoveLayerOptions (int LayerHandle, string OptionsName)
 Removes set of options for the layer with the specified name.
void RemoveLayerWithoutClosing (int LayerHandle)
 Removes layer from the map without its closing.
void Resize (int Width, int Height)
 Resizes the map to the given width and height.
void ReSourceLayer (int LayerHandle, string newSrcPath)
 Changes the data source for the specified layer without its closing.
bool SaveLayerOptions (int LayerHandle, string OptionsName, bool Overwrite, string Description)
 Saves settings of the layer to the file.
bool SaveMapState (string Filename, bool RelativePaths, bool Overwrite)
 Saves the state of the map to the specified file.
string SerializeLayer (int LayerHandle)
 Serializes the layer settings to the string.
string SerializeMapState (bool RelativePaths, string BasePath)
 Serializes map state to the string.
void set_DrawingKey (int DrawHandle, string newValue)
 Sets the drawing key may be used by the programmer to store any string for a drawing layer with specified handle.
void set_DrawingLabels (int DrawingLayerIndex, Labels newValue)
 Replaces the labels associated with the drawing layer.
void set_DrawingLabelsVisible (int DrawHandle, bool newValue)
 Sets a boolean value which indicates whether labels of the drawing layer are visible.
void set_Image (int LayerHandle, Image newValue)
 Replaces the image object associated with the layer.
void set_LayerDescription (int LayerHandle, string newValue)
 Sets the description of the layer.
void set_LayerDynamicVisibility (int LayerHandle, bool newValue)
 Sets the boolean value which indicates whether the layer will be displayed at all scales or only within the chosen range of scales.
void set_LayerKey (int LayerHandle, string newValue)
 Sets a string associated with a layer in the map.
void set_LayerLabels (int LayerHandle, MapWinGIS.Labels newValue)
 Sets the labels associated with the layer.
void set_LayerMaxVisibleScale (int LayerHandle, double newValue)
 Sets the maximum scale at which the layer is visible on the map.
void set_LayerMaxVisibleZoom (int layerHandle, int param0)
 Sets maximum zoom at which the layer will be displayed.
void set_LayerMinVisibleScale (int LayerHandle, double newValue)
 Sets the minimum scale at which the layer is visible on the map.
void set_LayerMinVisibleZoom (int layerHandle, int param0)
 Sets minimum zoom at which the layer will be displayed.
void set_LayerName (int LayerHandle, string newValue)
 Sets the name of the specified layer.
void set_LayerSkipOnSaving (int LayerHandle, bool newValue)
 Sets a boolean value which indicates whether the layer will be serialized by appropriate routines.
void set_LayerVisible (int LayerHandle, bool newValue)
 Sets the visibility of the specified layer.
void set_Shapefile (int LayerHandle, Shapefile newValue)
 Replaces the shapefile object associated with the layer.
void set_ShapeLayerDrawFill (int LayerHandle, bool newValue)
 Sets whether the specified layer is drawn with a fill. Only works on polygon shapefiles.
void set_ShapeLayerDrawLine (int LayerHandle, bool newValue)
 Sets whether the lines for the shapefile in specified layer are drawn.
void set_ShapeLayerDrawPoint (int LayerHandle, bool newValue)
 Sets whether the points/vertices for the shapefile in specified layer are drawn.
void set_ShapeLayerFillColor (int LayerHandle, uint newValue)
 Sets the fill color for the specified layer. Only works on polygon shapefiles.
void set_ShapeLayerFillStipple (int LayerHandle, MapWinGIS.tkFillStipple newValue)
 Sets the fill stipple for the specified layer. Only works on polygon shapefiles.
void set_ShapeLayerFillTransparency (int LayerHandle, float newValue)
 Sets the percentage of fill transparency for the specified layer. Only works on polygon shapefiles.
void set_ShapeLayerLineColor (int LayerHandle, uint newValue)
 Sets the line color for the specified layer. Only works on shapefiles.
void set_ShapeLayerLineStipple (int LayerHandle, MapWinGIS.tkLineStipple newValue)
 Sets the line stipple for the specified layer. Only works on shapefiles.
void set_ShapeLayerLineWidth (int LayerHandle, float newValue)
 Sets the line width for the specified layer. Only works on shapefiles. Suggested values for line width: 1 - 5.
void set_ShapeLayerPointColor (int LayerHandle, uint newValue)
 Sets the point color for the specified layer. Only works on shapefiles.
void set_ShapeLayerPointSize (int LayerHandle, float newValue)
 Sets the line point/vertex size for the specified layer. Only works on shapefiles.
void set_ShapeLayerPointType (int LayerHandle, MapWinGIS.tkPointType newValue)
 Sets the line point type for the specified layer. Only works on shapefiles.
void set_ShapeLayerStippleColor (int LayerHandle, uint newValue)
 Sets the color of the polygon stipple for shapefile layer.
void set_ShapeLayerStippleTransparent (int LayerHandle, bool newValue)
 Sets a boolean value which indicates whether the background of fill stipple for polygon shapefile layer will be transparent.
void SetDrawingLayerVisible (int LayerHandle, bool Visible)
 Sets the boolean value which indicates whether the labels of the drawing layer are visible.
virtual bool SetGeographicExtents (Extents pVal)
 Sets geographic extents in decimal degrees for the map.
bool SetGeographicExtents2 (double xLongitude, double yLatitude, double widthKilometers)
 Sets geographic extents for the map.
void ShowToolTip (string Text, int Milliseconds)
 Shows tooltip near the mouse cursor.
object SnapShot (object BoundBox)
 Takes snap shot of the contents of the map within the bounds of the specified rectangle, returning an image of the results.
object SnapShot2 (int ClippingLayerNbr, double Zoom, int pWidth)
 Takes snap shot of the contents of the map and returns it as an image object.
object SnapShot3 (double left, double right, double top, double bottom, int Width)
 Takes snap shot of the contents of the map in the specified bounding box and returns it as an image object.
bool SnapShotToDC (IntPtr hdc, MapWinGIS.Extents Extents, int Width)
 Performs drawing of the map contents to the specified device context.
int TilesAreInCache (Extents extents, int width, tkTileProvider provider)
 Checks whether tiles for specified extents and provider are already present in cache.
virtual void Undo ()
 Reverts the last operation performed by user in interactive shape editor.
void ZoomIn (double Percent)
 Zooms the display in by the given factor.
void ZoomOut (double Percent)
 Zooms the display out by the specified factor.
void ZoomToLayer (int LayerHandle)
 Zooms the map display to the specified layer.
void ZoomToMaxExtents ()
 Zooms the map to the maximum extents of all loaded layers.
void ZoomToMaxVisibleExtents ()
 Zooms the map to the maximum extents of all loaded visible layers.
int ZoomToPrev ()
 Zooms the map view to the previous extents if there are previous extents in the extents history.
bool ZoomToSelected (int layerHandle)
 Zoomes map to display selected shapes of the specified shapefile.
void ZoomToShape (int LayerHandle, int Shape)
 Zooms the map display to the specified shape in the shapefile contained by the specified layer.
bool ZoomToTileLevel (int zoom)
 Zooms map to specified zoom level of the active tile provider (Map.Tiles.Provider).
bool ZoomToWorld ()
 Zooms to World extents (-180.0; 180.0; -90.0; 90.0)

Properties

tkCustomState AnimationOnZooming [get, set]
 Gets or sets a value indicating whether animation will be displayed zooming map in or out.
uint BackColor [get, set]
 Gets or sets the background color of the map.
double CurrentScale [get, set]
 Gets or sets the current map scale.
int CurrentZoom [get, set]
 Gets or sets the current zoom level for the map. It corresponds to the zoom level of current tile provider.
MapWinGIS.tkCursorMode CursorMode [get, set]
 Gets or sets the cursor mode for the map.
bool DisableWaitCursor [get, set]
 Gets or sets a boolean value which indicates whether a wait cursor will be displayed on map redraw.
int ExtentHistory [get, set]
 Gets or sets the number of extents to cache in the extents history.
double ExtentPad [get, set]
 Gets or sets the percentage of the view used to pad the extents of a layer when zooming to a layer or maximum extents.
object Extents [get, set]
 Gets or sets the extents of the map using an Extents object.
MapWinGIS.FileManager FileManager [get]
 Gets FileManager object associated with map. The object is used by AxMap.AddLayerFromFilename methods.
Extents GeographicExtents [get]
 Gets geographic extents of the map in decimal degrees.
GeoProjection GeoProjection [get, set]
 Gets or sets projection for map.
object GlobalCallback [get, set]
 The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
bool GrabProjectionFromData [get, set]
 Gets or sets a value indicating whether projection for will be taken from the first datasource added to it.
virtual Identifier Identifier [get]
 Gets an Identifier object which holds settings of cmIdentify tools.
tkCustomState InertiaOnPanning [get, set]
 Gets or sets a value indicating whether animation will be displayed to simulate inertia after panning operation.
MapWinGIS.tkLockMode IsLocked [get, set]
 Checks to see if the map is currently locked or not.
string Key [get, set]
 The key may be used by the programmer to store any string data associated with the object.
tkKnownExtents KnownExtents [get, set]
 Gets or sets known extents for the map.
int LastErrorCode [get, set]
 Retrieves the last error generated in the object.
float Latitude [get, set]
 Gets or sets latitude of the center of screen (in decimal degrees).
float Longitude [get, set]
 Gets or sets longitude of the center of screen (in decimal degrees).
MapWinGIS.tkCursor MapCursor [get, set]
 Gets or sets the cursor used with the map. When using crsrUserDefined be sure to set a UDCursorHandle.
MapWinGIS.tkResizeBehavior MapResizeBehavior [get, set]
 Gets or sets the value which indicates how the control adjust its content after the resizing operations.
MapWinGIS.tkUnitsOfMeasure MapUnits [get, set]
 Gets or sets the units of measure for the map.
MapWinGIS.Extents MaxExtents [get, set]
 Gets or sets the extents of the map displayed by the control.
Measuring Measuring [get]
 Gets measuring object associated with map.
double MouseWheelSpeed [get, set]
 Gets or sets the speed of zooming with mouse wheel.
int NumLayers [get]
 Gets the number of layers loaded in the map.
double PixelsPerDegree [get, set]
 Gets the number of screen pixels per the decimal degree of the data.
tkMapProjection Projection [get, set]
 Sets projection of the map. It providers 2 most commonly used coordinate system/projections to be easily set from Form Designer. To set other projections initialize GeoProjection object manually and use AxMap.GeoProjection property.
bool ReuseTileBuffer [get, set]
 Gets or sets a value indicating whether currently rendered tile buffer should be scaled and reused during the next redraw.
tkScalebarUnits ScalebarUnits [get, set]
 Gets or sets units to be displayed for map scalebar.
bool ScalebarVisible [get, set]
 Gets or sets a value which indicate whether scalebar will be displayed on the map.
bool SendMouseDown [get, set]
 Gets or sets whether the map sends mouse down events.
bool SendMouseMove [get, set]
 Gets or sets whether the map sends mouse move events.
bool SendMouseUp [get, set]
 Gets or sets whether the map sends mouse up events.
bool SendOnDrawBackBuffer [get, set]
 Gets or sets a boolean value which indicates whether the map sends on draw back buffer events.
bool SendSelectBoxDrag [get, set]
 Gets or sets whether the map sends the SelectBoxDrag event.
bool SendSelectBoxFinal [get, set]
 Gets or sets whether the map sends the SelectBoxFinal event.
virtual ShapeEditor ShapeEditor [get]
 Gets instance of shape editor class associated with map which stores data entered by interactive editing tools.
tkCoordinatesDisplay ShowCoordinates [get, set]
 Gets or sets a value indicating whether coordinates of the current mouse position will be displayed on map.
bool ShowRedrawTime [get, set]
 Gets or sets a value which indicates whether the time of map redraw will be displayed on the screen.
bool ShowVersionNumber [get, set]
 Gets or sets a boolean value which indicate whether control's version number will be displayed on the screen.
bool ShowZoomBar [get, set]
 Gets or sets a value indicating whether zoom bar will be displayed on the map.
tkTileProvider TileProvider [get, set]
 Gets or sets tile provider for the map.
MapWinGIS.Tiles Tiles [get, set]
 Gets or sets the object of Tiles class associated with map.
bool TrapRMouseDown [get, set]
 Gets or sets a boolean value which can affect the displaying of the context menus in client code by the right click.
int UDCursorHandle [get, set]
 Gets or sets the user defined cursor handle. The handle is a windows cursor handle.
virtual UndoList UndoList [get]
 Gets list actions performed by user via interactive shape editor. Provides undo/redo capability.
bool UseSeamlessPan [get, set]
 Gets or sets a boolean value which indicate whether map will be redrawn in the course of panning operation.
int VersionNumber [get, set]
 Gets or sets version number of the control.
int ZoomBarMaxZoom [get, set]
 Gets or sets maximum zoom level to be used by zoom bar.
int ZoomBarMinZoom [get, set]
 Gets or sets minimum zoom level to be used by zoom bar.
tkZoomBarVerbosity ZoomBarVerbosity [get, set]
 Gets or sets the amount of information to be displayed in zoom bar tool tip.
tkZoomBehavior ZoomBehavior [get, set]
 Gets or sets zoom behaviour for the map control.
tkZoomBoxStyle ZoomBoxStyle [get, set]
 Gets or sets a style of zoom box, which is used to select a region with Zoom In tool.
double ZoomPercent [get, set]
 Gets or sets the factor by which to zoom the view of the map in or out.

Events

_DMapEvents_AfterDrawingEventHandler AfterDrawing
 This event is fired after the rendering of drawing layers. Handle of device context is passed to allow the user to implement custom drawing.
_DMapEvents_AfterShapeEditEventHandler AfterShapeEdit
 This event is fired after interactive editing of shape is finished (AxMap.CursorMode is set to cmEditShape).
_DMapEvents_BackgroundLoadingFinishedEventHandler BackgroundLoadingFinished
 This event is fired when background loading of data for OgrLayer.Finishes.
_DMapEvents_BackgroundLoadingStartedEventHandler BackgroundLoadingStarted
 This event is fired when background loading of data for OgrLayer starts.
_DMapEvents_BeforeDeleteShapeEventHandler BeforeDeleteShape
 This event is fired before shape is deleted in interactive Shape Editor.
_DMapEvents_BeforeDrawingEventHandler BeforeDrawing
 This event is fired before the rendering of drawing layers. Handle of device context is passed to allow the user to implement custom drawing.
_DMapEvents_BeforeShapeEditEventHandler BeforeShapeEdit
 This event is fired before editing starts for particular shape (after user click on the shape when map cursor is set to cmEditShape).
_DMapEvents_ChooseLayerEventHandler ChooseLayer
 The event is fired when current map tool asks for the layer to work with.
EventHandler DblClick
 The event is fired when user performs double click with left mouse button while cursor is within the map control.
EventHandler ExtentsChanged
 This event is fired when the extents of the map change.
_DMapEvents_FileDroppedEventHandler FileDropped
 This event is fired when a user drags a file and drops it on the map.
_DMapEvents_GridOpenedEventHandler GridOpened
 This event is fired after grid datasource was added to the map.
_DMapEvents_LayerAddedEventHandler LayerAdded
 This event is fired when a new layer has been added to the map.
_DMapEvents_LayerProjectionIsEmptyEventHandler LayerProjectionIsEmpty
 This event is fired when a new layer has been added to the map and it has no metadata about its coordinate system and projection.
_DMapEvents_LayerRemovedEventHandler LayerRemoved
 This event is fired when a layer has been removed from map.
_DMapEvents_LayerReprojectedEventHandler LayerReprojected
 This event is fired after a layer was reprojected (its original projection was different from the map projection).
_DMapEvents_MapStateEventHandler MapStateEvent
 This event is fired for each layer in the map when the map state is changed.
_DMapEvents_MeasuringChangedEventHandler MeasuringChanged
 This event is fired after the user adds or removes a point from the path of measuring tool.
_DMapEvents_MouseDownEventHandler MouseDownEvent
 This event is fired when a user has pressed a mouse button while the cursor is inside the map control. The map property SendMouseDown must be set to True for this event to be fired.
_DMapEvents_MouseMoveEventHandler MouseMoveEvent
 This event is fired when the mouse is moved while the cursor is inside the map control. The map property SendMoveMouse must be set to True for this event to be fired.
_DMapEvents_MouseUpEventHandler MouseUpEvent
 This event is fired when the mouse button is released while the cursor is in the map control. The map property SendMouseUp must be set to True for this event to be fired.
_DMapEvents_OnDrawBackBufferEventHandler OnDrawBackBuffer
 This event is fired during the rendering of map after data layers and drawing layers were rendered. The map property SendMouseUp SendOnDrawBackBuffer must be set to True for this event to be fired.
EventHandler ProjectionChanged
 The event is fired when projection of the map control was changed.
_DMapEvents_ProjectionMismatchEventHandler ProjectionMismatch
 This event is fired when a layer was added to the map with projection / coordinate system different from those of the map control.
_DMapEvents_SelectBoxDragEventHandler SelectBoxDrag
 This event is fired while the user is dragging a selection box in the map control. The map property SendSelectBoxDrag must be set to True for this event to be fired.
_DMapEvents_SelectBoxFinalEventHandler SelectBoxFinal
 This event is fired when the user finishes dragging a selection box in the map control. The map property SendSelectBoxFinal must be set to True for this event to be fired.
_DMapEvents_SelectionChangedEventHandler SelectionChanged
 This event is fired after shapes were selected with cmSelection tool.
_DMapEvents_ShapeHighlightedEventHandler ShapeHighlighted
 This event is fired when mouse cursor is being moved by user and the cursor enters or leaves neighborhood of particular shape.
_DMapEvents_ShapeIdentifiedEventHandler ShapeIdentified
 This event is fired when user click on a shape with cmIdentify tool active.
_DMapEvents_ShapeValidationFailedEventHandler ShapeValidationFailed
 This event is fired when shape being created or edited has topological errors and therefore can't be saved to the layer.
_DMapEvents_TilesLoadedEventHandler TilesLoaded
 This event is fired when complete set of tiles has been loaded for the new map extents.
EventHandler UndoListChanged
 This event is fired when an operations is added or removed from undo/redo list of interactive Shape Editor.
_DMapEvents_ValidateShapeEventHandler ValidateShape
 This event is fired before a shape which is being created or edited is about to be saved back to the layer.

Detailed Description

Map component for visualization of vector, raster or grid data.

Here is a class diagram for the AxMap class:

dot_inline_dotgraph_35.png

Graph description

Here are groups of API members for AxMap class:

dot_mapgroups.png
Graph description

Examples:
AddCategoryRange.cs, AddLayers.cs, CalculateArea.cs, CreateBuffer.cs, CreatePointShapefile.cs, CreatePolygonShapefile.cs, EditAttributes.cs, GenerateLabelsManually.cs, GeoProjection.cs, ImageLabels.cs, IntersectionLength.cs, LabelSelection.cs, LinePattern.cs, MarkPoints.cs, MinimalDistance.cs, PointIcons.cs, PolygonsWithHoles.cs, RemoveShape.cs, Segmentation.cs, SelectBox.cs, SelectByDistance.cs, SelectByQuery.cs, ShapefileToDrawingLayer.cs, ShowAttributes.cs, SortLayers.cs, SplitByAttribute.cs, ToolTip.cs, TrackCars.cs, Tracking.cs, and ZoomToValues.cs.

Member Function Documentation

void AxMap.DrawBackBuffer ( IntPtr  hdc,
int  ImageWidth,
int  ImageHeight 
)

Draws the content of the back buffer to specified device context.

If the size of the back buffer differ from the provided dimensions, the scaling of the buffer content will be made.

Parameters:
hdcThe handle of the device context.
ImageWidthThe width of the resulting image.
ImageHeightThe height of the resulting image.
bool AxMap.FindSnapPoint ( double  tolerance,
double  xScreen,
double  yScreen,
ref double  xFound,
ref double  yFound 
)

Returns coordinate of the shapefile point closest to specified point on screen.

Parameters:
toleranceTolerance in screen pixels. If no vertex is found within the tolerance, operation fails.
xScreenX coordinate on screen.
yScreenY coordinate on screen.
xFoundX coordinate of the vertex (map coordinates).
yFoundY coordinate of the vertex (map coordinates).
Returns:
True on success.
New API 4.9.1:
Added in version 4.9.1
string AxMap.get_ErrorMsg ( int  ErrorCode)

Retrieves the error message associated with the specified error code.

Parameters:
ErrorCodeThe error code for which the error message is required.
Returns:
The error message description for the specified error code.
int AxMap.HWnd ( )

Returns the handle of the window of map control.

Returns:
The handle of window.
void AxMap.LoadTilesForSnapshot ( Extents  extents,
int  width,
string  key,
tkTileProvider  provider 
)

Loads tiles for the specified map extents.

Parameters:
extentsExtents to load tiles for (in map coordinates).
widthThe width of the canvas on which the extents will be rendered.
keyArbitrary key, to distinguish this request from others in AxMap.TilesLoaded event.
providerProvider to load tiles from.

If tiles aren't already loaded in cache, the operation will be performed asynchronously. Use AxMap.TilesLoaded event to be notified of it's completion. The main purpose: loading of tiles for printing.

New API 4.9.1:
Added in version 4.9.1
void AxMap.Redraw ( )
void AxMap.Redraw2 ( tkRedrawType  redrawType)

Performs specific type of map redraw.

Parameters:
redrawTypeType of redraw.

Different types of redraw are necessary for performance reasons. If it's known that only a specific part of map content has changed there is no need to run the full rendering, screen buffer can be used instead. According to the amount of content being redrawn the different types can be ordered like this (from minimum to the full one): RedrawMinimal -> RedrawSkipAllLayers -> RedrawSkipDataLayers -> RedrawAll. Each subsequent type includes preceding types, so it's never necessary to call two types in a row. If it's not clear which type of redraw is appropriate for particular situation, start with the minimal one and then go to the subsequent types until the changes which were made are rendered. Also if datasource being used are small it's easier to ignore this method altogether and call AxMap.Redraw instead ( equivalent to AxMap.Redraw2(tkRedrawType.RedrawAll)).

New API 4.9.1:
Added in version 4.9.1
Examples:
ToolTip.cs, and TrackCars.cs.
void AxMap.Resize ( int  Width,
int  Height 
)

Resizes the map to the given width and height.

Parameters:
WidthThe new width of the control.
HeightThe new hight of the control.
void AxMap.ShowToolTip ( string  Text,
int  Milliseconds 
)

Shows tooltip near the mouse cursor.

Parameters:
TextText of the tooltip.
MillisecondsThe duration of tooltip display.
object AxMap.SnapShot ( object  BoundBox)

Takes snap shot of the contents of the map within the bounds of the specified rectangle, returning an image of the results.

Parameters:
BoundBoxThe bounds (rectangle) in map units to get the snapshot from.
Returns:
An image of the contents of the map displayed inside the bounds of the specified rectangle.
object AxMap.SnapShot2 ( int  ClippingLayerNbr,
double  Zoom,
int  pWidth 
)

Takes snap shot of the contents of the map and returns it as an image object.

Parameters:
ClippingLayerNbrThe position of the layer which extents will be used for taking snapshot.
ZoomThe amount of zoom.
pWidthThe width of the resulting image.
Returns:
An image of the contents of the map.
object AxMap.SnapShot3 ( double  left,
double  right,
double  top,
double  bottom,
int  Width 
)

Takes snap shot of the contents of the map in the specified bounding box and returns it as an image object.

Parameters:
leftThe x coordinate of the lower left corner of the extents.
rightThe x coordinate of the top right corner of the extents.
topThe y coordinate of the top right corner of the extents.
bottomThe y coordinate of the lower left corner of the extents.
WidthThe width of the resulting image in pixels.
Returns:
An image of the contents of the map.
bool AxMap.SnapShotToDC ( IntPtr  hdc,
MapWinGIS.Extents  Extents,
int  Width 
)

Performs drawing of the map contents to the specified device context.

Parameters:
hdcThe handle of the device context.
ExtentsThe map extents to be drawn.
WidthThe width of the resulting image inShowVersionNumber pixels.
Returns:
True on success and false otherwise.
int AxMap.TilesAreInCache ( Extents  extents,
int  width,
tkTileProvider  provider 
)

Checks whether tiles for specified extents and provider are already present in cache.

Parameters:
extentsExtents to check for (map coordinates).
widthWidth of the canvas on which the extents will be displayed.
providerProvider to load tiles from.
Returns:
1 if tiles are in cache, 0 if not, -1 if an there was an error.

The main purpose: loading of tiles for printing.

New API 4.9.1:
Added in version 4.9.1

Property Documentation

uint AxMap.BackColor [get, set]

Gets or sets the background color of the map.

When using VB.NET the color is represented as a System.Drawing.Color. When using VB 6 the color can be an OLE_COLOR or an integer representation of an RGB value.

MapWinGIS.FileManager AxMap.FileManager [get]

Gets FileManager object associated with map. The object is used by AxMap.AddLayerFromFilename methods.

New API 4.9.1:
Added in version 4.9.1
object AxMap.GlobalCallback [get, set]

The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.

.NET clients passing ICallback implementation to this property must make respective class COM visible by setting ComVisible(true) attribute. In fact ComVisible(true) is set by default for public classes, so it's enough to make sure that it isn't explicitly set to false for the class or assembly where the class is defined. Otherwise InvalidCastException may occur at runtime.

Deprecated:
v4.9.3 Use GlobalSettings.ApplicationCallback instead.

Gets an Identifier object which holds settings of cmIdentify tools.

New API 4.9.3:
Added in version 4.9.3
string AxMap.Key [get, set]

The key may be used by the programmer to store any string data associated with the object.

int AxMap.LastErrorCode [get, set]

Retrieves the last error generated in the object.

Gets or sets the cursor used with the map. When using crsrUserDefined be sure to set a UDCursorHandle.

Gets or sets the value which indicates how the control adjust its content after the resizing operations.

Gets instance of shape editor class associated with map which stores data entered by interactive editing tools.

New API 4.9.3:
Added in version 4.9.3
bool AxMap.ShowRedrawTime [get, set]

Gets or sets a value which indicates whether the time of map redraw will be displayed on the screen.

Only times of full redraws when data layers are drawn anew are displayed.

New API 4.8:
Added in version 4.8
Examples:
ToolTip.cs.
bool AxMap.ShowVersionNumber [get, set]

Gets or sets a boolean value which indicate whether control's version number will be displayed on the screen.

New API 4.8:
Added in version 4.8
tkTileProvider AxMap.TileProvider [get, set]

Gets or sets tile provider for the map.

This property is a shortcut for AxMap.Tiles.Provider property. Setting it to ProviderNone will change AxMap.Tiles.Visible property to false.

New API 4.9.1:
Added in version 4.9.1
MapWinGIS.Tiles AxMap.Tiles [get, set]

Gets or sets the object of Tiles class associated with map.

New API 4.9.0:
Added in version 4.9.0
int AxMap.UDCursorHandle [get, set]

Gets or sets the user defined cursor handle. The handle is a windows cursor handle.

virtual UndoList AxMap.UndoList [get]

Gets list actions performed by user via interactive shape editor. Provides undo/redo capability.

New API 4.9.3:
Added in version 4.9.3
int AxMap.VersionNumber [get, set]

Gets or sets version number of the control.

The set part of the property isn't supported.

 All Classes Files Functions Enumerations Properties Events