Implementation Guide

0 mins to read

20

April 2020

Table of contents


Custom Map Builder

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.

  1. xyz- Tile Server arranged by a standard XYZ grid
  2. osm - OpenStreetMap tiles
  3. wms - OGC Web Mapping Services
  4. ArcGIS93Rest - Mapping Services hosted by ArcGIS server 9.3 above

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.document Image

Navigating to Custom Map View

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.

Configure the Custom Map

Configure Map

There are two parameters used in map configuration - units and projection. Please use the default value as shown below. Parameters are put inside the {}.

  1. "units" is the map unit - It is an option, default value is “m” or “meter” -"units": "meters",
  2. “projection “ is the projected coordinate system the map uses. It is an option , default value is “EPSG:3857”, this is the Spherical Mercator projection coordinate system popularized by web services such as Google and later OpenStreetMapis. -- "projection": "EPSG:3857"

Sample Configure looks like :

{

"units": "m",

"projection": "EPSG:3857"

}

Configure Layers

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.

Layer Parameters

Below are some commonly used parameters in layer configuration:

  1. “Type”: support type are “xyz”, ”osm”, "arcgis93rest",” wms”
  2. “Name”: the layer name, will show in the layer selection window
  3. “urls” - all urls must use HTTPS
  4. “options"
    1. “isBaseLayer'' - whether or not the layer is baselayer. This is option, default value is “true”
    2. “Format” - the export tile format. This is option, default value is “png”
  5. “Param”
    1. “Layers” - The selected layers for WMS service. It is mandatory for “wms” layer type and option for other layer types.

Sample 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”:{

}

}

]

XYZ - Custom Tile Server Template

Esri ArcGIS Online Tiled Map Service

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

}

}

Custom Tiled Map Service

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 layer

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

}

}

MapBox Tiles

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

}

}

OSM Custom Tiles Template

Open Street Map

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 Custom Tiles Template

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

Canada Weather

{

"type": "wms",

"name": "WMS-Canada-RADAR_1KM_RSNO",

"urls": [

"https://geo.weather.gc.ca/geomet"

],

"options": {

"isBaseLayer": false

},

"params": {

"layers": "RADAR_1KM_RSNO"

}

}

NOAA Satellite

{

"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

}

}

ArcGIS Rest URL Template

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.

Map Layer hosted by Esri ArcGIS Server

{

"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

Limitation

  1. Visibility not working - by default all overlayers are turned on
  2. Map transparency is not working - by default all overlays are not transparent
  3. All the overlay layers are turned on by default, you can toggle the checkbox to turn it on/off.

scroll-up