AxMap Class Reference

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

Inheritance diagram for AxMap:
Inheritance graph
Collaboration diagram for AxMap:
Collaboration graph

Public Member Functions

int AddLayer (object Object, bool visible)
 Adds a layer to the map. More...
 
int AddLayerFromDatabase (string connectionString, string layerNameOrQuery, bool visible)
 Adds a layer from spatial database accessed via GDAL/OGR drivers. More...
 
int AddLayerFromFilename (string filename, tkFileOpenStrategy openStrategy, bool visible)
 Adds layer from the specified datasource. More...
 
void Clear ()
 Removes all data from the map and sets its properties to the default state. More...
 
void ClearDrawing (int drawHandle)
 Clears all drawings on the specified drawing layer, and removes the drawing layer. The drawing handle will no longer be valid. Call AxMap.NewDrawing again to create a new drawing layer to continue adding new elements. More...
 
void ClearDrawingLabels (int drawHandle)
 Clears labels on the specified drawing layer. More...
 
void ClearDrawings ()
 Clears all drawings on all drawing layers, and removes all drawing layers. This method is slower than using ClearDrawing on a specific layer. Call AxMap.NewDrawing again to create a new drawing layer to continue adding new elements. More...
 
void ClearExtentHistory ()
 Clears the extent history. More...
 
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). More...
 
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). More...
 
bool DeserializeLayer (int layerHandle, string newVal)
 Restores the state of the layer from the string generated by AxMap.SerializeLayer(). More...
 
bool DeserializeMapState (string state, bool loadLayers, string basePath)
 Restores map state from the string generated by AxMap.SerializeMapState. More...
 
void DrawBackBuffer (int hdc, int imageWidth, int imageHeight)
 Draws the content of the back buffer to specified device context. More...
 
void DrawCircle (double x, double y, double pixelRadius, uint color, bool fill, byte alpha=255)
 Draws a circle on the last drawing layer created by AxMap.NewDrawing More...
 
void DrawCircleEx (int layerHandle, double x, double y, double pixelRadius, uint color, bool fill, byte alpha=255)
 Draws a circle on the specified drawing layer. More...
 
int DrawLabel (string text, double x, double y, double rotation)
 Draws a label on the current drawing layer. More...
 
int DrawLabelEx (int drawHandle, string text, double x, double y, double rotation)
 Draws a label on the specified drawing layer. More...
 
void DrawLine (double x1, double y1, double x2, double y2, int pixelWidth, uint color, byte alpha=255)
 Draws a line on the last drawing layer created using AxMap.NewDrawing. More...
 
void DrawLineEx (int layerHandle, double x1, double y1, double x2, double y2, int pixelWidth, uint color, byte alpha=255)
 Draws a line on the specified drawing layer. More...
 
void DrawPoint (double x, double y, int pixelSize, uint color, byte alpha=255)
 Draws a point on the last drawing layer created by AxMap.NewDrawing. More...
 
void DrawPointEx (int layerHandle, double x, double y, int pixelSize, uint color, byte alpha=255)
 Draws a point on the specified drawing layer. More...
 
void DrawPolygon (ref object xPoints, ref object yPoints, int numPoints, uint color, bool fill, byte alpha=255)
 Draws a polygon on the last drawing layer created using AxMap.NewDrawing. More...
 
void DrawPolygonEx (int layerHandle, ref object xPoints, ref object yPoints, int numPoints, uint color, bool fill, byte alpha=255)
 Draws a polygon on the specified drawing layer. More...
 
void DrawWideCircle (double x, double y, double pixelRadius, uint color, bool fill, short width, byte alpha=255)
 Draws a circle with custom outline width on the last drawing layer created by AxMap.NewDrawing. More...
 
void DrawWideCircleEx (int layerHandle, double x, double y, double radius, uint color, bool fill, short outlineWidth, byte alpha=255)
 Draws a circle with custom outline width on the specified drawing layer. More...
 
void DrawWidePolygon (ref object xPoints, ref object yPoints, int numPoints, uint color, bool fill, short width, byte alpha=255)
 Draws a polygon with custom width of outline on the last drawing layer created using AxMap.NewDrawing. More...
 
void DrawWidePolygonEx (int layerHandle, ref object xPoints, ref object yPoints, int numPoints, uint color, bool fill, short outlineWidth, byte alpha=255)
 Draws a polygon with custom width of outline on the last drawing layer created using AxMap.NewDrawing. More...
 
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. More...
 
double GeodesicArea (Shape polygon)
 Calculates area of polygon taking into account the shape of Earth. More...
 
double GeodesicDistance (double projX1, double projY1, double projX2, double projY2)
 Calculates geodesic distance between 2 points defined in map coordinate system. More...
 
double GeodesicLength (Shape polyline)
 Calculates length of polyline or perimeter of polygon taking into account the shape of Earth. More...
 
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. More...
 
Labels get_DrawingLabels (int drawingLayerIndex)
 Gets labels associated with the drawing layer. More...
 
bool get_DrawingLabelsVisible (int drawHandle)
 Gets a boolean value which indicates whether labels of the drawing layer are visible. More...
 
string get_ErrorMsg (int errorCode)
 Retrieves the error message associated with the specified error code. More...
 
object get_GetObject (int layerHandle)
 Returns the layer object with the given handle. The object could be a Shapefile, Grid, or Image object. More...
 
Image get_Image (int layerHandle)
 Gets image object associated with the layer. More...
 
string get_LayerDescription (int layerHandle)
 Gets the description of the layer from the associated .mwsymb file. More...
 
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. More...
 
Extents get_layerExtents (int layerHandle)
 Gets the layer extents More...
 
string get_LayerFilename (int layerHandle)
 Gets filename of datasource for the specified layer. More...
 
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 More...
 
string get_LayerKey (int layerHandle)
 Gets a string associated with a layer in the map. More...
 
Labels get_LayerLabels (int layerHandle)
 Returns labels associated with layer. More...
 
double get_LayerMaxVisibleScale (int layerHandle)
 Gets the maximum scale at which the layer is visible on the map. More...
 
int get_LayerMaxVisibleZoom (int layerHandle)
 Gets maximum zoom at which the layer will be displayed. More...
 
double get_LayerMinVisibleScale (int layerHandle)
 Gets the minimum scale at which the layer is visible on the map. More...
 
int get_LayerMinVisibleZoom (int layerHandle)
 Gets minimum zoom at which the layer will be displayed. More...
 
string get_LayerName (int layerHandle)
 Gets the name of the specified layer. More...
 
int get_LayerPosition (int layerHandle)
 Gets the position of the specified layer in the map. More...
 
bool get_LayerSkipOnSaving (int layerHandle)
 Gets a boolean value which indicates whether the layer will be serialized by appropriate routines. More...
 
bool get_LayerVisible (int layerHandle)
 Gets the visibility of the specified layer. More...
 
bool get_LayerVisibleAtCurrentScale (int layerHandle)
 Gets a value which indicates whether a layer is visible at current map scale. More...
 
OgrLayer get_OgrLayer (int layerHandle)
 Gets instance of OGR layer object associated with the specified layer. More...
 
Shapefile get_Shapefile (int layerHandle)
 Gets shapefile object associated with the layer. More...
 
bool get_ShapeLayerDrawFill (int layerHandle)
 Gets whether the specified layer is drawn with a fill. Only works on polygon shapefiles. More...
 
bool get_ShapeLayerDrawLine (int layerHandle)
 Gets whether the lines for the shapefile in specified layer are drawn. More...
 
bool get_ShapeLayerDrawPoint (int layerHandle)
 Gets whether the points/vertices for the shapefile in specified layer are drawn. More...
 
uint get_ShapeLayerFillColor (int layerHandle)
 Gets the fill color for the specified layer. Only works on polygon shapefiles. More...
 
tkFillStipple get_ShapeLayerFillStipple (int layerHandle)
 Gets the fill stipple for the specified layer. Only works on polygon shapefiles. More...
 
float get_ShapeLayerFillTransparency (int layerHandle)
 Gets the percentage of fill transparency for the specified layer. Only works on polygon shapefiles. More...
 
uint get_ShapeLayerLineColor (int layerHandle)
 Gets the line color for the specified layer. Only works on shapefiles. More...
 
tkLineStipple get_ShapeLayerLineStipple (int layerHandle)
 Gets the line stipple for the specified layer. Only works on shapefiles. More...
 
float get_ShapeLayerLineWidth (int layerHandle)
 Gets the line width for the specified layer. Only works on shapefiles. Suggested values for line width: 1 - 5 More...
 
uint get_ShapeLayerPointColor (int layerHandle)
 Gets the point color for the specified layer. Only works on shapefiles More...
 
float get_ShapeLayerPointSize (int layerHandle)
 Gets the line point/vertex size for the specified layer. Only works on shapefiles. More...
 
tkPointType get_ShapeLayerPointType (int layerHandle)
 Gets the line point type for the specified layer. Only works on shapefiles. More...
 
uint get_ShapeLayerStippleColor (int layerHandle)
 Gets the color of the polygon stipple for shapefile layer. More...
 
bool get_ShapeLayerStippleTransparent (int layerHandle)
 Gets a boolean value which indicates whether the background of fill stipple for polygon shapefile layer will be transparent. More...
 
WmsLayer get_WmsLayer (int layerHandle)
 Gets the WmsLayer More...
 
object GetColorScheme (int layerHandle)
 Returns a color scheme for the specified layer. More...
 
Extents GetKnownExtents (tkKnownExtents extents)
 Gets known extents. More...
 
int HWnd ()
 Returns the handle of the window of map control. More...
 
bool LoadLayerOptions (int layerHandle, string optionsName, ref string description)
 Applies to the layer a set of settings from file with the specified name. More...
 
bool LoadMapState (string filename, object callback)
 Loads the state of the map from the file created by AxMap.SaveMapState method. More...
 
bool LoadTilesForSnapshot (Extents extents, int width, string key)
 Loads tiles for the specified map extents. More...
 
void LockWindow (tkLockMode lockMode)
 Locks the window so that any changes will not be displayed until it is unlocked. More...
 
bool MoveLayer (int initialPosition, int targetPosition)
 Moves a layer in the map from the initial position to a target position. More...
 
bool MoveLayerBottom (int initialPosition)
 Moves the specified layer below all other layers. More...
 
bool MoveLayerDown (int initialPosition)
 Moves the specified layer down one layer in the map. More...
 
bool MoveLayerTop (int initialPosition)
 Moves the specified layer to the top of all other layers. More...
 
bool MoveLayerUp (int initialPosition)
 Moves the specified layer up one layer in the map. More...
 
int NewDrawing (tkDrawReferenceList projection)
 Creates a new drawing layer on the map returning its handle. More...
 
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). More...
 
void PixelToProj (double pixelX, double pixelY, ref double projX, ref double projY)
 Converts pixel coordinates to projected map coordinates More...
 
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). More...
 
void ProjToPixel (double projX, double projY, ref double pixelX, ref double pixelY)
 Converts projected map coordinates into screen pixel units More...
 
void Redraw ()
 Redraws all layers in the map if the map is not locked. More...
 
void Redraw2 (tkRedrawType redrawType)
 Performs specific type of map redraw. More...
 
void Redraw3 (tkRedrawType redrawType, bool reloadTiles)
 Adveanced version of AxMap.Redraw2 More...
 
bool ReloadOgrLayerFromSource (int ogrLayerHandle)
 Performs the same operation as OgrLayer.ReloadFromSource, then compares projections with the Map, and if the settings allow, will reproject on-the-fly. More...
 
void RemoveAllLayers ()
 Removes all layers from the map. More...
 
void RemoveLayer (int layerHandle)
 Removes the specified layer from the map More...
 
bool RemoveLayerOptions (int layerHandle, string optionsName)
 Removes set of options for the layer with the specified name. More...
 
void RemoveLayerWithoutClosing (int layerHandle)
 Removes layer from the map without its closing. More...
 
void Resize (int width, int height)
 Resizes the map to the given width and height. More...
 
void ReSourceLayer (int layerHandle, string newSrcPath)
 Changes the data source for the specified layer without its closing. More...
 
void RestartBackgroundLoading (int ogrLayerHandle)
 Restarts the background loading thread of dynamically loaded layers More...
 
bool SaveLayerOptions (int layerHandle, string optionsName, bool overwrite, string description)
 Saves settings of the layer to the file. More...
 
bool SaveMapState (string filename, bool relativePaths, bool overwrite)
 Saves the state of the map to the specified file. More...
 
string SerializeLayer (int layerHandle)
 Serializes the layer settings to the string. More...
 
string SerializeMapState (bool relativePaths, string basePath)
 Serializes map state to the string. More...
 
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. More...
 
void set_DrawingLabels (int drawingLayerIndex, Labels newValue)
 Replaces the labels associated with the drawing layer. More...
 
void set_DrawingLabelsVisible (int drawHandle, bool newValue)
 Sets a boolean value which indicates whether labels of the drawing layer are visible. More...
 
void set_Image (int layerHandle, Image newValue)
 Replaces the image object associated with the layer. More...
 
void set_LayerDescription (int layerHandle, string newValue)
 Sets the description of the layer. More...
 
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. More...
 
void set_LayerKey (int layerHandle, string newValue)
 Sets a string associated with a layer in the map. More...
 
void set_LayerLabels (int layerHandle, Labels newValue)
 Sets the labels associated with the layer. More...
 
void set_LayerMaxVisibleScale (int layerHandle, double newValue)
 Sets the maximum scale at which the layer is visible on the map. More...
 
void set_LayerMaxVisibleZoom (int layerHandle, int param0)
 Sets maximum zoom at which the layer will be displayed. More...
 
void set_LayerMinVisibleScale (int layerHandle, double newValue)
 Sets the minimum scale at which the layer is visible on the map. More...
 
void set_LayerMinVisibleZoom (int layerHandle, int param0)
 Sets minimum zoom at which the layer will be displayed. More...
 
void set_LayerName (int layerHandle, string newValue)
 Sets the name of the specified layer. More...
 
void set_LayerSkipOnSaving (int layerHandle, bool newValue)
 Sets a boolean value which indicates whether the layer will be serialized by appropriate routines. More...
 
void set_LayerVisible (int layerHandle, bool newValue)
 Sets the visibility of the specified layer. More...
 
void set_Shapefile (int layerHandle, Shapefile newValue)
 Replaces the shapefile object associated with the layer. More...
 
void set_ShapeLayerDrawFill (int layerHandle, bool newValue)
 Sets whether the specified layer is drawn with a fill. Only works on polygon shapefiles. More...
 
void set_ShapeLayerDrawLine (int layerHandle, bool newValue)
 Sets whether the lines for the shapefile in specified layer are drawn. More...
 
void set_ShapeLayerDrawPoint (int layerHandle, bool newValue)
 Sets whether the points/vertices for the shapefile in specified layer are drawn. More...
 
void set_ShapeLayerFillColor (int layerHandle, uint newValue)
 Sets the fill color for the specified layer. Only works on polygon shapefiles More...
 
void set_ShapeLayerFillStipple (int layerHandle, tkFillStipple newValue)
 Sets the fill stipple for the specified layer. Only works on polygon shapefiles. More...
 
void set_ShapeLayerFillTransparency (int layerHandle, float newValue)
 Sets the percentage of fill transparency for the specified layer. Only works on polygon shapefiles. More...
 
void set_ShapeLayerLineColor (int layerHandle, uint newValue)
 Sets the line color for the specified layer. Only works on shapefiles. More...
 
void set_ShapeLayerLineStipple (int layerHandle, tkLineStipple newValue)
 Sets the line stipple for the specified layer. Only works on shapefiles. More...
 
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 More...
 
void set_ShapeLayerPointColor (int layerHandle, uint newValue)
 Sets the point color for the specified layer. Only works on shapefiles. More...
 
void set_ShapeLayerPointSize (int layerHandle, float newValue)
 Sets the line point/vertex size for the specified layer. Only works on shapefiles. More...
 
void set_ShapeLayerPointType (int layerHandle, tkPointType newValue)
 Sets the line point type for the specified layer. Only works on shapefiles. More...
 
void set_ShapeLayerStippleColor (int layerHandle, uint newValue)
 Sets the color of the polygon stipple for shapefile layer. More...
 
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. More...
 
void SetDrawingLayerVisible (int layerHandle, bool visible)
 Sets the boolean value which indicates whether the labels of the drawing layer are visible. More...
 
virtual bool SetGeographicExtents (Extents pVal)
 Sets geographic extents in decimal degrees for the map. More...
 
bool SetGeographicExtents2 (double xLongitude, double yLatitude, double widthKilometers)
 Sets geographic extents for the map. More...
 
bool SetImageLayerColorScheme (int layerHandle, object colorScheme)
 Sets the color scheme of an image layer More...
 
void SetLatitudeLongitude (double latitude, double longitude)
 Sets the Latitude and Longitude of the center of the screen in one operation More...
 
void ShowToolTip (string text, int milliseconds)
 Shows tooltip near the mouse cursor. More...
 
bool StartNewBoundShape (double x, double y)
 Allow to initiate digitizing a new shape with a starting point More...
 
bool StartNewBoundShapeEx (int layerHandle)
 Allow to initiate digitizing a new shape with a starting point More...
 
virtual void Undo ()
 Reverts the last operation performed by user in interactive ShapeEditor. More...
 
void ZoomIn (double percent)
 Zooms the display in by the given factor. More...
 
void ZoomOut (double percent)
 Zooms the display out by the specified factor. More...
 
void ZoomToLayer (int layerHandle)
 Zooms the map display to the specified layer. More...
 
void ZoomToMaxExtents ()
 Zooms the map to the maximum extents of all loaded layers.
More...
 
void ZoomToMaxVisibleExtents ()
 Zooms the map to the maximum extents of all loaded visible layers. More...
 
int ZoomToNext ()
 Zooms the map view to the next extents if there are next extents in the extents history. More...
 
int ZoomToPrev ()
 Zooms the map view to the previous extents if there are previous extents in the extents history. More...
 
bool ZoomToSelected (int layerHandle)
 Zoomes map to display selected shapes of the specified shapefile. More...
 
void ZoomToShape (int layerHandle, int shape)
 Zooms the map display to the specified shape in the shapefile contained by the specified layer. More...
 
bool ZoomToTileLevel (int zoom)
 Zooms map to specified zoom level of the active tile provider (Tiles.Provider). More...
 
bool ZoomToWorld ()
 Zooms to World extents (-180.0; 180.0; -90.0; 90.0) More...
 

Properties

tkCustomState AnimationOnZooming [get, set]
 Gets or sets a value indicating whether animation will be displayed zooming map in or out. More...
 
uint BackColor [get, set]
 Gets or sets the background color of the map. More...
 
uint backColor [get, set]
 
double CurrentScale [get, set]
 Gets or sets the current map scale. More...
 
int CurrentZoom [get, set]
 Gets or sets the current zoom level for the map. It corresponds to the zoom level of current tile provider. More...
 
tkCursorMode CursorMode [get, set]
 Gets or sets the cursor mode for the map. More...
 
tkCustomDrawingFlags CustomDrawingFlags [get, set]
 Set custom drawing flags More...
 
bool DisableWaitCursor [get, set]
 Gets or sets a boolean value which indicates whether a wait cursor will be displayed on map redraw. More...
 
int ExtentHistory [get, set]
 Gets or sets the number of extents to cache in the extents history More...
 
int ExtentHistoryRedoCount [get]
 Gets the number of previous extents to go to, forward in the undo list More...
 
int ExtentHistoryUndoCount [get]
 Gets the number of previous extents to go to, back in the undo list More...
 
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. More...
 
Extents Extents [get, set]
 Gets or sets the extents of the map using an Extents object. More...
 
FileManager FileManager [get]
 Gets FileManager object associated with map. The object is used by AxMap.AddLayerFromFilename methods. More...
 
DrawingRectangle FocusRectangle [get]
 For selection boxes or dragging operations, updated with tkRedrawType.Minimal More...
 
Extents GeographicExtents [get]
 Gets geographic extents of the map in decimal degrees. More...
 
GeoProjection GeoProjection [get, set]
 Gets or sets projection for map. More...
 
object GlobalCallback [get, set]
 The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications. More...
 
bool GrabProjectionFromData [get, set]
 Gets or sets a value indicating whether projection for will be taken from the first datasource added to it. More...
 
SelectionList IdentifiedShapes [get]
 Get the identified shapes More...
 
virtual Identifier Identifier [get]
 Gets an Identifier object which holds settings of tkCursorMode.cmIdentify tools. More...
 
tkCustomState InertiaOnPanning [get, set]
 Gets or sets a value indicating whether animation will be displayed to simulate inertia after panning operation. More...
 
tkLockMode IsLocked [get, set]
 Checks to see if the map is currently locked or not. More...
 
string Key [get, set]
 The key may be used by the programmer to store any string data associated with the object. More...
 
tkKnownExtents KnownExtents [get, set]
 Gets or sets known extents for the map. More...
 
int LastErrorCode [get, set]
 Retrieves the last error generated in the object. More...
 
float Latitude [get, set]
 Gets or sets latitude of the center of screen (in decimal degrees). More...
 
float Longitude [get, set]
 Gets or sets longitude of the center of screen (in decimal degrees). More...
 
tkCursor MapCursor [get, set]
 Gets or sets the cursor used with the map. When using tkCursor.crsrUserDefined be sure to set a AxMap.UDCursorHandle. More...
 
tkResizeBehavior MapResizeBehavior [get, set]
 Gets or sets the value which indicates how the control adjust its content after the resizing operations. More...
 
tkUnitsOfMeasure MapUnits [get, set]
 Gets or sets the units of measure for the map. More...
 
Extents MaxExtents [get, set]
 Gets or sets the extents of the map displayed by the control. More...
 
Measuring Measuring [get]
 Gets measuring object associated with map. More...
 
double MouseWheelSpeed [get, set]
 Gets or sets the speed of zooming with mouse wheel. More...
 
int NumLayers [get]
 Gets the number of layers loaded in the map. More...
 
double PixelsPerDegree [get, set]
 Gets the number of screen pixels per the decimal degree of the data. More...
 
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. More...
 
bool RecenterMapOnZoom [get, set]
 Gets or sets a value indicating whether to move the mouse click point to the center of the map when using the Zoom In or Zoom Out tools. More...
 
bool ReuseTileBuffer [get, set]
 Gets or sets a value indicating whether currently rendered tile buffer should be scaled and reused during the next redraw. More...
 
tkScalebarUnits ScalebarUnits [get, set]
 Gets or sets units to be displayed for map scalebar. More...
 
bool ScalebarVisible [get, set]
 Gets or sets a value which indicate whether scalebar will be displayed on the map. More...
 
bool SendMouseDown [get, set]
 Gets or sets whether the map sends mouse down events. More...
 
bool SendMouseMove [get, set]
 Gets or sets whether the map sends mouse move events. More...
 
bool SendMouseUp [get, set]
 Gets or sets whether the map sends mouse up events. More...
 
bool SendOnDrawBackBuffer [get, set]
 Gets or sets a boolean value which indicates whether the map sends on draw back buffer events. More...
 
bool SendSelectBoxDrag [get, set]
 Gets or sets whether the map sends the SelectBoxDrag event. More...
 
bool SendSelectBoxFinal [get, set]
 Gets or sets whether the map sends the SelectBoxFinal event. More...
 
virtual ShapeEditor ShapeEditor [get]
 Gets instance of ShapeEditor class associated with map which stores data entered by interactive editing tools. More...
 
tkCoordinatesDisplay ShowCoordinates [get, set]
 Gets or sets a value indicating whether coordinates of the current mouse position will be displayed on map. More...
 
bool ShowCoordinatesBackground [get, set]
 Gets or sets a value indicating whether to display a white background behind the coordinates, for better contrast More...
 
tkAngleFormat ShowCoordinatesFormat [get, set]
 Allows to format coordinates in top right corner in degrees/minutes/seconds format; by default the former minutes format is used More...
 
bool ShowRedrawTime [get, set]
 Gets or sets a value which indicates whether the time of map redraw will be displayed on the screen. More...
 
bool ShowVersionNumber [get, set]
 Gets or sets a boolean value which indicate whether control's version number will be displayed on the screen. More...
 
bool ShowZoomBar [get, set]
 Gets or sets a value indicating whether zoom bar will be displayed on the map. More...
 
tkTileProvider TileProvider [get, set]
 Gets or sets tile provider for the map. More...
 
Tiles Tiles [get, set]
 Gets or sets the object of Tiles class associated with map. More...
 
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. More...
 
int UDCursorHandle [get, set]
 Gets or sets the user defined cursor handle. The handle is a windows cursor handle. More...
 
virtual UndoList UndoList [get]
 Gets list actions performed by user via interactive ShapeEditor. Provides undo/redo capability. More...
 
bool UseAlternatePanCursor [get, set]
 Gets or sets a value indicating whether the legacy 'hand' cursor should be used for map panning rather than the standard 'NSEW' four-point cursor. More...
 
bool UseSeamlessPan [get, set]
 Gets or sets a boolean value which indicate whether map will be redrawn in the course of panning operation. More...
 
string VersionNumber [get, set]
 Gets or sets version number of the control. More...
 
int ZoomBarMaxZoom [get, set]
 Gets or sets maximum zoom level to be used by zoom bar. More...
 
int ZoomBarMinZoom [get, set]
 Gets or sets minimum zoom level to be used by zoom bar. More...
 
tkZoomBarVerbosity ZoomBarVerbosity [get, set]
 Gets or sets the amount of information to be displayed in zoom bar tool tip. More...
 
tkZoomBehavior ZoomBehavior [get, set]
 Gets or sets zoom behaviour for the map control. More...
 
tkZoomBoxStyle ZoomBoxStyle [get, set]
 Gets or sets a style of zoom box, which is used to select a region with Zoom In tool. More...
 
double ZoomPercent [get, set]
 Gets or sets the factor by which to zoom the view of the map in or out. More...
 

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. More...
 
_DMapEvents_AfterLayersEventHandler AfterLayers
 This event is fired after the rendering of standard layers. Handle of device context is passed to allow the user to implement custom drawing. More...
 
_DMapEvents_AfterShapeEditEventHandler AfterShapeEdit
 This event is fired after interactive editing of shape is finished (AxMap.CursorMode is set to tkCursorMode.cmEditShape). More...
 
_DMapEvents_BackgroundLoadingFinishedEventHandler BackgroundLoadingFinished
 This event is fired when background loading of data for OgrLayer finishes. More...
 
_DMapEvents_BackgroundLoadingStartedEventHandler BackgroundLoadingStarted
 This event is fired when background loading of data for OgrLayer starts. More...
 
_DMapEvents_BeforeDeleteShapeEventHandler BeforeDeleteShape
 This event is fired before shape is deleted in interactive ShapeEditor. More...
 
_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. More...
 
_DMapEvents_BeforeLayersEventHandler BeforeLayers
 This event is fired before the rendering of standard layers. Handle of device context is passed to allow the user to implement custom drawing. More...
 
_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 tkCursorMode.cmEditShape). More...
 
_DMapEvents_BeforeVertexDigitizedEventHandler BeforeVertexDigitized
 This event is fired after the user digitized a new point and held the ALT button. Can be used to modify the coordinates. More...
 
_DMapEvents_ChooseLayerEventHandler ChooseLayer
 The event is fired when current map tool asks for the layer to work with. More...
 
EventHandler DblClick
 The event is fired when user performs double click with left mouse button while cursor is within the map control. More...
 
EventHandler ExtentsChanged
 This event is fired when the extents of the map change. More...
 
_DMapEvents_FileDroppedEventHandler FileDropped
 This event is fired when a user drags a file and drops it on the map. More...
 
_DMapEvents_GridOpenedEventHandler GridOpened
 This event is fired after grid datasource was added to the map (AxMap.AddLayer). More...
 
_DMapEvents_LayerAddedEventHandler LayerAdded
 This event is fired when a new layer has been added to the map. More...
 
_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. More...
 
_DMapEvents_LayerRemovedEventHandler LayerRemoved
 This event is fired when a layer has been removed from map. More...
 
_DMapEvents_LayerReprojectedEventHandler LayerReprojected
 This event is fired after a layer was reprojected (its original projection was different from the map projection). More...
 
_DMapEvents_LayerReprojectedIncompleteEventHandler LayerReprojectedIncomplete
 This event is fired when a layer was not fully reprojected. It is controlled by the GlobalSettings.AllowLayersWithIncompleteReprojection property. More...
 
_DMapEvents_MapStateEventHandler MapState
 This event is fired for each layer in the map when the map state is changed. More...
 
_DMapEvents_MeasuringChangedEventHandler MeasuringChanged
 This event is fired after the user adds or removes a point from the path of Measuring tool. More...
 
_DMapEvents_MouseDownEventHandler MouseDown
 This event is fired when a user has pressed a mouse button while the cursor is inside the map control. The map property AxMap.SendMouseDown must be set to True for this event to be fired. More...
 
_DMapEvents_MouseMoveEventHandler MouseMove
 This event is fired when the mouse is moved while the cursor is inside the map control. The map property AxMap.SendMouseMove must be set to True for this event to be fired. More...
 
_DMapEvents_MouseUpEventHandler MouseUp
 This event is fired when the mouse button is released while the cursor is in the map control. The map property AxMap.SendMouseUp must be set to True for this event to be fired. More...
 
_DMapEvents_OnDrawBackBufferEventHandler OnDrawBackBuffer
 This event is fired during the rendering of map after data layers and drawing layers were rendered. The map property AxMap.SendOnDrawBackBuffer must be set to True for this event to be fired. More...
 
_DMapEvents_OnDrawBackBuffer2EventHandler OnDrawBackBuffer2
 Special version of _DMapEvents.OnDrawBackBuffer More...
 
EventHandler ProjectionChanged
 The event is fired when projection of the map control was changed. More...
 
_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. More...
 
_DMapEvents_SelectBoxDragEventHandler SelectBoxDrag
 This event is fired while the user is dragging a selection box in the map control. The map property AxMap.SendSelectBoxDrag must be set to True for this event to be fired. More...
 
_DMapEvents_SelectBoxFinalEventHandler SelectBoxFinal
 This event is fired when the user finishes dragging a selection box in the map control. The map property AxMap.SendSelectBoxFinal must be set to True for this event to be fired. More...
 
_DMapEvents_SelectionChangedEventHandler SelectionChanged
 This event is fired after shapes were selected with tkCursorMode.cmSelection tool. More...
 
_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. More...
 
_DMapEvents_ShapeIdentifiedEventHandler ShapeIdentified
 This event is fired when user click on a shape with tkCursorMode.cmIdentify tool active. More...
 
_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. More...
 
_DMapEvents_SnapPointFoundEventHandler SnapPointFound
 This event is fired after a snap point was found either by the default snapping algorithm of MapWinGIS or by a SnapPointRequested handler. Setting the snappedX and snappedY allows you to override this result (use with care!). More...
 
_DMapEvents_SnapPointRequestedEventHandler SnapPointRequested
 This event is fired whenever a snap point is requested by the map before the MapWinGIS snap algorithm was run. If the isFinal flag is set to true, the default snapping algorithm of MapWinGIS will be skipped. More...
 
_DMapEvents_TilesLoadedEventHandler TilesLoaded
 This event is fired when complete set of tiles has been loaded for the new map extents. More...
 
EventHandler UndoListChanged
 This event is fired when an operations is added or removed from undo/redo list of interactive ShapeEditor. More...
 
_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. More...
 

Detailed Description

Member Function Documentation

◆ DrawBackBuffer()

void AxMap.DrawBackBuffer ( int  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.
New API 5.1:
Updated in version 5.1

◆ FindSnapPoint()

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

◆ get_ErrorMsg()

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.

◆ HWnd()

int AxMap.HWnd ( )

Returns the handle of the window of map control.

Returns
The handle of window.

◆ LoadTilesForSnapshot()

bool AxMap.LoadTilesForSnapshot ( Extents  extents,
int  width,
string  key 
)

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.

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

New API 4.9.1:
Added in version 4.9.1

◆ Redraw()

◆ Redraw2()

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.

◆ Redraw3()

void AxMap.Redraw3 ( tkRedrawType  redrawType,
bool  reloadTiles 
)

Adveanced version of AxMap.Redraw2

Parameters
redrawTypeType of redraw.
reloadTilesReload the tiles, defaults to false when AxMap.Redraw2 is used.

◆ Resize()

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.

◆ ShowToolTip()

void AxMap.ShowToolTip ( string  text,
int  milliseconds 
)

Shows tooltip near the mouse cursor.

Parameters
textText of the tooltip.
millisecondsThe duration of tooltip display.

Property Documentation

◆ BackColor

uint AxMap.BackColor
getset

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.

◆ backColor

uint AxMap.backColor
getset

◆ ExtentHistoryRedoCount

int AxMap.ExtentHistoryRedoCount
get

Gets the number of previous extents to go to, forward in the undo list

◆ ExtentHistoryUndoCount

int AxMap.ExtentHistoryUndoCount
get

Gets the number of previous extents to go to, back in the undo list

◆ FileManager

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

◆ GlobalCallback

object AxMap.GlobalCallback
getset

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.

◆ Identifier

virtual Identifier AxMap.Identifier
get

Gets an Identifier object which holds settings of tkCursorMode.cmIdentify tools.

New API 4.9.3:
Added in version 4.9.3

◆ Key

string AxMap.Key
getset

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

◆ LastErrorCode

int AxMap.LastErrorCode
getset

Retrieves the last error generated in the object.

◆ MapCursor

tkCursor AxMap.MapCursor
getset

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

◆ MapResizeBehavior

tkResizeBehavior AxMap.MapResizeBehavior
getset

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

◆ ShapeEditor

virtual ShapeEditor AxMap.ShapeEditor
get

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

New API 4.9.3:
Added in version 4.9.3

◆ ShowRedrawTime

bool AxMap.ShowRedrawTime
getset

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 and are displayed.

New API 4.8:
Added in version 4.8
Examples
ToolTip.cs.

◆ ShowVersionNumber

bool AxMap.ShowVersionNumber
getset

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

◆ TileProvider

tkTileProvider AxMap.TileProvider
getset

Gets or sets tile provider for the map.

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

New API 4.9.1:
Added in version 4.9.1

◆ Tiles

Tiles AxMap.Tiles
getset

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

New API 4.9.0:
Added in version 4.9.0

◆ UDCursorHandle

int AxMap.UDCursorHandle
getset

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

◆ UndoList

virtual UndoList AxMap.UndoList
get

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

New API 4.9.3:
Added in version 4.9.3

◆ VersionNumber

string AxMap.VersionNumber
getset

Gets or sets version number of the control.

The set part of the property isn't supported.