Created
April 19, 2022 06:08
-
-
Save achingachris/be74873de340c2a0e8b903f82c94cac3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods: { | |
initMarker(loc) { | |
this.existingPlace = loc; | |
}, | |
addLocationMarker() { | |
if (this.existingPlace) { | |
const marker = { | |
lat: this.existingPlace.geometry.location.lat(), | |
lng: this.existingPlace.geometry.location.lng(), | |
}; | |
this.locationMarkers.push({ position: marker }); | |
this.locPlaces.push(this.existingPlace); | |
this.center = marker; | |
this.existingPlace = null; | |
} | |
}, | |
locateGeoLocation: function () { | |
navigator.geolocation.getCurrentPosition((res) => { | |
this.center = { | |
lat: res.coords.latitude, | |
lng: res.coords.longitude, | |
}; | |
}); | |
}, | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment