This commit is contained in:
@@ -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"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user