Solvedreact mapbox gl Adding Markers to map

How would I go about adding markers to the map as described here? (https://www.mapbox.com/help/markers/) So far I can only see a way to add symbols, fills, circles, and lines. Is this functionality not included yet or am I just missing something?

18 Answers

✔️Accepted Answer

I'm trying the example on https://github.com/alex3165/react-mapbox-gl but the marker does not show for some reason. any idea alex?

import ReactMapboxGl, { Layer, Feature } from "react-mapbox-gl";
import React from "react";
class CrimeMap extends React.Component {
  render() {
    return (

      <div>
        <ReactMapboxGl
          style="mapbox://styles/mapbox/streets-v8"
          accessToken="my access token goes here"

          containerStyle={{
            height: "80vh",
            width: "100vw"
          }}>
            <Layer
              type="symbol"
              id="marker"
              layout={{ "icon-image": "marker-15" }}>
              <Feature coordinates={[-0.481747846041145, 51.3233379650232]}/>
            </Layer>
        </ReactMapboxGl>
      </div>
    )
  }
}

export default CrimeMap;

More Issues: