Skip to content
Christian Latouche edited this page May 7, 2018 · 1 revision

UI

User Interface configuration

UI JSON tree

"ui": {
    "fullscreen": ...,
    "theme": ...,
    "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 at first load.

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

⬆️ back to UI


UI theme of the viewer. For now, only "default" value is available

Type Default value Example Author section Advance Required
string "default" "default" UI/TBD - -

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

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 -

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

Shows the side menu button in the main app toolbar.

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

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

Shows the basemap selector button in the main app toolbar.

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

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

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

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 -

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

The content of the about section.

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

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 -

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

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 -

Specifies if the user-added layers are allowed.

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

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

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

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 -

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 -
Type Default value Example Author section Advance Required
tableIsOpen : id string The id of the layer for referencing within the viewer. - "mylayerID" UI/General

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 -

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 -

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

Annex

ui : fullscreen

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

⬆️ back to fullscreen

ui : theme

    "ui"{
        ...,
        "theme": "default",
        ...
    }

⬆️ back to theme

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