OpenLayersTools.BaseFunc

This class implements the basic functions such as centering the map, converting the geometry and more.

Summary
OpenLayersTools.BaseFuncThis class implements the basic functions such as centering the map, converting the geometry and more.
Functions
BaseFuncInitialize the object BaseFunc.
extendConfigFromDefaultExpands the list of object parameters.
centerMapCenters the map on the specified coordinates.
bindEventToObjectWire up the event to the object.
checkUndefinedChecks the variable to exist.
geometryToStringConverts the geometry into a string.
stringToGeometryConverts a string to geometry.

Functions

BaseFunc

function BaseFunc(parent)

Initialize the object BaseFunc.

Parameters

parentObject that is the parent of this class.

Returns

Object of BaseFunc.

extendConfigFromDefault

extendConfigFromDefault: function (existsConfig,
defaultConfig)

Expands the list of object parameters.

Parameters

existsConfigThe object to add parameters (expand).
defaultConfigObject from which to take the value to extend.

Returns

The object, which includes a fields of two objects.

Usage

MapOptions = OpenLayersTools.BaseFunc.extendConfigFromDefault(mapOptions, defaultOptions.mapOptions);

centerMap

centerMap: function (lon,
lat,
projection)

Centers the map on the specified coordinates.

Parameters

lonlongitude.
latlatitude.
projectionprojection.

Returns

True if the function is successful.

Usage

OpenLayersTools.BaseFunc.centerMap(longitude, latitude, 'EPSG:4326');

bindEventToObject

bindEventToObject: function (object,
listeners)

Wire up the event to the object.

Parameters

objectObject on which to hang the event.
listenersAn object that specifies the types of events and functions for data processing.

Returns

True if the function is successful.

Usage

Coming soon...

checkUndefined

checkUndefined: function (object)

Checks the variable to exist.

Parameters

objectVariable you want to check.

Returns

True if the object does not exist, and false if the object exists.

Usage

if (OpenLayersTools.BaseFunc.checkUndefined(layer)) {
OpenLayersTools.Console.writeError('layer is undefined!');
return false;
}

geometryToString

geometryToString: function (geometry)

Converts the geometry into a string.

Parameters

geometryGeometry, which is the class of OpenLayers.Geometry.

Returns

WKT of given geometry.

Usage

Coming soon...

stringToGeometry

stringToGeometry: function (string)

Converts a string to geometry.

Parameters

stringWKT of geometry that you want to convert.

Returns

OpenLayers.Geometry of given WKT.

Usage

Coming soon...
function BaseFunc(parent)
Initialize the object BaseFunc.
extendConfigFromDefault: function (existsConfig,
defaultConfig)
Expands the list of object parameters.
centerMap: function (lon,
lat,
projection)
Centers the map on the specified coordinates.
bindEventToObject: function (object,
listeners)
Wire up the event to the object.
checkUndefined: function (object)
Checks the variable to exist.
geometryToString: function (geometry)
Converts the geometry into a string.
stringToGeometry: function (string)
Converts a string to geometry.
Close