This commit is contained in:
2020-11-12 22:44:25 +00:00
parent a8fc8f4cbf
commit 0084036334
3 changed files with 27 additions and 0 deletions

View File

@@ -534,6 +534,25 @@ export default {
{ maximumAge: 600000, timeout: 5000, enableHighAccuracy: true }
);
});
},
///////////////////////////////////////////////
// Open map url
//
//
viewGeoLocation: function(obj) {
if (!obj.latitude || !obj.longitude) {
throw new Error("View map: missing latitude or longitude, can't view");
}
let mapUrl =
window.$gz.store.state.userOptions.mapUrlTemplate ||
"https://www.google.com/maps/search/?api=1&query={aylatitude},{aylongitude}";
mapUrl = mapUrl.split("{aylatitude}").join(obj.latitude);
mapUrl = mapUrl.split("{aylongitude}").join(obj.longitude);
if (window.open(mapUrl, "map") == null) {
throw new Error(
"Problem displaying map in new window. Browser must allow pop-ups to view maps; check your browser setting"
);
}
}
/**