Moped Documentation
  • Welcome 👋
  • User Guides
    • Getting started
    • Map a project
  • Product Management
    • User communication
    • User management
    • User analytics
    • Local testing
    • Release process
    • Patch release process
    • MUI X Pro License
    • Integrations
      • Dataset documentation
      • ArcGIS Online
      • eCapris
      • Power BI
    • Features
  • Dev Guides
    • DB Docs & Data dictionary
    • Database backup policy
    • Moped Read Replica
    • How-to's
      • How do I start the Hasura cluster locally?
      • How do I launch the Hasura Console?
      • How do I get a JWT token?
      • How to ping the GraphQL API
      • How to ping the REST API
      • How do I connect a database with Postgres GUIs?
      • How do I connect to the RDS instance?
      • How to load production data into a local instance
      • How do I update seed data?
    • Hasura
      • Hasura Roles
      • Hasura Migrations
        • Getting Started
        • Installing the Hasura CLI
        • Configuration Files
        • Hasura Migration Principles
        • The Migration file format
        • Development
        • Hasura Seed Data
        • Running the Hasura Cluster Locally (video)
        • Create a migration: Exercise 1 (video)
        • Create a migration: Exercise 2 (video)
        • Latest hasura-cluster features
    • User Management
    • Authentication
      • Authentication Architecture
      • DynamoDB & Cognito
      • Secrets Manager & Cognito
      • Hasura & Cognito
      • React & Cognito
      • Flask API & Cognito
      • Single Sign-On with CTM
    • Code organization
    • API
      • Configuration Files
      • Testing
      • User Management API
    • Maps and geospatial data
      • Access tokens and API keys
      • Map libraries
      • Map data
      • Map styles
      • Map layers and basemaps
      • React patterns
      • V1 Archive
        • Map libraries
        • Map data
        • Map custom hooks
        • Map styles
        • Map layers and basemaps
    • UI access control
    • Design system
      • Branding
      • Component styles
      • Text content
    • Activity Log
      • Architecture
      • GitHub Actions and Deployment of Updates
      • Hasura Event Logs and Truncate Cron Job
      • Authentication
  • See also
  • Get Moped support, report a bug, or request an enhancement
  • Data & Technology Services
  • Github repository
Powered by GitBook
On this page
  • Sources, Layers, and Source Types
  • Vector tile layers
  • Vector tile layer level of detail
  • GeoJSON layers
  • Base Maps
  • Default basemap
  • Aerial Imagery basemap

Was this helpful?

  1. Dev Guides
  2. Maps and geospatial data
  3. V1 Archive

Map layers and basemaps

Layers and basemaps that make up the project summary and project edit maps

PreviousMap stylesNextUI access control

Last updated 4 years ago

Was this helpful?

Sources, Layers, and Source Types

The two layer in Moped are vector tile layers and GeoJSON layers. The pattern for adding a source and layer to a react-map-gl map is to use the and components. These two components are abstraction of Mapbox GL and . The Source component is responsible for the data and the Layer component is used to style the data of the source. An example of JSX for a vector tile layer is below.

<Source
  key={config.layerIdName}
  type="vector"
  tiles={[config.layerUrl]
>
  <Layer
    key={config.layerIdName}
    {...theOtherlayerProps}
  />
</Source>

Vector tile layers are used to display streets and points that a user can interact with to add and remove GeoJSON features associated with a project. These vector tile layers are maintained in ArcGIS Online (AGOL).

GeoJSON layers are generated from user input like those stored from the drawing UI exposed by the useMapDrawTools custom hook.

A good way to differentiate source types in the code is to look for whether a layerUrl is set in the layerConfigs of the mapConfig object. A vector tile layer source requires a url in order to present features to a user. A GeoJSON layer source will use GeoJSON data stored in the Moped database.

Vector tile layers

The two vector tile layers used in Moped are for street lines and intersection points. They are located at the following ArcGIS endpoints:

{
  id: <some layer id string>,
  type: <a rendering type>,
  source: {
    type: "vector",
    tiles: <vector tile layer endpoint>,
  },
  "source-layer": <source layer name from the endpoint>,
  paint: {
    "fill-color": <a color or further logic using Mapbox spec>
  },
}

ArcGIS vector tile layer metadata and tiles links user the following patterns (using the CTN layer as an example).

Vector tile layer level of detail

If this data is not passed, it can lead to issue with rendering and capturing geometries with Mapbox GL. Here is one example where lines were split along the vector tiles beyond a certain level of zoom.

GeoJSON layers

Base Maps

Default basemap

Aerial Imagery basemap

{
  version: 8,
  sources: {
  "raster-tiles": {
      type: "raster",
      tiles: [
        `https://api.nearmap.com/tiles/v3/Vert/{z}/{x}/{y}.jpg?apikey=${NEARMAP_KEY}`,
      ],
      tileSize: 256,
    },
  },
  layers: [
    {
      id: "simple-tiles",
      type: "raster",
      source: "raster-tiles",
      minzoom: 0,
      maxzoom: 22,
    },
  ],
}

Streets

Points

To add vector tile layers sourced from ArcGIS or other endpoints, the layer can be added by using the and adding source and source-layer keys and values to the spec as shown below. This object defines props that are passed to the component from react-map-gl.

Note that the geometry (circle, line, etc.) in a vector layer determines the style properties from the Mapbox spec that are required to customize the layer.

Vector tile .pbf endpoint (used to render tiles on map)

Vector tile styles metadata (helpful for finding the source layer name and type of geometry in layer)

Vector tile server metadata

When adding a vector tile layer, it is important to consider the maxLOD of the vector tile layer that is shown in the server metadata (see example link above) and pass that value as the along with the endpoint. A good example of this in a react-map-gl component can be found in .

Layers that are created from user input (like drawn points) require a source with geojson and, in Moped, the geojson is formatted as a GeoJSON feature collection.

In Moped, the default basemap style is and the streets layer for the in react-map-gl is mapbox://styles/mapbox/light-v8.

To add aerial imagery, a Nearmap layer is added as a raster tile set. Nearmap access and the API key is managed by CTM and can be inquired about through the . The API key is stored in the DTS 1Password Developers vault and is titled Moped Nearmap API Key.

The aerial basemap is added by providing a raster tile configuration that uses the Nearmap API endpoint along with the API key to provide aerial tiles. A sample configuration is shown below. A Mapbox example of using a custom tile set is . This configuration is passed to the of a react-map-gl map much like the default streets basemap above. This time, an object is passed instead of the string source of a Mapbox style.

source types
Source
Layer
sources
layers
https://tiles.arcgis.com/tiles/0L95CJ0VTaxqcmED/arcgis/rest/services/CTN_Project_Extent_Vector_Tiles_with_Street_Name/VectorTileServer
https://tiles.arcgis.com/tiles/0L95CJ0VTaxqcmED/arcgis/rest/services/MOPED_intersection_points/VectorTileServer
Mapbox Layer Style Spec
Layer
type
https://tiles.arcgis.com/tiles/0L95CJ0VTaxqcmED/arcgis/rest/services/CTN_Project_Extent_Vector_Tiles_with_Street_Name/VectorTileServer/tile/{z}/{y}/{x}.pbf
https://tiles.arcgis.com/tiles/0L95CJ0VTaxqcmED/arcgis/rest/services/CTN_Project_Extent_Vector_Tiles_with_Street_Name/VectorTileServer/resources/styles/root.json?f=pjson
https://tiles.arcgis.com/tiles/0L95CJ0VTaxqcmED/arcgis/rest/services/CTN_Project_Extent_Vector_Tiles_with_Street_Name/VectorTileServer
maxzoom of the Mapbox source
the NewProjectMap component in Moped
type
Mapbox Light
mapStyle prop
COA ServiceNow Portal
here
mapStyle prop
Issue with rendering lines from the CTN layer