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
  • GeoJSON layers
  • Base Maps
  • Default basemap
  • Aerial Imagery basemap

Was this helpful?

  1. Dev Guides
  2. Maps and geospatial data

Map layers and basemaps

Layers and base maps that make up the project summary map and project components map

PreviousMap stylesNextReact patterns

Last updated 2 years ago

Was this helpful?

Sources, Layers, and Source Types

The main layer in Moped is GeoJSON. 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="geojson"
  data={theGeojsonData}
>
  <Layer
    key={config.layerIdName}
    {...theOtherlayerProps}
  />
</Source>

GeoJSON layers

Layers that are created from user input (like selecting from the CTN segments or intersection layer or drawing lines or points) require a source with geojson and, in Moped, the geojson is formatted as a GeoJSON feature collection.

The CTN segments and intersection points are also populated with GeoJSON data queried from AGOL feature servers called and .

Base Maps

Default basemap

Aerial Imagery basemap

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

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

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 type
Source
Layer
sources
layers
type
CTN segments FeatureServer
COA Intersection points FeatureServer
Mapbox Light
mapStyle prop
COA ServiceNow Portal
here
mapStyle prop