Skip to content

Commit

Permalink
set default map position
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4tim committed Feb 19, 2025
1 parent 62f2928 commit 9210b87
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ export default {
const zoom = this.$route.params.zoom || config.MAP.zoom;
this.store.setmapposition(lat, lng, zoom, true);
},
setPosDefault() {
this.store.setmapposition(
config.MAP.position.lat,
config.MAP.position.lng,
config.MAP.zoom,
true
);
},
setgeo(forse = false) {
return new Promise((resolve, reject) => {
Expand All @@ -187,6 +195,9 @@ export default {
} else if (localStorage.getItem("map-position") && !forse) {
this.getlocalmappos();
resolve("Geolocation is set from local data");
} else if (!forse) {
this.setPosDefault();
resolve("Geolocation is set default data");
} else {
navigator.geolocation.getCurrentPosition(
(position) => {
Expand Down

0 comments on commit 9210b87

Please sign in to comment.