Skip to content
Christian Latouche edited this page Apr 24, 2018 · 37 revisions

The Federal Geospatial Platform Viewer (FGPV) schema V. 2.3

The schema.json file can be found here

  1. [Map](#map)
  2. UI
  3. Services
  4. Version
  5. Language

UI

User Interface configuration

UI JSON tree

"ui": {
    "fullscreen": ...,
    "logoUrl": ...,
    "title": ...,
    "restrictNavigation": ...,
    "failureFeedback": {
     "failureMessage": ...,
     "failureImageUrl": ...
    },
    "appBar": {
     "sideMenu": ...,
     "geoSearch": ...,
     "basemap": ...,
     "layers": ...
    },
    "navBar": {
     "extra": ...
    },
    "sideMenu": {
     "logo": ...,
     "items": [ ]
    },
    "about": {
     "content": ...,
    OR
     "folderName": ...
    },
    "help": {
     "folderName": ...,
    },
    "legend": {
     "reorderable": ...,
     "allowImport": ...,
     "isOpen": {
      "large": ...,
      "medium": ...,
      "small": ...
     }
    },
    "tableIsOpen": {
     "id": ...,
     "large": ...,
     "medium": ...,
     "small": ...
    }
}

ui

User Interface configuration.

Type Author section Advance Required
object UI - -

⬆️ back to UI

Indicates viewer takes up entire viewport.

Type Default value Example Author section Advance Required
boolean false false UI/General - -

⬆️ back to UI

An optional image to be used in the place of the default viewer logo.

Type Default value Example Author section Advance Required
string - "data:image/png;base64,image encoded" UI/Side Menu Yes -

⬆️ back to UI

An optional title to be used in the place of the default viewer title.

Type Default value Example Author section Advance Required
string - My custom title UI/Side Menu - -

⬆️ back to UI

Will restrict the user from panning beyond the maximum extent.

Type Default value Example Author section Advance Required
boolean false false UI/Navigation - -

⬆️ back to UI

Failure information.

Type Author section Advance Required
object UI/General Yes -

⬆️ back to UI

An optional message to be used in place of the failure message.

Type Default value Example Author section Advance Required
string - "That's a fail :-(" UI/General Yes -

⬆️ back to UI

An optional image to be used in place of the failure Image.

Type Default value Example Author section Advance Required
string - "https://path2Image/MyFailureImage.gif" UI/General Yes -

⬆️ back to UI

Provides configuration to the main app toolbar. If not supplied, the default appbar controls are displayed. To completely hide the toolbar, provide the following: { sideMenu: false, geoSearch: false, layers: false }.

Type Author section Advance Required
object UI/Application Bar - -

⬆️ back to UI

Shows the side menu button in the main app toolbar.

Type Default value Example Author section Advance Required
boolean true true UI/Application Bar - -

⬆️ back to UI

Shows the geosearch button in the main app toolbar. The button will be hidden if geosearch component is disabled or no search service URLs are provided.

Type Default value Example Author section Advance Required
boolean true true UI/Application Bar - -

⬆️ back to UI

Shows the basemap selector button in the main app toolbar.

Type Default value Example Author section Advance Required
boolean true true UI/Application Bar - -

⬆️ back to UI

Shows the layers button in the main app toolbar.

Type Default value Example Author section Advance Required
boolean true true UI/Application Bar - -

⬆️ back to UI

Provides configuration to the nav bar. If not supplied the default nav bar buttons are shown.

Type Author section Advance Required
object UI/Navigation - -

⬆️ back to UI

Set visible navigation bar buttons. Possible values: "geoLocator", "home", "basemap", "help", "fullscreen", "geoSearch", "sideMenu", "layers"

Type Default value Example Author section Advance Required
array ["fullscreen", "geoLocator", "home", "help"] ["home", "help", "fullscreen", "geoSearch", "sideMenu", "layers"] UI/Navigation - -

⬆️ back to UI

Specifies which options are available in the left side menu.

Type Author section Advance Required
object UI/Side Menu - -

⬆️ back to UI

Indicates if the logo should be shown in the left side menu.

Type Default value Example Author section Advance Required
boolean true true UI/Side Menu Yes -

⬆️ back to UI

Side Menu set of buttons. Divide the menu using array symbols []. Possible values are "layers", "basemap", "geoSearch", "about", "fullscreen", "export", "share", "touch", "help", "language", "plugins"

Type Default value Example Author section Advance Required
array [["layers", "basemap"], ["fullscreen", "export", "share", "touch", "help", "about"], ["language"], ["plugins"]] [["layers", "basemap"], ["fullscreen", "export", "about"], ["language"]] UI/Side Menu - -

⬆️ back to UI

Specifies the location/content of the about section.

Type Author section Advance Required
object UI/Side Menu - -

⬆️ back to UI

The content of the about section.

Type Default value Example Author section Advance Required
string - "This is about about" UI/Side Menu - -

⬆️ back to UI

Help folder name which contains the about file(s) and image(s). The viewer will look inside a folder named about for the specified folder name (e.g. /about/aboutisHere). Afterward, it'll check for a markdown file named en-CA.md if you are in the English flavor of the viewer and fr-CA.md for the French. Images need to reside inside the specified folder.

Type Default value Example Author section Advance Required
string - aboutIsHere UI/Side Menu - -

⬆️ back to UI

Specifies details for the Help section.

Type Author section Advance Required
object UI/Side Menu Yes -

⬆️ back to UI

Help folder name which contains the help description and image(s). The viewer will look inside a folder named help for the specified folder name (e.g. /help/helpIsHere). Afterward, it'll check for a markdown file named en-CA.md if you are in the English flavor of the viewer and fr-CA.md for the French. Images need to reside inside the specified folder. NOTE The viewer has already a default help. Consequently, you will use this parameter only if you want a custom help.

Type Default value Example Author section Advance Required
string - HelpIsHere UI/Side Menu Yes Yes

⬆️ back to UI

Specifies options for the legend like reordering, importing, etc.

Type Author section Advance Required
object UI/General - -

⬆️ back to UI

Specifies if the items in the legend can be reordered; structured legend ignores this property.

Type Default value Example Author section Advance Required
boolean true true UI/General -

⬆️ back to UI

Specifies if the user-added layers are allowed.

Type Default value Example Author section Advance Required
boolean true true UI/General - -

⬆️ back to UI

Specifies whether the legend is opened by default on initial loading of the map for small, medium, and large viewports. ||| UI/General.

Type Author section Advance Required
object UI/General - -

⬆️ back to UI

Whether the legend is opened by default on initial loading of the map for large viewports.

Type Default value Example Author section Advance Required
boolean false false UI/General - -

⬆️ back to UI

Whether the legend is opened by default on initial loading of the map for medium viewports.

Type Default value Example Author section Advance Required
isOpen : medium boolean false false UI/General -

⬆️ back to UI

Whether the legend is opened by default on initial loading of the map for small viewports.

Type Default value Example Author section Advance Required
boolean false false UI/General -

⬆️ back to UI

A set of service endpoints used by the viewer.

Type Author section Advance Required
object UI/General Yes -

⬆️ back to UI

Type Default value Example Author section Advance Required
tableIsOpen : id string The id of the layer for referencing within the viewer. - "mylayerID" UI/General

⬆️ back to UI

Whether the table panel is opened by default on initial loading of the map for large viewports.

Type Default value Example Author section Advance Required
boolean false false UI/General Yes -

⬆️ back to UI

Whether the table panel is opened by default on initial loading of the map for medium viewports.

Type Default value Example Author section Advance Required
boolean false false UI/General Yes -

⬆️ back to UI

Whether the table panel is opened by default on initial loading of the map for small viewports.

Type Default value Example Author section Advance Required
boolean false false UI/General Yes -

⬆️ back to UI

Services

A set of service endpoints used by the viewer.

Services JSON tree

"services": {
    "proxyUrl": ...,
    "exportMapUrl": ...,
    "geometryUrl": ...,
    "googleAPIKey": ...,
    "search": {
     "disabledSearches": [...],
     "serviceUrls": {
      "geoNames": ...,
      "geoLocation": ...,
      "geoSuggest": ...,
      "provinces": ...,
      "types": ...,
     }
    },
    "export": {
     "title": {
      "isSelected": ...,
      "isSelectable": ...,
      "value": ...
     },
     "map": {
      "isSelected": ...,
      "isSelectable": ...
     },
     "mapElements": {
      "isSelected": ...,
      "isSelectable": ...
     },
     "legend": {
      "isSelected": ...,
      "isSelectable": ...
     },
     "footnote": {
      "isSelected": ...,
      "isSelectable": ...
      "value": ...
     },
     "timestamp": {
      "isSelected": ...,
      "isSelectable": ...
     }
    }
}

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

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

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 - -

⬆️ back to Services

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 - -

⬆️ back to Services

Service endpoint urls.

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

⬆️ back to Services

Endpoint url for geoLocation service.

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

⬆️ back to Services

Endpoint url for geoNames service.

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

⬆️ back to Services

Endpoint url for geoSuggest service.

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

⬆️ back to Services

Endpoint url for provinces service

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

⬆️ back to Services

Endpoint url for types service.

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

Export properties.

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

⬆️ back to Services

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 - -

⬆️ back to Services

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 -

⬆️ back to Services

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 - -

⬆️ back to Services

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 - -

⬆️ back to Services

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 - -

⬆️ back to Services

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

Version

The schema version used to validate the configuration file. The schema should enumerate the list of versions accepted by this version of the viewer.

"version": "2.2"

Language

ISO 639-1 code indicating the language of strings in the schema file.

ISO 639-1 code Language Default
"en" English Yes
"fr" French
"language": "en"

Annex

ui : fullscreen

    "ui"{
        ...,
        "fullscreen": true,
        ...
    }

back to fullscreen

ui : logoUrl

Note: if you want your custom logo to be shown, you have to set "sideMenu" {"logo": true} (see sideMenu)

    "ui"{
        ...,
        "logoUrl": "data:image/png;base64,image encoded",
        ...
    }

logoUrl

back to logoUrl

ui : title

    "ui"{
        ...,
        "title": "Custom title",
        ...
    }

title

back to title

ui : restrictNavigation

    "ui"{
        ...,
        "restrictNavigation": true,
        ...
    }

back to restrictNavigation

ui : failureFeedback

    "ui"{
        ...,
        "failureFeedback": {
            "failureMessage": "That's a fail :-(",
            "failureImageUrl":"https://files.gitter.im/AleksueiR/eR5s/dinoscream.gif"
        },
        ...
    }

failureFeedback

back to failureFeedback

ui : appBar

The application bar could be found at the top left corner of the viewer.

    "ui"{
        ...,
        "appBar": {
            "sideMenu": true,
            "geoSearch": true,
            "basemap": true,
            "layers": true
        },
        ...
    }

Putting false to an element will hide it. Also, basemap button will appear only after layers button has been pushed.

appBar

back to appBar

ui : navBar

The application bar could be found at the bottom right corner of the viewer.

    "ui"{
        ...,
        "navBar": {
            "extra": ["fullscreen", "geoLocator", "home", "help", "basemap", "geoSearch", "sideMenu", "layers"]
        },
        ...
    }

navBar

back to navBar

ui : sideMenu

The sidemenu can be accessed through sideMenu button.

This code snippet will generate a sidemenu containing four categories with a title and a logo at the top. A custom logo can be defined here and a custom title here.

    "ui"{
        ...,
        "sideMenu": {
            "logo": true,
            "items": [["layers", "basemap"], ["fullscreen", "export", "share", "touch", "help"], ["language"], ["plugins"]]
        },
        ...
    }

sideMenu

back to sideMenu

ui : about

The about section can be accessed in the sidemenu. NOTE You can't put both content and folderName they are mutually exclusive.

    "ui"{
        ...,
        "about": {
            "content": "This is about the about section"
            OR
            "folderName": "indexOne"
        },
        ...
    }

Here's an example with content. ui-about-content.gif

about content

Here's an example with a folderName. The folder is structured like this:

about\
    indexOne\
        images\
            canada.png
        en-CA.md
        fr-CA.md

about folderName

back to about

ui : help

The help section can be accessed in the sidemenu or in the navigation bar.

    "ui"{
        ...,
        "help": {
            "folderName": "myHelp"
        },
        ...
    }

Here's the corresponding files and folders structure:

help\
    myHelp\
        images\
            image1.png
            image2.png
            ...
        en-CA.md
        fr-CA.md

back to help

ui : legend

    "ui"{
        ...,
        "legend": {
            "isOpen": {
                "large": true,
                "medium": true,
                "small": false
        },
        ...
    }

back to legend

ui : tableIsOpen

    "ui"{
        ...,
        "tableIsOpen": {
            "id": "DateLayer",
            "large": true,
            "medium": true,
            "small": false
        },
        ...
    }

back to tableIsOpen

services : proxyUrl

You can find more information about proxy services here.

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

back to proxyUrl

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 : search

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

Searches can be done through the search bar.

search

back to search

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 "geoSuggets"

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
      },
      ...
    }

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

Clone this wiki locally