This component wraps a MapLibre Marker object. He manages its life cycle and is
responsible for adding/removing it to the map. For this reason this component
must be a descendant of RMap.
To use this component you will need to add an additional stylesheet.
Usage
If you use a custom marker element don't forgot to memoize the component.
Reactivity
All his props are reactive, feel free to express your creativity !
Draggable reactivity component
If your marker component is draggable, you need to register a handler for the dragend or drag event
to update the state. See RMarker documentation for the detail
of implementation.
Icon / Text content
RGradientMarker can contain icon or text content. If you use any font icon kit (fontello, fontawesome,
etc...), just specify the className and it will be wrapped inside a <i className={icon} /> element.
Otherwise, you need to specify a factory function who generate your HTMLElement or SVGSVGElement.
RGradientMarker is a React wrapper of a GradientMarker class who extends Marker from MapLibre. When the marker is added to the map it is integrated into a DOM node which is not managed
by React. This is why the generated element must be a DOM element and not a JSX.Element.
Reference
RGradientMarker extends RMarker, he therefore shares many of his options and has new ones. Check the MapLibre MarkerOptions reference page for details of MarkerInitialOptions and MarkerReactiveOptions.
However, for compatibility reasons, some options from MarkerOptions are not
available : element, anchor, offset.