Skip to content

Instantly share code, notes, and snippets.

@Bviveksingh
Created October 30, 2019 17:34
locatePosition(){
this.map.locate({setView:true}).on("locationfound", (e: any)=> {
this.newMarker = marker([e.latitude,e.longitude], {draggable:
true}).addTo(this.map);
this.newMarker.bindPopup("You are located here!").openPopup();
this.newMarker.on("dragend", ()=> {
const position = this.newMarker.getLatLng();
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment