react-leaflet#MarkerProps TypeScript Examples

The following examples show how to use react-leaflet#MarkerProps. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BullseyeMarker.tsx    From project-tauntaun with GNU Lesser General Public License v3.0 6 votes vote down vote up
export function BullseyeMarkerNonMemo(props: MarkerProps) {
  const icon = new Icon({
    iconUrl: 'bullseye.png',
    iconSize: [40, 40],
    iconAnchor: [20, 20]
  });

  return <Marker {...omit(props, 'onadd', 'icon')} icon={icon} />;
}
Example #2
Source File: BullseyeMarker.tsx    From project-tauntaun with GNU Lesser General Public License v3.0 5 votes vote down vote up
export function BullseyeMarker(props: MarkerProps) {
  const { draggable } = props;
  const position = props.position as LatLng;

  const memorizedItem = useMemo(() => <BullseyeMarkerNonMemo {...props} />, [position.lat, position.lng, draggable]);

  return memorizedItem;
}