mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-18 15:54:22 +00:00
791 B
791 B
Marker Control
This is a React equivalent of Mapbox's Marker Control:
import ReactMap, {Marker} from 'react-map-gl';
export default MyMap = () => {
return (
<ReactMap latitude={-122.41} longitude={37.78} zoom={8}>
<Marker latitude={-122.41} longitude={37.78} offsetLeft={-20} offsetTop={-10}>
<div>You are here</div>
</Marker>
</ReactMap>
);
}
Properties
latitude (Number)
Latitude of the marker.
longitude (Number)
Longitude of the marker.
offsetLeft (Number, optional)
Offset of the marker from the left in pixels, negative number indicates left.
offsetTop (Number, optional)
Offset of the marker from the top in pixels, negative number indicates up.