All Projects → visgl → React Map Gl

visgl / React Map Gl

Licence: other
React friendly API wrapper around MapboxGL JS

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to React Map Gl

React Map Gl
React Component Library for Mapbox GL JS
Stars: ✭ 298 (-95.23%)
Mutual labels:  webgl, mapbox-gl, mapbox-gl-js, data-visualization, map
angular-mapboxgl-directive
AngularJS directive for Mapbox GL
Stars: ✭ 43 (-99.31%)
Mutual labels:  map, webgl, mapbox-gl, mapbox-gl-js
Mapbox Gl Js
Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
Stars: ✭ 8,017 (+28.4%)
Mutual labels:  webgl, mapbox-gl, mapbox-gl-js, map
deck.gl-time-series-widget
A React Time Slider implementation for DECK.GL - (non)temporal data - by CPU filtering ⌛
Stars: ✭ 19 (-99.7%)
Mutual labels:  uber, mapbox-gl, mapbox-gl-js
React Mapbox Gl
A React binding of mapbox-gl-js
Stars: ✭ 1,683 (-73.05%)
Mutual labels:  mapbox-gl, mapbox-gl-js, map
L7
🌎 Large-scale WebGL-powered Geospatial Data Visualization analysis framework which relies on Mapbox GL or AMap to render basemaps.
Stars: ✭ 2,517 (-59.69%)
Mutual labels:  webgl, data-visualization, map
Deck.gl
WebGL2 powered visualization framework
Stars: ✭ 9,304 (+49.01%)
Mutual labels:  uber, webgl, data-visualization
Luma.gl
High-performance Toolkit for WebGL-based Data Visualization
Stars: ✭ 1,928 (-69.12%)
Mutual labels:  uber, webgl, data-visualization
react-map-gl-cluster
Urbica React Cluster Component for Mapbox GL JS
Stars: ✭ 27 (-99.57%)
Mutual labels:  map, mapbox-gl, mapbox-gl-js
Glmaps
Data visualization examples and tutorials from scratch. 数据可视化示例代码集与新手学习教程。
Stars: ✭ 288 (-95.39%)
Mutual labels:  webgl, data-visualization
Mapdeck
R interface to Deck.gl and Mapbox
Stars: ✭ 296 (-95.26%)
Mutual labels:  mapbox-gl, mapbox-gl-js
Pix Plot
A WebGL viewer for UMAP or TSNE-clustered images
Stars: ✭ 306 (-95.1%)
Mutual labels:  webgl, data-visualization
Three Globe
WebGL Globe Data Visualization as a ThreeJS reusable 3D object
Stars: ✭ 270 (-95.68%)
Mutual labels:  webgl, data-visualization
React Vis Force
d3-force graphs as React Components.
Stars: ✭ 372 (-94.04%)
Mutual labels:  uber, data-visualization
nycbikemap
A web-based, unified, interactive bike map for NYC that combines information from NYC OpenData, Citi Bike and other sources.
Stars: ✭ 15 (-99.76%)
Mutual labels:  map, mapbox-gl-js
Troika
A JavaScript framework for interactive 3D and 2D visualizations
Stars: ✭ 342 (-94.52%)
Mutual labels:  webgl, data-visualization
react-mapboxgl
Declarative React components for mapbox-gl-js.
Stars: ✭ 15 (-99.76%)
Mutual labels:  mapbox-gl, mapbox-gl-js
Nyc Buildings
An interactive 3D visualization of the all the buildings in Manhattan.
Stars: ✭ 338 (-94.59%)
Mutual labels:  webgl, data-visualization
Nebula.gl
A suite of 3D-enabled data editing overlays, suitable for deck.gl
Stars: ✭ 382 (-93.88%)
Mutual labels:  uber, webgl
Martin
Blazing fast and lightweight PostGIS vector tiles server
Stars: ✭ 540 (-91.35%)
Mutual labels:  mapbox-gl, mapbox-gl-js

version build downloads

react-map-gl | Docs

react-map-gl is a suite of React components designed to provide a React API for Mapbox GL JS-compatible libraries. More information in the online documentation.

See our Design Philosophy.

Installation

Using react-map-gl requires react >= 16.3.

npm install --save react-map-gl

Example

import * as React from 'react';
import ReactMapGL from 'react-map-gl';

function Map() {
  const [viewport, setViewport] = React.useState({
    latitude: 37.7577,
    longitude: -122.4376,
    zoom: 8
  });

  return (
    <ReactMapGL
      {...viewport}
      width="100%"
      height="100%"
      onViewportChange={(viewport) => setViewport(viewport)}
    />
  );
}

Using Mapbox Tokens

Starting with v2.0, mapbox-gl requires a Mapbox token for any usage, with or without the Mapbox data service. See about Mapbox tokens for your options.

To show maps from a service such as Mapbox you will need to register on their website in order to retrieve an access token required by the map component, which will be used to identify you and start serving up map tiles. The service will be free until a certain level of traffic is exceeded.

There are several ways to provide a token to your app, as showcased in some of the example folders:

  • Provide a mapboxApiAccessToken prop to the map component
  • Set the MapboxAccessToken environment variable (or set REACT_APP_MAPBOX_ACCESS_TOKEN if you are using Create React App)
  • Provide it in the URL, e.g ?access_token=TOKEN
  • Provide mapboxApiUrl prop to the map component to override the default mapbox API URL

But we would recommend using something like dotenv and put your key in an untracked .env file, that will then expose it as a process.env variable, with much less leaking risks.

Limitations

This library provides convenient wrappers around initializing and (to some degree) tracking the state of a Mapbox WebGL map. Because most of the functionality of Mapbox's JS API depends on the use of HTML5 canvases and WebGL, which React is not built to manipulate, the React component does not mirror all the functionality of Mapbox GL JS's Map class. You may access the native Mapbox API exposed by the getMap() function in this library. However, proceed with caution as calling the native APIs may break the connection between the React layer props and the underlying map state.

Examples of replacing common native API calls with their React equivalents can be found on the FAQ page.

Contribute

See contribution guide.

Attributions

react-map-gl is part of vis.gl, an Urban Computing Foundation project.

Development is also supported by

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].