Implementation Guide
0 mins to read
Custom Maps in MyGeotab
Implementation Guide
0 mins to read
Learn how Geotab supports custom maps, a feature that allows your organization to design business-specific maps that combine with the application’s vehicle information. Some possible usages include maps that show customer-centric information, underground water flow, municipal boundaries, or city infrastructure such as power or sewage.
20
April 2020
Geotab supports custom maps. This powerful feature allows your organization to design business-specific maps that combine with the application’s vehicle information. Some possible usages include maps that show customer-centric information, underground water flow, municipal boundaries, or city infrastructure (power, roads, sewage, etc).
The application supports custom map implementations based on OpenLayers https://openlayers.org/. Geotab currently supports four types of layers.
Custom map configuration page can be accessed from Administration > System… > System Settings under the Maps tab > Create custom web map.
By clicking on the Create custom web map, you will see the below default page. Remember to give a proper name and save it after editing.
After the custom map is configured, it can be accessed on the Map by clicking the layers button on the bottom-right of the page > clicking Map Provider > and selecting your custom map configuration from the list.
There are two parameters used in map configuration - units and projection. Please use the default value as shown below. Parameters are put inside the {}.
Sample Configure looks like :
{
"units": "m",
"projection": "EPSG:3857"
}
Layers are the contents of the map. Layers can be base layers and overlay layers. Each map must have at least one base layer. Each map can have multiple base layers, but only one base layer can be visible at a time. Each map can have multiple overlay layers, by default they are all visible, and they can be toggled on and off.
Below are some commonly used parameters in layer configuration:
This is a sample layer configuration. The layer configurations are inside [ ], configuration for each layer is inside { } that in the [ ]. The configuration between each layer is separated by comma and the parameters within each layer configuration are separated by comma as well.
[
{
"type": "",
"name": "",
"urls": "https://yourdomain.com",
"options": {
"format": "png32",
"isBaseLayer": false
},
“Parameter”:{
}
},
{
"type": "",
"name": "",
"urls": "https://yourdomain.com",
"options": {
"format": "png32"
},
“Parameter”:{
}
}
]
This is to show the tile mapping service hosted on ArcGIS online account. The service REST Url must be accessible by the public.
{
"type": "xyz",
"name": "AGOL_Ohio_OrthoImage",
"urls": [
"https://tiles.arcgis.com/tiles/b8eHPJ5KRnX3dHNa/arcgis/rest/services/Ortho_Map_Tile_Package_2/MapServer/tile/${z}/${y}/${x}"
],
"options": {
"format": "png",
"isBaseLayer": false
}
}
Customers should provide a tile server access URL with {(level)/${x}/${y} in it. The Urls sometimes will need an access token or Api_key which will be appended after “?” at the end of the url
{
"type": "xyz",
"name": "Custom Tile Server with Token",
"urls": [ https://public_tiles.dronedeploy.com/v1/tiles_images/5dd7155658881675c4519c78/orthomosaic/${z}/${x}/${y}?token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InJvYmJAb3ZlcmxhbmR0ZWNobGxjLmNvbSIsImxheWVyIjoib3J0aG9tb3NhaWMiLCJwbGFuX2lkIjoiNWRkNzE1NTY1ODg4MTY3NWM0NTE5Yzc4IiwiZXhwIjoyMTQ1OTE2ODAwMDAwfQ.CxclXNYdzZR_cC3rAQOMRVgAkX7WpPRTi2cKI30FrrFZ1JzauNQfhyvIQplu-wshbJwGcZcJUVIduWsjcpzDhw"
],
"options": {
"format": "png",
"isBaseLayer": false
}
}
WMTS (Web Map Tile Services) is one of OGC standards. Please provide capabilities xml using URL similar as the below one. https://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/1.0.0/WMTSCapabilities.xml
{
"type": "xyz",
"name": "WMTS-xyz",
"urls": [ "https://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/tile/1.0.0/Demographics_USA_Population_Density/default/default028mm/${z}/{y}/${x}"
],
"options": {
"format": "png",
"isBaseLayer": false
}
}
To use the MapBox map layer, you will need 1) MapBox Access Token 2) mapbox Style URL.
{
"type": "xyz",
"name": "MapBox_Arron",
"urls": [
"https://api.mapbox.com/v3/aaront.map-7ocnj45k/${z}/${x}/${y}.png"
],
"options": {
"isBaseLayer": true
}
},
{
"type": "xyz",
"name": "MapBox_Satellite",
"urls": [
"https://api.mapbox.com/v4/mapbox.satellite/${z}/${x}/${y}.png?access_token=pk.eyJ1Ijoic2VyZW5hLWdlb3RhYiIsImEiOiJjazhvdGVoaWYxY3YzM21xeG90a2VzNTBlIn0.DLmRoo-4PR-jrqLjS0tNOA"
],
"options": {
"isBaseLayer": false
}
}
Detail can refer to https://wiki.openstreetmap.org/wiki/Tile_servers
{
"type": "osm",
"name": "OpenStreetMap",
"urls": "https://{a-c}.tile.openstreetmap.org/${z}/${x}/${y}.png",
"options": {
"isBaseLayer": true
}
}
WMS (Web Map Services) is one of OGC standards. Please provide GetCapabilities results. The request is similar as below one. We will need to extract the url from there and get the layer information.
Layers can have multiple layer names listed as a comma separated list.
https://idpgis.ncep.noaa.gov/arcgis/services/NWS_Observations/radar_base_reflectivity/MapServer/WMSServer?request=GetCapabilities&service=WMS
{
"type": "wms",
"name": "WMS-Canada-RADAR_1KM_RSNO",
"urls": [
"https://geo.weather.gc.ca/geomet"
],
"options": {
"isBaseLayer": false
},
"params": {
"layers": "RADAR_1KM_RSNO"
}
}
{
"type": "wms",
"name": "WMS-NOAA",
"urls": [
"https://idpgis.ncep.noaa.gov/arcgis/services/NWS_Observations/radar_base_reflectivity/MapServer/WMSServer"
],
"options": {
"isBaseLayer": false
},
"params": {
"layers": "1",
"Tiled": true
}
}
This is used to display map data from Map Service hosted by Esri ArcGIS server 9.3 and above. Map Service needs to support the “Export Map” feature and need to provide a REST URL.
{
"type": "arcgis93rest",
"name": "StateCityHighway -USA",
"urls": [
"https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer"
],
"options": {
"format": "png",
"isBaseLayer": false
},
"params": {
"layers": "show:2",
"layerDefs": "2:STATE_NAME='Ohio'"
}
}
** If Dynamic Layers option is in Export Map session ( ArcGIS Server 10.2 and above), “dynamicLayers” can be added as one of the params and change styles of the layers on the Geotab Map
for example :
{
"type": "arcgis93rest",
"name": "Snow Ops",
"urls": "https://xxx.xxx.com/arlgis/rest/services/Snow/Snow_Ops/MapServer",
"options": {
"format": "png32",
"isBaseLayer": false
},
"params": {
"layers": "show:0",
"FORMAT": "PNG32",
"TRANSPARENT": true,
"dynamicLayers": "[{'id':0,'name':'Snow Priority Routes','source':{'type':'mapLayer','mapLayerId':0},'drawingInfo':{'renderer':{'type':'uniqueValue','field1':'PLOWTYPE','field2':null,'field3':null,'fieldDelimiter':',','defaultSymbol':null,'defaultLabel':null,'uniqueValueInfos':[{'value':'1','symbol':{'color':[255,255,0,255],'width':2,'type':'esriSLS','style':'esriSLSSolid'},'label':'Primary County'},{'value':'2','symbol':{'color':[0,92,230,255],'width':2,'type':'esriSLS','style':'esriSLSSolid'},'label':'Secondary County'},{'value':'4','symbol':{'color':[76,230,0,255],'width':2,'type':'esriSLS','style':'esriSLSSolid'},'label':'School Priorities'},{'value':'3','symbol':{'color':[0,0,0,255],'width':2,'type':'esriSLS','style':'esriSLSSolid'},'label':'VDOT Maintained'}]},'showLabels':false},'minScale':0,'maxScale':0}]"
}
}
You can find how to get the "dynamicLayers" parameter here, remember to replace the double quote " to single quote '.
https://support.esri.com/en/technical-article/000015441