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
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
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]);
},);