Skip to content

Configuration details

Trevor Croxson edited this page Jun 30, 2017 · 12 revisions

Each Mapseed flavor contains a config.yml file that is used to configure application behavior. There are many configuration options, and this section of the wiki is intended to be a (work in progress) catalog of those options and how to use them.

Map configuration

...

Dynamic form configuration

...

Right-clinging sidebar configuration

...

Leaflet sidebar configuration

...

Layer style rules configuration

Layer style rules, found under the place_types section of the config, control how icons, polygons, and linestrings appear on the map. Style rules define conditions (such as a map zoom level) and associate style rules with those conditions.

Below is an example of a typical style rule. The top-level key, featured_place, is the name of the location_type to which the following rules apply:

featured_place:
    rules:
      - condition: 'this.layer.focused === true'
        icon:
          iconSize: [50, 50]
          iconAnchor: [25, 25]
      - condition: 'this.map.zoom < 15'
        icon:
          iconUrl: /static/css/images/markers/marker-construction-dot.png
          iconSize: [10, 10]
          iconAnchor: [0, 0]
      - condition: 'this.map.zoom <= 18'
        icon:
          iconUrl: /static/css/images/markers/marker-construction.png
          iconSize: [30, 30]
          iconAnchor: [15, 15]

Style rule configuration options

Property Description
condition A string containing a javascript expression which can be evaluated for true/false status. When writing style rule expressions, you can incorporate any of a model's properties using the this. syntax. Additionally, you can incorporate the map's current zoom level with this.map.zoom, and whether a given layer is currently focused by using this.layer.focused.
icon An object containing settings for the icon affiliated with Marker geometry. Any of an icon's properties can be set: iconUrl, iconSize, iconAnchor, shadowSize, and shadowAnchor. See here for full documentation.

Story mode configuration

The story section of the config.yml file configures the behavior of a flavor's story mode. You can control which points on your map appear in a story, which zoom level and centerpoint are used for individual story points, whether the spotlight overlay appears when visiting a story point, and so forth.

Below is an example of a typical story configuration, followed by an explanation of all options used:

story:
  budget-priorities:
    tagline: _(Next budget priority)
    default_zoom: 17
    default_basemap: satellite
    default_visible_layers:
      - 2015-budget-priorities
      - city-council-districts
    order: 
      - url: street-paving
        spotlight: false
        visible_layers:
          - streets
        basemap: dark
      - url: report/214
        zoom: 10
        panTo:
          lat: -122.24877834320068
          lng: 47.731328313742345
      - url: park-improvements
        spotlight: false
        sidebar_icon_url: /static/css/images/markers/map-pin-marker.png

Story configuration options

Property Description
tagline A string that appears in the story control bar at the bottom of a place detail view.
default_zoom A map zoom level that will be used for all story points unless a story point sets its own zoom level.
default_basemap The basemap that will be shown for all story points unless a story point sets its own basemap.
default_visible_layers An array of map layers that will be shown for all story points unless a story point sets its own array of visible layers.
order An array of urls and optional configuration details that defines the in-order content of a story.

Story item configuration options

NOTE: these options should appear in array entries under the order property, described above.

Property Description
url Required. The relative url of a story point.
spotlight Optional. A boolean value indicating whether or not to display the map spotlight overlay. Defaults to true.
visible_layers Optional. An array of layers that will be shown for this story point. Completely overrides default_visible_layers.
basemap Optional. The basemap that will be shown for this story point. Overrides default_basemap.
zoom Optional. The map zoom level that will be used for this story point. Overrides default_zoom.
panTo Optional. An object of lat and lng coordinates to use as the map centerpoint for this story item. Overrides the centerpoint of the underlying geometry.
sidebar_icon_url Optional. The path to an icon image to use for this story point in the sidebar. If not supplied, the sidebar icon used will be derived from the place section of the config.
Clone this wiki locally