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

@@ -11,20 +11,13 @@ todo: Uifielddatatype Phone and TimeSpan support at client, translation keys etc
todo: input type email url phone number etc supported on device to activate?
if not, it must be supported somehow so figure it out
todo: latitude longitude
windows ayanova uses a special control to enter in degrees m seconds not decimal input?!
needs replacement decimal control or something else, can't use precision more than two decimal places
NOTE: check docs, maybe it's a setting on the existing control?
Ideally a coordinate specific input, check around
at least replicate windows ayanova if nothing else, check web interfaces to see what was done there
https://tutorialzine.com/2016/06/quick-tip-detecting-your-location-with-javascript
todo: map url template should be set in user options with click to set various but defaults to google
google maps
open street map
bing maps?
apple maps?
mapquest?
TODO: Make composite control for display and input
Use decimal degrees
lat above with title and long below with title
icon to grab current coordinates "map-marker-alt"
icon to view on a map with "map-marked-alt"
if a mapping url is defined
todo: After customer form is made

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"
]);
}