Master layer and tool list explained - GeoscienceAustralia/interactive-maps GitHub Wiki

Master layer and tool list

The concept behind creating master lists reduces the duplication of having to define layers and tools in very single configuration file. For example if a service URL has changed you only need to update it in one place and not in every single configuration file.

Master layer list

The master layer list uses the concept of a slug to uniquely identify a layer to be used in the configuration file. This is to support the master layer list to be accessible via a web service in the future using Semantic URLs. In our example in earthquakeshazards.json we had 2 layers defined using the slugs Australian_Topography_2014_ARCGIS and Earthquake_Hazards.

   "layerMaps": [
        {
            "slug": "Australian_Topography_2014_ARCGIS"
        },
        {
            "slug": "Earthquake_Hazards",
            "opacity": 0.7,
            "queryFeatures": true
        }
    ]

The Australian_Topography_2014_ARCGIS layer is defined in the master-layer-list.json files as follows

  {
            "slug": "Australian_Topography_2014_ARCGIS",
			"extent": [99,10],[169,-55](/GeoscienceAustralia/interactive-maps/wiki/99,10],[169,-55),
            "mapType": "ArcGISCache",
            "visibility": true,
            "name": "Australian Topography 2014",
            "url": "http://www.ga.gov.au/gis/rest/services/topography/Australian_Topography_2014_WM/MapServer",
            "metadataText": "The Australian Topographic map service is seamless national dataset coverage for the whole of Australia. The map portrays detailed graphic representation of features that appear on the Earth's surface. These features include cultural, hydrography and relief themes. Features includes hillsides, vegetation, contours, built up areas, terrain, rivers, lakes, roads, rail, elevation and islands.",
            "ogcLinks": [
				{
                    "description": "Service Metadata",
                    "url": "http://www.ga.gov.au/metadata-gateway/metadata/record/gcat_37f8f652-5f7d-45e1-87c1-1e786e00fd1f/Australian+Topography+2014"
                }
            ],
			"queryFeatures": true,
            "queryUrl": "http://www.ga.gov.au/gis/services/topography/Australian_Topography_2014/MapServer/WMSServer",
            "queryUrlType": "WMS",
            "queryVersion": "1.1.1",
            "queryLayers": "Populated_Places_8,Locations_7,TOPO250K_Mine_Locations,Caves,Pinnacles,TOPO250K_Lighthouses,TOPO250K_Homesteads,TOPO250K_Building_Points,TOPO250K_Aircraft_Facilities,TOPO250K_Aircraft_Runways,Railway_Stops,Railway_Crossings,Railways_3,TOPO250K_Road_Crossings,TOPO250K_Roads,AusHydro_Flats_3,AusHydro_PondageAreas_2,AusHydro_ForeshoreFlats_2,AusHydro_Rivers_3,AusHydro_WatercourseAreas_2,AusHydro_Lakes_3,TOPO250K_Ferry_Routes,TOPO250K_Built_Up_Areas,TOPO250K_Reserves,TOPO250K_Prohibited_Areas,TOPO250K_Vertical_Obstructions,TOPO250K_Powerlines,TOPO250K_Framework_Boundaries,TOPO250K_Pipelines,TOPO250K_Mine_Areas,TOPO250K_Native_Vegetation,Cultivated_Areas",
            "opacity": 1,
            "layerTimeout": 5000
        }

slug - Friendly unique identifier for the layer
mapType - type of layer ArcGISCache, XYZTileCache, WMS..
visibility - boolean true or false, if the layer is visible by default always true for the master list
name - name of the layer for display purposes
url - URL for the service
metadataText - the description that will appear in the popup when a user clicks the metadata icon for the layer
ogcLinks - links that will appear at the bottom of the popup underneath the text to allow users to find out further information about the layer
queryUrl - URL to query this layer
queryUrlType - type of query WMS web map service, WFS for web feature service
queryVersion - version of the query type you wish to use
queryLayers - layers you wish to query inside the service
opacity - opacity of the layer, range of 0 to 1
layerTiemout - timeout period in seconds

Master tool list

The master tool list is used in the same way as the master layer list.

{
    "tools": [
        {
            "id": "addLayer",
            "toolPanelUrl": "resources/partial/addLayerPanel.html",
            "toolToggleUrl": "resources/partial/addLayerToggle.html",
            "config": {
                "titleText": "Add interactive map layers",
				"panelHeading": "Add interactive map layers"
            }
        }
     ]
}

id - unique identifier for the tool
toolPanelUrl - URL for the html for the panel on the right for this tool
toolToggleUrl - URL for the html for this tool, implements the gaAddLayerToggle directive config - inside the config object is where we define the specific parameters for that tool