NXSL:GeoLocation

From NetXMS Wiki
Jump to navigation Jump to search
This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide)

Represents geographical location (defined by latitude and longitude).


Class Name

GeoLocation


Constructor

GeoLocation(latitude, longitude, [type]);

If type is omitted 1 (manual) will be used.


Attributes

Name Type Description
latitude real Latitude as floating point number
latitudeText string Latitude as text
longitude real Longitude as floating point number
longitudeText string Longitude as text
type int32 Location type

Possible location types are:

Value Description
0 Unset (represents unknown location)
1 Manual (set by system administrator)
2 Automatic (obtained from GPS)
3 Network (obtained from network, for example using WiFi AP database)

Examples

Getting node location

nodeLoc = $node->geolocation;

println("Node latitude: " . nodeLoc->latitudeText);
println("Node longitude: " . nodeLoc->longitudeText);

Output:

Node latitude: N 48° 00' 0.000"
Node longitude: E 22° 00' 0.000"

Setting node location

nodeLoc = GeoLocation(22.11, 48.12, 1);

$node->setGeoLocation(nodeLoc);

Clearing node location

$node->clearGeoLocation();