1

Can anybody write some code to get input(coordinates) from user to show as marker on map and continue adding markers with new lat,long and option to delete marker too. Please.

I have written this code : enter image description here

1 Answers1

1

This code should works, let me know if not.

const [position,setPosition] = useState([]);

const getLocation = () => {
        navigator.geolocation.getCurrentPosition(function(pos) {
            setPosition([pos.coords.latitude,pos.coords.longitude]);
        },);
ddecrulle
  • 51
  • 1
  • 6