Difference between revisions of "NXSL:GeoLocation"

467 bytes added ,  23:34, 17 January 2016
Added examples
(Added examples)
Line 45: Line 45:
| 3 || Network (obtained from network, for example using WiFi AP database)
| 3 || Network (obtained from network, for example using WiFi AP database)
|}
|}
===Examples===
'''Getting node location'''
<pre>
nodeLoc = $node->geolocation;
println("Node latitude: " . nodeLoc->latitudeText);
println("Node longitude: " . nodeLoc->longitudeText);
</pre>
Output:
<pre>
Node latitude: N 48° 00' 0.000"
Node longitude: E 22° 00' 0.000"
</pre>
'''Setting node location'''
<pre>
nodeLoc = GeoLocation(22.11, 48.12, 1);
$node->setGeoLocation(nodeLoc);
</pre>
'''Clearing node location'''
<pre>
$node->clearGeoLocation();
</pre>
184

edits