Skip to content
Johann Levesque edited this page Sep 25, 2019 · 10 revisions

Services

A set of service endpoints used by the viewer.

Services JSON tree

"services": {
    "proxyUrl": ...,
    "corsEverywhere": ...,
    "exportMapUrl": ...,
    "geometryUrl": ...,
    "googleAPIKey": ...,
    "esriLibUrl": ...,
    "search": {
     "settings": {
      "categories": ...,
      "sortOrder": ...,
      "maxResults": ...,
      "officialOnly": ...,
     }
     "disabledSearches": [...],
     "serviceUrls": {
      "geoNames": ...,
      "geoLocation": ...,
      "geoSuggest": ...,
      "provinces": ...,
      "types": ...,
     }
    },
    "export": {
     "title": {
      "isSelected": ...,
      "isSelectable": ...,
      "value": ...
     },
     "map": {
      "isSelected": ...,
      "isSelectable": ...
     },
     "mapElements": {
      "isSelected": ...,
      "isSelectable": ...
     },
     "legend": {
      "isSelected": ...,
      "isSelectable": ...
      "showInfoSymbology": ...
      "showControlledSymbology": ...
      "columnWidth": ...
     },
     "footnote": {
      "isSelected": ...,
      "isSelectable": ...
      "value": ...
     },
     "timestamp": {
      "isSelected": ...,
      "isSelectable": ...
     }
     "timeout": ...
     "cleanCanvas": ...
    }
}

Services properties and definitions

services

A set of service endpoints used by the viewer.

Type Default value Example Author section Advance Required
object Services - -

⬆️ back to Services

An optional proxy to be used for dealing with same-origin issues. URL must either be a relative path on the same server or an absolute path on a server which sets CORS headers.

Type Default value Example Author section Advance Required
string "" "http://.../ProxyEndPoint" Services/Service End Points Yes -

⬆️ back to Services

A boolean indicating that all services are CORS enabled. This is mutually exclusive with proxyUrl..

Type Default value Example Author section Advance Required
boolean false `` Services/Service End Points Yes -

⬆️ back to Services


An ESRI service endpoint for generating map images. Should point directly to an endpoint that can be consumed by ESRI PrintTask. NOTE: The PrintTask service has to be asynchronous.

Type Default value Example Author section Advance Required
string "" "http://.../ExportMapEndPoint" Services/Service End Points Yes -

⬆️ back to Services


A URL to an ESRI ArcGIS geometry service REST endpoint.

Type Default value Example Author section Advance Required
string "" "http://.../GeometryEndPoint" Services/Service End Points Yes -

⬆️ back to Services


Google API key to enable geo location.

Type Default value Example Author section Advance Required
string "" "AIzaSyBT6w4TvRdWFhFk35tc" Services/Service End Points Yes -

⬆️ back to Services

ESRI JavaSCript API endpoint. Note, we can't use a version greater than v3.22.

Type Default value Example Author section Advance Required
string "" "http://..." Services/Service End Points Yes -

⬆️ back to Services


Search properties including ability to disable certain types of searches (NTS, FSA, and/or LAT/LNG) and to set service endpoint urls.

Type Default value Example Author section Advance Required
object Services/Geo Search - -

Configuration settings related to GeoSearch.

Type Default value Example Author section Advance Required
object Services/Geo Search Yes -

Filter the search results based on the type of the geographical names. Allowed values can be found here (if using the Canadian GeoNames Search Service API): http://geogratis.gc.ca/services/geoname/en/codes/concise.

Type Default value Example Author section Advance Required
array [] ['cities'] Services/Geo Search Yes -

The sort order of the defined 'categories'. Any missing categories are appended to the bottom of the sorted list. The results can still be sorted through this option even if there are no categories being filtered.

Type Default value Example Author section Advance Required
array [] ['cities'] Services/Geo Search Yes -

The maximum number of results to return per request. The Canadian GeoNames Search Service API has a 1000 search limit which will be used as an upper limit of results returned unless another service is being used with a higher limit. The default is 100 results.

Type Default value Example Author section Advance Required
integer 100 100 Services/Geo Search Yes -

Whether to return only official names for the geographic names. Default is false which will return both official names and formerly official names.

Type Default value Example Author section Advance Required
boolean false false Services/Geo Search Yes -

Enable specific types of searches including: National Topographic System, Postal Code/Foward Sorting Area or Latitude/Longitude (e.g. 58.12;-100.67).

Type Default value Example Author section Advance Required
array [] ["NTS","LAT/LNG"] Services/Geo Search - -

Service endpoint urls.

Type Default value Example Author section Advance Required
object Services/Geo Search Yes -

Endpoint url for geoLocation service.

Type Default value Example Author section Advance Required
string "" "https://.../en/locate?q=" Services/Geo Search Yes -

Endpoint url for geoNames service.

Type Default value Example Author section Advance Required
string "" "https://.../en/geonames.json" Services/Geo Search Yes -

Endpoint url for geoSuggest service.

Type Default value Example Author section Advance Required
string "" "https://.../en/suggest?q=" Services/Geo Search Yes -

Endpoint url for provinces service

Type Default value Example Author section Advance Required
string "" "https://.../en/codes/province.json" Services/Geo Search Yes -

Endpoint url for types service.

Type Default value Example Author section Advance Required
string "" "https://.../en/codes/concise.json" Services/Geo Search Yes -

⬆️ back to Services


Export properties.

Type Author section Advance Required
object Services/Export Map - -

Export title's properties.

Type Author section Advance Required
object Services/Export Map - -
Name Type Description Default value Example Author section Advance Required
title : isSelectable boolean true true Services/Export Map - -
title : isSelected boolean true true Services/Export Map - -
title : value string Value to appear by default "" "My map title" Services/Export Map - -

Map component.

Type Author section Advance Required
object Services/Export Map Yes -
Name Type Description Default value Example Author section Advance Required
map : isSelectable boolean true true Services/Export Map Yes -
map : isSelected boolean true true Services/Export Map Yes -

North arrow and scalebar component.

Type Author section Advance Required
object Services/Export Map -
Name Type Description Default value Example Author section Advance Required
mapElements : isSelectable boolean true true Services/Export Map - -
mapElements : isSelected boolean true true Services/Export Map - -

Legend component.

Type Author section Advance Required
object Services/Export Map Yes -
Name Type Description Default value Example Author section Advance Required
legend : isSelectable boolean true true Services/Export Map - -
legend : isSelected boolean true true Services/Export Map - -
legend : showInfoSymbology boolean false true Services/Export Map - -
legend : showControlledSymbology boolean false true Services/Export Map - -
legend : columnWidth integer 350 true Services/Export Map - -

Foot notice to add to exported map.

Type Author section Advance Required
object Services/Export Map Yes -
Name Type Description Default value Example Author section Advance Required
footnote : isSelectable boolean true true Services/Export Map - -
footnote : isSelected boolean true true Services/Export Map - -
footnote : value string Footnote value to appear by default "" "This is a foot notice" Services/Export Map - -

Timestamp component.

Type Author section Advance Required
object Services/Export Map - -
Name Type Description Default value Example Author section Advance Required
timestamp : isSelectable boolean true true Services/Export Map - -
timestamp : isSelected boolean true true Services/Export Map - -

⬆️ back to Services

A timeout delay in milliseconds after which the export image generation is considered to have failed. Defaults to 120sec.

Name Type Description Default value Example Author section Advance Required
timeout integer 120 true Services/Export Map - -

⬆️ back to Services

If set to true the export will omit layers and images that would cause issues with saving. If set to false users may need to save by right-clicking and selecting save image.

Name Type Description Default value Example Author section Advance Required
cleanCanvas boolean false true Services/Export Map - -

⬆️ back to Services

Annex

services : proxyUrl

You can find more information about proxy services here.

    "services"{
        ...,
        "proxyUrl": "http://.../ProxyEndPoint",
        ...
    }

⬆️ back to proxyUrl

services : corsEverywhere

    "services"{
        ...,
        "corsEverywhere": false,
        ...
    }

⬆️ back to corsEverywhere

services : exportMapUrl

You can find more information about exporting map to image services here.

    "services"{
        ...,
        "exportMapUrl": "http://.../ExportMapEndPoint",
        ...
    }

This service is used when you push the DOWNLOAD button of the export dialog window.

download

⬆️ back to exportMapUrl

services : geometryUrl

You can find more information about the geometry services here.

    "services"{
        ...,
        "geometryUrl": "http://.../GeometryEndPoint",
        ...
    }

⬆️ back to geometryUrl

services : googleAPIKey

You can find more information about the google API Key service here.

    "services"{
        ...,
        "googleAPIKey": "AIzaSyBT6w4TvRdWFhFk35tc",
        ...
    }

⬆️ back to googleAPIKey

services : ESRI Library URL

SRI JavaSCript API endpoint. Note, we can't use a version greater than v3.22.

    "services"{
        ...,
        "esriLibUrl": "http://...",
        ...
    }

⬆️ back to esriLibUrl

services : search

    "services"{
        ...,
        "search": {
            "settings": [...],
            "disabledSearches": [...],
            "serviceUrls": {...}
        }
        ...
    }

Searches can be done through the search bar.

search

⬆️ back to search

services : search : settings

Configuration settings related to GeoSearch.

    "search": {
        "settings":{
            "categories":"['cities']",
            "sortOrder":"['province', 'cities']",
            "maxResult":"100",
            "officialOnly":"true"
        },
        ...
    }

⬆️ back to settings

services : search : disabledSearches

Be cautious, the types of search identified in the array will be enabled in the viewer.

        "search": {
            "disabledSearches": ["NTS","LAT/LNG"],
            ...
        }

⬆️ back to search

services : search : serviceUrls

Default search services are provided by Natural Resources Canada and cover Canadian territories. You can find more information about thoses services here:

GeoLocation API: "geoLocation" and "geoSuggest"

GeoNames API: "geoNames", "provinces" and "types"

    "search": {
        "serviceUrls":{
            "geoNames":"https://geogratis.gc.ca/services/geoname/en/geonames.json",
            "geoLocation":"https://geogratis.gc.ca/services/geolocation/en/locate?q=",
            "geoSuggest":"https://geogratis.gc.ca/services/geolocation/en/suggest?q=",
            "provinces":"https://geogratis.gc.ca/services/geoname/en/codes/province.json",
            "types":"https://geogratis.gc.ca/services/geoname/en/codes/concise.json"
        },
        ...
    }

⬆️ back to serviceUrls

services : export

    "services"{
        ...,
        "export": {
            "title": {...},
            "map": {...},
            "mapElements": {...},
            "legend": {...},
            "footnote": {...},
            "timestamp": {...}
        },
        ...
    }

Accessing export dialog window

Access

Accessing the export settings can be done through the settings button Settings-buttons. Each element of the settings panel can be selected or not by setting the attribute "isSelected" and show or hide in the panel with the use of "isSelectable".

Settings

⬆️ back to export

services : export : title

    "export": {
      ...,
      "title": {
        "isSelectable": true,
        "isSelected": true,
        "value": "Export custom title"
      },
      ...
    }

title

⬆️ back to title

services : export : map

    "export": {
      ...,
      "map": {
        "isSelectable": true,
        "isSelected": true
      },
      ...
    }

map

⬆️ back to map

services : export : mapElements

    "export": {
      ...,
      "mapElements": {
        "isSelectable": true,
        "isSelected": true
      },
      ...
    }

mapElements

⬆️ back to mapElements

services : export : legend

    "export": {
      ...,
      "legend": {
        "isSelectable": true,
        "isSelected": true,
        "showInfoSymbology": false,
        "showControlledSymbology": false,
        "columnWidth": 350
      },
      ...
    }

legend

⬆️ back to legend

services : export : footnote

    "export": {
      ...,
      "footnote": {
        "isSelectable": true,
        "isSelected": true,
        "value": "This a footnote from the configuration file."
      },
      ...
    }

footnote

⬆️ back to footnote

services : export : timestamp

    "export": {
      ...,
      "timestamp": {
        "isSelectable": true,
        "isSelected": false
      },
      ...
    }

timestamp

⬆️ back to timestamp

services : export : timeout

    "export": {
      ...,
      "timeout": 120,
      ...
    }

⬆️ back to timeout

services : export : cleanCanvas

    "export": {
      ...,
      "cleanCanvas": false,
      ...
    }

⬆️ back to cleanCanvas

Clone this wiki locally