Functions | |
int | AxMap.AddLayer (object Object, bool visible) |
Adds a layer to the map. More... | |
int | AxMap.AddLayerFromDatabase (string connectionString, string layerNameOrQuery, bool visible) |
Adds a layer from spatial database accessed via GDAL/OGR drivers. More... | |
int | AxMap.AddLayerFromFilename (string filename, tkFileOpenStrategy openStrategy, bool visible) |
Adds layer from the specified datasource. More... | |
void | AxMap.Clear () |
Removes all data from the map and sets its properties to the default state. More... | |
object | AxMap.get_GetObject (int layerHandle) |
Returns the layer object with the given handle. The object could be a Shapefile, Grid, or Image object. More... | |
Image | AxMap.get_Image (int layerHandle) |
Gets image object associated with the layer. More... | |
Extents | AxMap.get_layerExtents (int layerHandle) |
Gets the layer extents More... | |
int | AxMap.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... | |
int | AxMap.get_LayerPosition (int layerHandle) |
Gets the position of the specified layer in the map. More... | |
bool | AxMap.get_LayerVisibleAtCurrentScale (int layerHandle) |
Gets a value which indicates whether a layer is visible at current map scale. More... | |
OgrLayer | AxMap.get_OgrLayer (int layerHandle) |
Gets instance of OGR layer object associated with the specified layer. More... | |
Shapefile | AxMap.get_Shapefile (int layerHandle) |
Gets shapefile object associated with the layer. More... | |
WmsLayer | AxMap.get_WmsLayer (int layerHandle) |
Gets the WmsLayer More... | |
bool | AxMap.MoveLayer (int initialPosition, int targetPosition) |
Moves a layer in the map from the initial position to a target position. More... | |
bool | AxMap.MoveLayerBottom (int initialPosition) |
Moves the specified layer below all other layers. More... | |
bool | AxMap.MoveLayerDown (int initialPosition) |
Moves the specified layer down one layer in the map. More... | |
bool | AxMap.MoveLayerTop (int initialPosition) |
Moves the specified layer to the top of all other layers. More... | |
bool | AxMap.MoveLayerUp (int initialPosition) |
Moves the specified layer up one layer in the map. More... | |
bool | AxMap.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 | AxMap.RemoveAllLayers () |
Removes all layers from the map. More... | |
void | AxMap.RemoveLayer (int layerHandle) |
Removes the specified layer from the map More... | |
void | AxMap.RemoveLayerWithoutClosing (int layerHandle) |
Removes layer from the map without its closing. More... | |
void | AxMap.ReSourceLayer (int layerHandle, string newSrcPath) |
Changes the data source for the specified layer without its closing. More... | |
void | AxMap.RestartBackgroundLoading (int ogrLayerHandle) |
Restarts the background loading thread of dynamically loaded layers More... | |
void | AxMap.set_Image (int layerHandle, Image newValue) |
Replaces the image object associated with the layer. More... | |
void | AxMap.set_Shapefile (int layerHandle, Shapefile newValue) |
Replaces the shapefile object associated with the layer. More... | |
bool | AxMap.StartNewBoundShape (double x, double y) |
Allow to initiate digitizing a new shape with a starting point More... | |
bool | AxMap.StartNewBoundShapeEx (int layerHandle) |
Allow to initiate digitizing a new shape with a starting point More... | |
Properties | |
int | AxMap.NumLayers [get] |
Gets the number of layers loaded in the map. More... | |
Here is a list of properties and methods which allow to work with layers of the map. This module is a part of the documentation of AxMap class.
int AxMap.AddLayer | ( | object | Object, |
bool | visible | ||
) |
Adds a layer to the map.
In case of OgrDatasource all layers will be added to the map. For grid datasources an instance of Image class created with Grid.OpenAsImage will be used for rendering.
Object | The object to add to the map. The following types are supported: Shapefile, Image, Grid, OgrLayer, OgrDatasource. |
visible | Sets whether the layer is visible after being added to the map. |
int AxMap.AddLayerFromDatabase | ( | string | connectionString, |
string | layerNameOrQuery, | ||
bool | visible | ||
) |
Adds a layer from spatial database accessed via GDAL/OGR drivers.
This method will search if there is a layer with specified name in the datasource, and if so will open it. Otherwise it will run OgrDatasource.RunQuery method with provided layerNameOrQuery argument. Additional information on failure can be obtained through AxMap.FileManager property.
connectionString | Connection string. See details for particular formats here. |
layerNameOrQuery | Name of the layer (i.e. database table) or SQL query. |
visible | A value indicating whether a new layer will be visible. |
The following example opens a temporary layer by querying PostGIS datatabase, adds the layer to the map and then accesses its data.
int AxMap.AddLayerFromFilename | ( | string | filename, |
tkFileOpenStrategy | openStrategy, | ||
bool | visible | ||
) |
Adds layer from the specified datasource.
Additional information on failure can be obtained through AxMap.FileManager property.
filename | Filename of datasource |
openStrategy | Open strategy (fosAutoDetect the default recommended value). |
visible | A value indicating whether a new layer will be visible. |
void AxMap.Clear | ( | ) |
Removes all data from the map and sets its properties to the default state.
object AxMap.get_GetObject | ( | int | layerHandle | ) |
Returns the layer object with the given handle. The object could be a Shapefile, Grid, or Image object.
For OGR layers this method will return underlying shapefile from OgrLayer.GetBuffer(). Use AxMap.get_OgrLayer to access instance of OgrLayer itself.
layerHandle | The handle of the layer to be retrieved. |
Image AxMap.get_Image | ( | int | layerHandle | ) |
Gets image object associated with the layer.
This method along with AxMap.get_Shapefile() can used to substitute AxMap.get_GetObject().
layerHandle | The handle of the layer. |
Extents AxMap.get_layerExtents | ( | int | layerHandle | ) |
Gets the layer extents
layerHandle | The handle of the layer. |
int AxMap.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
layerPosition | The position of the layer for which the layer handle is required. |
int AxMap.get_LayerPosition | ( | int | layerHandle | ) |
Gets the position of the specified layer in the map.
layerHandle | The layer handle of the layer for which the layer position is required. |
bool AxMap.get_LayerVisibleAtCurrentScale | ( | int | layerHandle | ) |
Gets a value which indicates whether a layer is visible at current map scale.
layerHandle | Handle of the layer. |
The property checks whether or not the layer is hidden because of AxMap.LayerDynamicVisibility property. However it doesn't check that the layer has any objects within the current map extents.
OgrLayer AxMap.get_OgrLayer | ( | int | layerHandle | ) |
Gets instance of OGR layer object associated with the specified layer.
layerHandle | The handle of the layer. |
Shapefile AxMap.get_Shapefile | ( | int | layerHandle | ) |
Gets shapefile object associated with the layer.
This method along with AxMap.get_Image() can be used to substitute AxMap.get_GetObject().
layerHandle | The handle of the layer. |
WmsLayer AxMap.get_WmsLayer | ( | int | layerHandle | ) |
bool AxMap.MoveLayer | ( | int | initialPosition, |
int | targetPosition | ||
) |
Moves a layer in the map from the initial position to a target position.
initialPosition | The initial position of the layer to be moved. |
targetPosition | The final position of the layer being moved. |
bool AxMap.MoveLayerBottom | ( | int | initialPosition | ) |
Moves the specified layer below all other layers.
initialPosition | The position of the layer to move to the bottom |
bool AxMap.MoveLayerDown | ( | int | initialPosition | ) |
Moves the specified layer down one layer in the map.
initialPosition | The position of the layer to be moved. |
bool AxMap.MoveLayerTop | ( | int | initialPosition | ) |
Moves the specified layer to the top of all other layers.
initialPosition | The position of the layer to be moved. |
bool AxMap.MoveLayerUp | ( | int | initialPosition | ) |
Moves the specified layer up one layer in the map.
initialPosition | The initial position of the layer to be moved. |
bool AxMap.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.
ogrLayerHandle | The handle of the layer. Must be an OGR layer. |
Starting with version 5.2.0, this function will also attempt to maintain the current set of Hidden and Selected shapes within the associated Shapefile.
void AxMap.RemoveAllLayers | ( | ) |
Removes all layers from the map.
void AxMap.RemoveLayer | ( | int | layerHandle | ) |
Removes the specified layer from the map
layerHandle | The handle of the layer to be removed from the map. |
void AxMap.RemoveLayerWithoutClosing | ( | int | layerHandle | ) |
Removes layer from the map without its closing.
Shapefile.Close or Image.Close won't be called while removing the layer.
layerHandle | The handle of the layer. |
void AxMap.ReSourceLayer | ( | int | layerHandle, |
string | newSrcPath | ||
) |
void AxMap.RestartBackgroundLoading | ( | int | ogrLayerHandle | ) |
Restarts the background loading thread of dynamically loaded layers
ogrLayerHandle | The handle of the layer. Must be an OGR layer. |
void AxMap.set_Image | ( | int | layerHandle, |
Image | newValue | ||
) |
Replaces the image object associated with the layer.
The old image will not be closed.
layerHandle | The handle of the layer. |
newValue | The new image object. |
void AxMap.set_Shapefile | ( | int | layerHandle, |
Shapefile | newValue | ||
) |
Replaces the shapefile object associated with the layer.
The old shapefile will not be closed.
layerHandle | The handle of the layer. |
newValue | The new shapefile object. |
bool AxMap.StartNewBoundShape | ( | double | x, |
double | y | ||
) |
Allow to initiate digitizing a new shape with a starting point
x | |
y |
bool AxMap.StartNewBoundShapeEx | ( | int | layerHandle | ) |
Allow to initiate digitizing a new shape with a starting point
layerHandle |
|
get |
Gets the number of layers loaded in the map.