This commit is contained in:
2020-11-12 22:14:09 +00:00
parent 3ee75abd1a
commit da91700fa1
4 changed files with 44 additions and 25 deletions

View File

@@ -490,16 +490,10 @@ export default {
///////////////////////////////////////////////
// Use geolocation api to attempt to get current location
// try high accuracy first and downgrade if unavailable
//
// function getCurrentLocation(options) {
// return new Promise((resolve, reject) => {
// navigator.geolocation.getCurrentPosition(resolve, ({code, message}) =>
// reject(Object.assign(new Error(message), {name: "PositionError", code})),
// options);
// });
// };
//https://www.openstreetmap.org/?mlat=48.3911&mlon=-124.7353#map=12/48.3910/-124.7353
//https://www.openstreetmap.org/#map=18/49.68155/-125.00435
//https://www.openstreetmap.org/?mlat=49.71236&mlon=-124.96961#map=17/49.71236/-124.96961
//https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393
getGeoLocation: async function() {
return new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(

View File

@@ -892,6 +892,7 @@ async function clickHandler(menuItem) {
break;
case "geocapture":
try {
window.$gz.form.deleteAllErrorBoxErrors(m.vm);
let loc = await window.$gz.util.getGeoLocation();
m.vm.obj.latitude = loc.latitude;
m.vm.fieldValueChanged("latitude");

View File

@@ -31,6 +31,23 @@
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
v-model="obj.mapUrlTemplate"
:readonly="formState.readOnly"
:label="$ay.t('MapUrlTemplate')"
:error-messages="form().serverErrors(this, 'mapUrlTemplate')"
ref="mapUrlTemplate"
@input="fieldValueChanged('mapUrlTemplate')"
data-cy="mapUrlTemplate"
></v-text-field>
<v-select
:items="selectLists.mapUrls"
item-text="name"
item-value="value"
></v-select>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
v-model="obj.currencyName"
@@ -150,7 +167,19 @@ export default {
return {
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
selectLists: {
translations: []
translations: [],
mapUrls: [
{
name: "Google",
value:
"https://www.google.com/maps/search/?api=1&query={aylatitude},{aylongitude}"
},
{
name: "Open Street Map",
value:
"https://www.openstreetmap.org/?mlat={aylatitude}&mlon={aylongitude}#map=17/{aylatitude}/{aylongitude}"
}
]
},
activeTranslationId: null,
darkMode: this.$store.state.darkMode,
@@ -167,6 +196,7 @@ export default {
id: 0,
concurrency: 0,
emailAddress: null,
mapUrlTemplate: null,
uiColor: null,
languageOverride: null,
timeZoneOverride: null,
@@ -440,7 +470,8 @@ async function fetchTranslatedText(vm) {
//"Hour12",
"UserColor",
"Translation",
"DarkMode"
"DarkMode",
"MapUrlTemplate"
]);
}