This commit is contained in:
@@ -2,8 +2,6 @@
|
|||||||
@@@@@@@@@@@@@@@ ROADMAP STAGE 6 - "REALITY" All in on porting over all the real objects from v7
|
@@@@@@@@@@@@@@@ ROADMAP STAGE 6 - "REALITY" All in on porting over all the real objects from v7
|
||||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
TODO: .net 5 is out!
|
|
||||||
https://devblogs.microsoft.com/dotnet/announcing-net-5-0/?utm_source=dotnet-website&utm_medium=banner&utm_campaign=blog-banner
|
|
||||||
|
|
||||||
todo: Uifielddatatype Phone and TimeSpan support at client, translation keys etc
|
todo: Uifielddatatype Phone and TimeSpan support at client, translation keys etc
|
||||||
ay-customize.vue
|
ay-customize.vue
|
||||||
|
|||||||
@@ -540,17 +540,82 @@ export default {
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
viewGeoLocation: function(obj) {
|
viewGeoLocation: function(obj) {
|
||||||
if (!obj.latitude || !obj.longitude) {
|
//TODO: url escape parameters!!
|
||||||
throw new Error("View map: missing latitude or longitude, can't view");
|
//TODO: query by address
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
pointname: m.vm.obj.name,
|
||||||
|
latitude: m.vm.obj.latitude,
|
||||||
|
longitude: m.vm.obj.longitude,
|
||||||
|
address: m.vm.obj.address || m.vm.obj.postAddress,
|
||||||
|
city: m.vm.obj.city || m.vm.obj.postCity,
|
||||||
|
region: m.vm.obj.region || m.vm.obj.postRegion,
|
||||||
|
country: m.vm.obj.country || m.vm.obj.postCountry,
|
||||||
|
postCode: m.vm.obj.postCode
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
let hasGeo = obj.latitude || obj.longitude;
|
||||||
|
let hasAddress =
|
||||||
|
obj.address ||
|
||||||
|
obj.city ||
|
||||||
|
objectHash.region ||
|
||||||
|
obj.country ||
|
||||||
|
obj.postCode;
|
||||||
|
|
||||||
|
if (!hasGeo && !hasAddress) {
|
||||||
|
throw new Error(
|
||||||
|
"View map: missing address and latitude / longitude nothing to view"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
let mapUrl =
|
|
||||||
window.$gz.store.state.userOptions.mapUrlTemplate ||
|
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);
|
let geoMapUrl = null;
|
||||||
mapUrl = mapUrl.split("{aylongitude}").join(obj.longitude);
|
let addressMapUrl = null;
|
||||||
if (obj.pointname) {
|
|
||||||
mapUrl = mapUrl.split("{aypointname}").join(obj.pointname);
|
if (!mapUrl || mapUrl == "") {
|
||||||
|
//no preset map url, default to google, favor geo coordinates
|
||||||
|
if (obj.latitude && obj.longitude) {
|
||||||
|
geoMapUrl =
|
||||||
|
"https://www.google.com/maps/search/?api=1&query={aylatitude},{aylongitude}";
|
||||||
|
} else {
|
||||||
|
//default to address search
|
||||||
|
addressMapUrl =
|
||||||
|
"https://www.google.com/maps/search/?api=1&query={ayaddress}";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//we have a pre-set map url, parse it and split it and extract them
|
||||||
|
//favor first one if multiple supported map types
|
||||||
|
mapUrls = [mapUrl];
|
||||||
|
if (mapUrl.includes("<|>")) {
|
||||||
|
mapUrls = mapUrl.split("<|>");
|
||||||
|
}
|
||||||
|
|
||||||
|
mapUrls.array.forEach(z => {
|
||||||
|
if (!geoMapUrl && z.includes("{aylatitude}")) {
|
||||||
|
geoMapUrl = z;
|
||||||
|
}
|
||||||
|
if (!addressMapUrl && z.includes("{ayaddress}")) {
|
||||||
|
addressMapUrl = z;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//decide which map to use here, favor geocode
|
||||||
|
if (hasGeo && geoMapUrl) {
|
||||||
|
//geo view
|
||||||
|
mapUrl = mapUrl.split("{aylatitude}").join(obj.latitude);
|
||||||
|
mapUrl = mapUrl.split("{aylongitude}").join(obj.longitude);
|
||||||
|
if (obj.pointname) {
|
||||||
|
mapUrl = mapUrl.split("{aypointname}").join(obj.pointname);
|
||||||
|
}
|
||||||
|
} else if (hasAddress && addressMapUrl) {
|
||||||
|
} else {
|
||||||
|
throw new Error(
|
||||||
|
"View map: error - no matching mapurl / address / geo coordinates set for display, nothing to view"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (window.open(mapUrl, "map") == null) {
|
if (window.open(mapUrl, "map") == null) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Problem displaying map in new window. Browser must allow pop-ups to view maps; check your browser setting"
|
"Problem displaying map in new window. Browser must allow pop-ups to view maps; check your browser setting"
|
||||||
|
|||||||
@@ -937,7 +937,12 @@ async function clickHandler(menuItem) {
|
|||||||
window.$gz.util.viewGeoLocation({
|
window.$gz.util.viewGeoLocation({
|
||||||
pointname: m.vm.obj.name,
|
pointname: m.vm.obj.name,
|
||||||
latitude: m.vm.obj.latitude,
|
latitude: m.vm.obj.latitude,
|
||||||
longitude: m.vm.obj.longitude
|
longitude: m.vm.obj.longitude,
|
||||||
|
address: m.vm.obj.address || m.vm.obj.postAddress,
|
||||||
|
city: m.vm.obj.city || m.vm.obj.postCity,
|
||||||
|
region: m.vm.obj.region || m.vm.obj.postRegion,
|
||||||
|
country: m.vm.obj.country || m.vm.obj.postCountry,
|
||||||
|
postCode: m.vm.obj.postCode
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -177,12 +177,12 @@ export default {
|
|||||||
{
|
{
|
||||||
name: "Bing",
|
name: "Bing",
|
||||||
value:
|
value:
|
||||||
"https://bing.com/maps/default.aspx?cp={aylatitude}~{aylongitude}&lvl=17&style=r&sp=point.{aylatitude}_{aylongitude}_{aypointname}"
|
"https://bing.com/maps/default.aspx?where1={ayaddress}<|>https://bing.com/maps/default.aspx?cp={aylatitude}~{aylongitude}&lvl=17&style=r&sp=point.{aylatitude}_{aylongitude}_{aypointname}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Google",
|
name: "Google",
|
||||||
value:
|
value:
|
||||||
"https://www.google.com/maps/search/?api=1&query={aylatitude},{aylongitude}"
|
"https://www.google.com/maps/search/?api=1&query={ayaddress}<|>https://www.google.com/maps/search/?api=1&query={aylatitude},{aylongitude}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "MapQuest",
|
name: "MapQuest",
|
||||||
|
|||||||
Reference in New Issue
Block a user