Skip to content

Kittyhawkio/map-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aloft Map Demo

An example of how to use Aloft's map layers in a React application

Demo App

Setup

  1. Open this project in CodeSandbox here.
  2. Fork the repository if you'd like to save your changes in your CodeSandbox account.
  3. Enter your Aloft API Token and your Mapbox Token when prompted.

App Features

Adjust map settings

###Adjust layer settings

Code Explanation

MainContainer.js controls the display of the main components, as well as loading the map layers and sources from the Aloft API.

SetupDialog.js configures the app with the required access tokens by setting them in localStorage

Map.js initiates an instance of react-mapbox-gl. This includes the important transformRequest property used to pass the Aloft API token to load the map sources.

MapContainer.js renders Map.js along with components from react-mapbox-gl to display a map with sources and layers. It also displays a Popup component when the user clicks a feature on the map.

RightPanelContainer.js renders the controls that allow the user to change properties on the map and its layers.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published