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"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -902,6 +902,12 @@ async function clickHandler(menuItem) {
|
||||
window.$gz.errorHandler.handleFormError(ex, m.vm);
|
||||
}
|
||||
|
||||
break;
|
||||
case "geoview":
|
||||
window.$gz.util.viewGeoLocation({
|
||||
latitude: m.vm.obj.latitude,
|
||||
longitude: m.vm.obj.longitude
|
||||
});
|
||||
break;
|
||||
default:
|
||||
window.$gz.eventBus.$emit(
|
||||
|
||||
@@ -365,6 +365,8 @@ export default {
|
||||
l.emailAddress = vm.obj.emailAddress;
|
||||
}
|
||||
|
||||
l.mapUrlTemplate = vm.obj.mapUrlTemplate;
|
||||
|
||||
window.$gz.store.commit("setUserOptions", l);
|
||||
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user