import React, { useRef, useEffect } from 'react' import { Map } from '../../' import maplibregl from 'maplibre-gl' import MapboxDraw from "@mapbox/mapbox-gl-draw"; import mapTheme from '../pbMapTheme' const MapWithPlugin = (props) => { //set Map instance to access from outside useEffect const mapContainerRef = useRef(null) //Set default position const defaultPosition = [-75.379143, 39.831200] //This function should contain all maplibre related code const loadMap = ( { target: map }) => { //set marker/pin /* eslint-disable-next-line */ const marker = new maplibregl.Marker({ color: mapTheme.marker, }).setLngLat(defaultPosition) .setPopup(new maplibregl.Popup({className: 'map_popup', closeButton: false}).setHTML(`