AutoPatrol, Bureaucrats, Administrators
481
edits
(Created page with "Represents geographical location (defined by latitude and longitude). '''Class Name''' GeoLocation '''Attributes''' {| class="wikitable" |- ! Name !! Type !! Description...") |
m (Text replacement - "^" to "{{deprecated}}") |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Represents geographical location (defined by latitude and longitude). | {{deprecated}}Represents geographical location (defined by latitude and longitude). | ||
Line 5: | Line 5: | ||
GeoLocation | GeoLocation | ||
'''Constructor''' | |||
GeoLocation(''latitude'', ''longitude'', [''type'']); | |||
If ''type'' is omitted 1 (manual) will be used. | |||
Line 38: | 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> |