Mapbox-GL
Bernadette Elena Hammerle edited this page 3 years ago

react-mapbox-gl

Install

npm install react-mapbox-gl mapbox-gl

First Steps

Observations

  • coordinates of the markers from the other maps have to be switched
  • the doku says to use features with layers instead of markers for better performance
  • markers are not draggable, but features are

Markers or Features

Note: When rendering many objects, avoid using Markers as it will negatively affect performance. Use Layers and Features instead.

  • test with 100 Markers/Features:
    • when zoom on all 100 => all 100 features/markers are shown
    • when zooming out: not all features are rendered because they would be on top of each other => zooming is smooth, rendering is fast
    • but when zooming out on markers: react tries to render them all => zooming is loading several seconds, rendering takes also more time