The module sv-geolocation
is an iTop extension to add a new attribute type called AttributeGeolocation
to provide geographic coordinates.
This new attribute type is added to the Location
class as a new field.
The module also provides a new dashboard dashlet GeoMap
which adds an interactive map.
Place this in the extensions
folder of your iTop instance and run iTop setup again.
Be sure to enable the extension during setup.
After installation, it is possible to change some settings in order to let this module fully function.
Specify the provider you want to use for interactive maps.
GoogleMaps
MapLibre
MapTiler
OpenStreetMap
MapQuest
Depending on the provider you are using, you might need to enter the API key.
How to get API keys for:
This value depends on which map provider (GM, OSM, …) you want to use for thumbnails. It only needs to be set if you want to override the default behaviour.
Depending on each map provider, there are several parameters to give. The following parameters will be filled in:
Example values for staticmapurl
:
https://maps.googleapis.com/maps/api/staticmap?markers=%f,%f&size=%dx%d&key=%s
.https://www.mapquestapi.com/staticmap/v5/map?locations=%f,%f&size=%d,%d@2x&key=%s&zoom=%d
https://api.maptiler.com/maps/bright-v2/static/auto/%3$dx%4$d@2x.png?markers=%1$f,%2$f&key=%5$s
Note that you can also use QR Code Generator as thumbnail generator.
The resulting value for staticmapurl
then looks like: https://api.qrserver.com/v1/create-qr-code/?data=geo:%f,%f&size=%dx%d
When using a MapLibre provider, you can use a custom style specification. The value is either a URL to the style JSON file or a representation of the style.
The module has default values for the following providers:
https://api.maptiler.com/maps/bright-v2/style.json?key=YOUR_MAPTILER_API_KEY
This is the default latitude when a new dashlet is displayed.
This is the default longitude when a new dashlet is displayed.
This is the default zoom for dashlet maps and for static maps.
Note that by default, the static map from Google Maps have a dynamic zoom level.
If you want a fixed zoom level, you will need to reflect this in the parameter staticmapurl
.
This value specifies if the coordinates of the geolocation also should be shown under the thumbnail. This is enabled by default. Note that when you don’t have thumbnails, the coordinates will always be displayed.
Field type is AttributeGeolocation
.
<field id="geo" xsi:type="AttributeGeolocation">
<sql>geo</sql>
<default_value/>
<is_null_allowed>true</is_null_allowed>
<width>200</width>
<height>150</height>
</field>
Dashlet type is DashletGeoMap
.
<dashlet id="1" xsi:type="DashletGeoMap">
<rank>1</rank>
<height>500</height>
<search>true</search>
<query>SELECT Location</query>
<attribute>geo</attribute>
</dashlet>
This module also adds some functions to choose the coordinate system when the attribute is used in notifications.
$this->geo$
or $this->wgs_84(geo)$
: Display the coordinates in EPSG:4326 (lat,lon).$this->rd(geo)$
or $this->rijksdriehoek(geo)$
: Display the coordinates in EPSG:28992 (X,Y).$this->html(geo)$
: HTML representation just like in the detail or list view.Translations can be submitted via Transifex. Please create a new issue if you want a new language to be added to the project.