Map serialization

Functions

bool AxMap.DeserializeLayer (int layerHandle, string newVal)
 Restores the state of the layer from the string generated by AxMap.SerializeLayer(). More...
 
bool AxMap.DeserializeMapState (string state, bool loadLayers, string basePath)
 Restores map state from the string generated by AxMap.SerializeMapState. More...
 
bool AxMap.LoadLayerOptions (int layerHandle, string optionsName, ref string description)
 Applies to the layer a set of settings from file with the specified name. More...
 
bool AxMap.LoadMapState (string filename, object callback)
 Loads the state of the map from the file created by AxMap.SaveMapState method. More...
 
bool AxMap.RemoveLayerOptions (int layerHandle, string optionsName)
 Removes set of options for the layer with the specified name. More...
 
bool AxMap.SaveLayerOptions (int layerHandle, string optionsName, bool overwrite, string description)
 Saves settings of the layer to the file. More...
 
bool AxMap.SaveMapState (string filename, bool relativePaths, bool overwrite)
 Saves the state of the map to the specified file. More...
 
string AxMap.SerializeLayer (int layerHandle)
 Serializes the layer settings to the string. More...
 
string AxMap.SerializeMapState (bool relativePaths, string basePath)
 Serializes map state to the string. More...
 

Detailed Description

Here is a list of properties and methods to preserve the state of the map and particular layers. This module is a part of the documentation of AxMap class.

dot_inline_dotgraph_23.png

Graph description

Function Documentation

◆ DeserializeLayer()

bool AxMap.DeserializeLayer ( int  layerHandle,
string  newVal 
)

Restores the state of the layer from the string generated by AxMap.SerializeLayer().

Parameters
layerHandleThe handle of the layer.
newValThe string to restore values from.
Returns
True on success and false otherwise.
New API 4.8:
Added in version 4.8

◆ DeserializeMapState()

bool AxMap.DeserializeMapState ( string  state,
bool  loadLayers,
string  basePath 
)

Restores map state from the string generated by AxMap.SerializeMapState.

This method will remove all the existing layers and load the layers specified in the string.

Parameters
stateThe string with serialized state.
loadLayersA boolean value which indicates whether layers or only options of the map control will restored.
basePathThe path to the base folder starting from which relative paths were calculated.
Returns
True on success and false otherwise.
New API 4.8:
Added in version 4.8

◆ LoadLayerOptions()

bool AxMap.LoadLayerOptions ( int  layerHandle,
string  optionsName,
ref string  description 
)

Applies to the layer a set of settings from file with the specified name.

The options will be loaded from the file with the name [LayerName].[OptionsName].mwsymb

Parameters
layerHandleThe handle of the layer.
optionsNameThe name of the set of options.
descriptionThe output string which will hold the description of the options stored in file.
Returns
True on success and false otherwise.
New API 4.8:
Added in version 4.8
Examples
AddCategoryRange.cs.

◆ LoadMapState()

bool AxMap.LoadMapState ( string  filename,
object  callback 
)

Loads the state of the map from the file created by AxMap.SaveMapState method.

Parameters
filenameThe name of the file.
callbackA callback object to return information about progress and errors.
Returns
True on success and false otherwise.
New API 4.8:
Added in version 4.8

◆ RemoveLayerOptions()

bool AxMap.RemoveLayerOptions ( int  layerHandle,
string  optionsName 
)

Removes set of options for the layer with the specified name.

The options are stored in files with the name [LayerName].[OptionsName].mwsymb

Parameters
layerHandleThe handle of the layer.
optionsNameThe name of the set of options.
Returns
True on success and false otherwise.
New API 4.8:
Added in version 4.8

◆ SaveLayerOptions()

bool AxMap.SaveLayerOptions ( int  layerHandle,
string  optionsName,
bool  overwrite,
string  description 
)

Saves settings of the layer to the file.

The options are saved to the file with name [LayerName].[OptionsName].mwsymb

Parameters
layerHandleThe handle of the layer.
optionsNameThe name which will be attached to the set of options.
overwriteA value which indicates whether the existing file will be overwritten.
descriptionThe description associated with the set of options.
Returns
True on success and false otherwise.
New API 4.8:
Added in version 4.8
Examples
AddCategoryRange.cs.

◆ SaveMapState()

bool AxMap.SaveMapState ( string  filename,
bool  relativePaths,
bool  overwrite 
)

Saves the state of the map to the specified file.

Use AxMap.LoadState for reverse operation.

The serialized state include:

  • properties of the control;
  • references to the layers;
  • drawing options for the layers.
Parameters
filenameThe name of the file.
relativePathsA value which indicates whether absolute or relative paths should be used.
overwriteA value which indicates whether the exiting file will be overwritten.
Returns
True on success and false otherwise.
New API 4.8:
Added in version 4.8

◆ SerializeLayer()

string AxMap.SerializeLayer ( int  layerHandle)

Serializes the layer settings to the string.

The serialized string will not include information about the data source. Therefore the same options can later be applied to any data layer of the same type (either shapefile or image).

Parameters
layerHandleThe handle of the layer.
Returns
The string with serialized layer settings.
New API 4.8:
Added in version 4.8

◆ SerializeMapState()

string AxMap.SerializeMapState ( bool  relativePaths,
string  basePath 
)

Serializes map state to the string.

Parameters
relativePathsA value which indicates whether relative or absolute paths to data sources will be used.
basePathThe path to the base folder starting from which relative paths will be calculated.
Returns
The string with the serialized map state.
New API 4.8:
Added in version 4.8