Merge branch 'feat/geolocation_allow_to_change_providers' into 'master'
Allow to change providers of geocoding and tilelayer services See merge request les/gancio!21
This commit is contained in:
@@ -50,8 +50,8 @@ export default {
|
||||
data ({ $store }) {
|
||||
return {
|
||||
mdiWalk, mdiBike, mdiCar, mdiMapMarker,
|
||||
url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
attribution: '<a target="_blank" href="http://osm.org/copyright">OpenStreetMap</a> contributors',
|
||||
url: $store.state.settings.tilelayer_provider || 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
attribution: $store.state.settings.tilelayer_provider_attribution || "<a target=\"_blank\" href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors",
|
||||
zoom: 14,
|
||||
center: [this.event.place.latitude, this.event.place.longitude],
|
||||
marker: {
|
||||
|
||||
@@ -46,7 +46,7 @@ v-row.mb-4
|
||||
:items="addressList"
|
||||
:hint="$t('event.address_description' + (settings.allow_geolocation && '_osm'))")
|
||||
template(v-slot:message="{message, key}")
|
||||
span(v-html='message' :key="key")
|
||||
span(v-html='message' :key="key")
|
||||
template(v-slot:item="{ item, attrs, on }")
|
||||
v-list-item(v-bind='attrs' v-on='on')
|
||||
v-icon.pr-4(v-text='loadCoordinatesResultIcon(item)')
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
props: {
|
||||
value: { type: Object, default: () => ({}) }
|
||||
},
|
||||
data () {
|
||||
data ( {$store} ) {
|
||||
return {
|
||||
mdiMap, mdiMapMarker, mdiPlus, mdiMapSearch, mdiLatitude, mdiLongitude, mdiRoadVariant, mdiHome, mdiCityVariant,
|
||||
place: { },
|
||||
@@ -91,7 +91,14 @@ export default {
|
||||
node: mdiMapMarker,
|
||||
relation: mdiCityVariant,
|
||||
},
|
||||
nominatim_class: ['amenity', 'shop', 'tourism', 'leisure', 'building']
|
||||
nominatim_class: ['amenity', 'shop', 'tourism', 'leisure', 'building'],
|
||||
photon_osm_key: ['amenity', 'shop', 'tourism', 'leisure', 'building'],
|
||||
photon_osm_type: {
|
||||
'W': mdiRoadVariant,
|
||||
'N': mdiMapMarker,
|
||||
'R': mdiCityVariant,
|
||||
},
|
||||
geocoding_provider_type: $store.state.settings.geocoding_provider_type || 'Nominatim'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -126,10 +133,17 @@ export default {
|
||||
}
|
||||
}, 100),
|
||||
loadCoordinatesResultIcon(item) {
|
||||
if ( this.nominatim_class.includes(item.class)) {
|
||||
return this.mdiHome
|
||||
if (this.geocoding_provider_type == "Nominatim") {
|
||||
if ( this.nominatim_class.includes(item.class)) {
|
||||
return this.mdiHome
|
||||
}
|
||||
return this.nominatim_osm_type[item.type]
|
||||
} else if (this.geocoding_provider_type == "Photon") {
|
||||
if ( this.photon_osm_key.includes(item.class)) {
|
||||
return this.mdiHome
|
||||
}
|
||||
return this.photon_osm_type[item.type]
|
||||
}
|
||||
return this.nominatim_osm_type[item.type]
|
||||
},
|
||||
selectPlace (p) {
|
||||
if (!p) { return }
|
||||
@@ -220,22 +234,55 @@ export default {
|
||||
|
||||
if (searchCoordinates.length) {
|
||||
this.loading = true
|
||||
const ret = await this.$axios.$get(`placeNominatim/${searchCoordinates}`)
|
||||
if (ret && ret.length) {
|
||||
this.addressList = ret.map(v => {
|
||||
const name = get(v.namedetails, 'alt_name', get(v.namedetails, 'name'))
|
||||
const address = v.display_name ? v.display_name.replace(name, '').replace(/^, ?/, '') : ''
|
||||
return {
|
||||
class: v.class,
|
||||
type: v.osm_type,
|
||||
lat: v.lat,
|
||||
lon: v.lon,
|
||||
name,
|
||||
address
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.addressList = []
|
||||
const ret = await this.$axios.$get(`placeOSM/${this.geocoding_provider_type}/${searchCoordinates}`)
|
||||
if (this.geocoding_provider_type == "Nominatim") {
|
||||
if (ret && ret.length) {
|
||||
this.addressList = ret.map(v => {
|
||||
const name = get(v.namedetails, 'alt_name', get(v.namedetails, 'name'))
|
||||
const address = v.display_name ? v.display_name.replace(name, '').replace(/^, ?/, '') : ''
|
||||
return {
|
||||
class: v.class,
|
||||
type: v.osm_type,
|
||||
lat: v.lat,
|
||||
lon: v.lon,
|
||||
name,
|
||||
address
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.addressList = []
|
||||
}
|
||||
} else if (this.geocoding_provider_type == "Photon") {
|
||||
let photon_properties = ['housenumber', 'street', 'district', 'city', 'county', 'state', 'postcode', 'country']
|
||||
|
||||
if (ret) {
|
||||
this.addressList = ret.features.map(v => {
|
||||
let pre_name = v.properties.name || v.properties.street || ''
|
||||
let pre_address = ''
|
||||
|
||||
photon_properties.forEach((item, i) => {
|
||||
let last = i == (photon_properties.length - 1)
|
||||
if (v.properties[item] && !last) {
|
||||
pre_address += v.properties[item]+', '
|
||||
} else if (v.properties[item]) {
|
||||
pre_address += v.properties[item]
|
||||
}
|
||||
});
|
||||
|
||||
let name = pre_name
|
||||
let address = pre_address
|
||||
return {
|
||||
class: v.properties.osm_key,
|
||||
type: v.properties.osm_type,
|
||||
lat: v.geometry.coordinates[1],
|
||||
lon: v.geometry.coordinates[0],
|
||||
name,
|
||||
address
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.addressList = []
|
||||
}
|
||||
}
|
||||
this.loading = false
|
||||
}
|
||||
|
||||
169
components/admin/Geolocation.vue
Normal file
169
components/admin/Geolocation.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<template lang="pug">
|
||||
v-card
|
||||
v-card-title {{$t('admin.geolocation')}}
|
||||
v-card-text
|
||||
p.mb-6(v-html="$t('admin.geolocation_description')")
|
||||
|
||||
v-form
|
||||
v-row
|
||||
v-col(md=3)
|
||||
v-autocomplete.mb-4(v-model='geocoding_provider_type'
|
||||
@blur="save('geocoding_provider_type', geocoding_provider_type )"
|
||||
:label="$t('admin.geocoding_provider_type')"
|
||||
:hint="$t('admin.geocoding_provider_type_help')"
|
||||
persistent-hint
|
||||
:items="geocoding_provider_type_items"
|
||||
:placeholder="geocoding_provider_type_default")
|
||||
|
||||
v-col(md=5)
|
||||
v-text-field.mb-4(v-model='geocoding_provider'
|
||||
@blur="save('geocoding_provider', geocoding_provider )"
|
||||
:label="$t('admin.geocoding_provider')"
|
||||
:hint="$t('admin.geocoding_provider_help')"
|
||||
persistent-hint
|
||||
:placeholder="geocoding_provider_default")
|
||||
|
||||
v-col(md=4)
|
||||
v-autocomplete.mb-6(v-model="geocoding_countrycodes" :disabled="!(geocoding_provider_type === null || geocoding_provider_type === 'Nominatim')"
|
||||
:append-icon='mdiChevronDown'
|
||||
@blur="save('geocoding_countrycodes', geocoding_countrycodes )"
|
||||
:label="$t('admin.geocoding_countrycodes')"
|
||||
:items="countries"
|
||||
multiple chips small-chips persistent-hint
|
||||
item-value="code"
|
||||
item-text="name"
|
||||
:hint="$t('admin.geocoding_countrycodes_help')")
|
||||
|
||||
v-row
|
||||
v-col(md=6)
|
||||
v-text-field.mb-4(v-model='tilelayer_provider'
|
||||
@blur="save('tilelayer_provider', tilelayer_provider )"
|
||||
:label="$t('admin.tilelayer_provider')"
|
||||
:hint="$t('admin.tilelayer_provider_help')"
|
||||
persistent-hint
|
||||
:placeholder="tilelayer_provider_default")
|
||||
|
||||
v-col(md=6)
|
||||
v-text-field(v-model='tilelayer_provider_attribution'
|
||||
@blur="save('tilelayer_provider_attribution', tilelayer_provider_attribution )"
|
||||
:label="$t('admin.tilelayer_provider_attribution')"
|
||||
:placeholder="tilelayer_provider_attribution_default")
|
||||
|
||||
div(id="leaflet-map-preview" max-height='10px')
|
||||
//- Map
|
||||
|
||||
v-card-actions
|
||||
v-spacer
|
||||
v-btn(color='primary' @click='testGeocodingProvider' :loading='testGeocodingLoading' outlined ) {{$t('admin.geocoding_test_button')}}
|
||||
v-btn(color='primary' @click='testTileLayerProvider' :loading='testTileLayerLoading' outlined ) {{$t('admin.tilelayer_test_button')}}
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import { mapActions, mapState } from 'vuex'
|
||||
import { isoCountries } from '../../server/helpers/geolocation'
|
||||
import { mdiChevronDown } from '@mdi/js'
|
||||
// import Map from '~/components/Map'
|
||||
import "leaflet/dist/leaflet.css"
|
||||
|
||||
export default {
|
||||
props: {
|
||||
setup: { type: Boolean, default: false }
|
||||
},
|
||||
// components: { Map },
|
||||
data ({ $store }) {
|
||||
return {
|
||||
mdiChevronDown,
|
||||
loading: false,
|
||||
testGeocodingLoading: false,
|
||||
testTileLayerLoading: false,
|
||||
geocoding_provider_type_items: ['Nominatim', 'Photon'],
|
||||
geocoding_provider_type: $store.state.settings.geocoding_provider_type || '',
|
||||
geocoding_provider_type_default: 'Nominatim',
|
||||
geocoding_provider: $store.state.settings.geocoding_provider || '',
|
||||
geocoding_provider_default: "https://nominatim.openstreetmap.org/search" ,
|
||||
geocoding_countrycodes: $store.state.settings.geocoding_countrycodes || [],
|
||||
tilelayer_provider: $store.state.settings.tilelayer_provider || '',
|
||||
tilelayer_provider_default: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
tilelayer_provider_attribution: $store.state.settings.tilelayer_provider_attribution || '',
|
||||
tilelayer_provider_attribution_default: '<a target=\'_blank\' href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors',
|
||||
countries: isoCountries,
|
||||
mapPreviewTest: null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (process.client) {
|
||||
const L = require('leaflet')
|
||||
}
|
||||
},
|
||||
computed: mapState(['settings', 'events']),
|
||||
methods: {
|
||||
...mapActions(['setSetting']),
|
||||
async testGeocodingProvider () {
|
||||
this.testGeocodingLoading = true
|
||||
const geocodingProviderTest = this.geocoding_provider || this.geocoding_provider_default
|
||||
const geocodingSoftwareTest = this.geocoding_provider_type || this.geocoding_provider_type_default
|
||||
const geocodingQuery = 'building'
|
||||
|
||||
try {
|
||||
if (geocodingSoftwareTest === 'Nominatim') {
|
||||
const geolocation = await this.$axios.$get(`${geocodingProviderTest}`, {timeout: 3000, params: {q: `${geocodingQuery}`, format: 'json', limit: 1 }} )
|
||||
} else if (geocodingSoftwareTest === 'Photon') {
|
||||
const geolocation = await this.$axios.$get(`${geocodingProviderTest}`, {timeout: 3000, params: {q: `${geocodingQuery}`, limit: 1}} )
|
||||
}
|
||||
|
||||
this.$root.$message(this.$t('admin.geocoding_test_success', { service_name: geocodingProviderTest }), { color: 'success' })
|
||||
} catch (e) {
|
||||
this.$root.$message(this.$t('admin.tilelayer_test_error', { service_name: geocodingProviderTest }), { color: 'error' })
|
||||
}
|
||||
this.testGeocodingLoading = false
|
||||
},
|
||||
async testTileLayerProvider () {
|
||||
this.testTileLayerLoading = true
|
||||
const tileThis = this
|
||||
const tileLayerTest = this.tilelayer_provider || this.tilelayer_provider_default
|
||||
const tileLayerAttributionTest = this.tilelayer_provider_attribution || this.tilelayer_provider_attribution_default
|
||||
|
||||
// init tilelayer
|
||||
if (this.mapPreviewTest == null) {
|
||||
this.mapPreviewTest = L.map("leaflet-map-preview").setView([40,40],10);
|
||||
}
|
||||
this.tileLayer = L.tileLayer(`${tileLayerTest}`, {attribution: `${tileLayerAttributionTest}`})
|
||||
this.tileLayer.addTo(this.mapPreviewTest)
|
||||
|
||||
// tilelayer events inherited from gridlayer https://leafletjs.com/reference.html#gridlayer
|
||||
this.tileLayer.on('tileload', function (event) {
|
||||
tileThis.tileLayerTestSucess(event, tileLayerTest)
|
||||
});
|
||||
this.tileLayer.on('tileerror', function(error, tile) {
|
||||
tileThis.tileLayerTestError(event, tileLayerTest)
|
||||
tileThis.tileLayer = null
|
||||
});
|
||||
this.testTileLayerLoading = false
|
||||
},
|
||||
save (key, value) {
|
||||
if (this.settings[key] !== value) {
|
||||
this.setSetting({ key, value })
|
||||
}
|
||||
},
|
||||
done () {
|
||||
this.$emit('close')
|
||||
},
|
||||
geocodingTestError(event, tileLayerTest) {
|
||||
this.$root.$message(this.$t('admin.geocoding_test_error', { service_name: geocodingTest }), { color: 'error' })
|
||||
},
|
||||
tileLayerTestSucess(event, tileLayerTest) {
|
||||
this.$root.$message(this.$t('admin.tilelayer_test_success', { service_name: tileLayerTest }), { color: 'success' })
|
||||
},
|
||||
tileLayerTestError(event, tileLayerTest) {
|
||||
this.$root.$message(this.$t('admin.tilelayer_test_error', { service_name: tileLayerTest }), { color: 'error' })
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#leaflet-map-preview {
|
||||
height: 20rem;
|
||||
}
|
||||
</style>
|
||||
@@ -68,7 +68,7 @@ import debounce from 'lodash/debounce'
|
||||
import get from 'lodash/get'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
data( {$store} ) {
|
||||
return {
|
||||
mdiPencil, mdiChevronRight, mdiChevronLeft, mdiMagnify, mdiEye, mdiMapSearch, mdiChevronDown,
|
||||
loading: false,
|
||||
@@ -84,7 +84,8 @@ export default {
|
||||
{ value: 'address', text: this.$t('common.address') },
|
||||
{ value: 'map', text: 'Map' },
|
||||
{ value: 'actions', text: this.$t('common.actions'), align: 'right' }
|
||||
]
|
||||
],
|
||||
geocoding_provider_type: $store.state.settings.geocoding_provider_type || 'Nominatim'
|
||||
}
|
||||
},
|
||||
async fetch() {
|
||||
@@ -124,7 +125,7 @@ export default {
|
||||
this.place.latitude = this.place.longitude = null
|
||||
}
|
||||
this.$emit('input', { ...this.place })
|
||||
},
|
||||
},
|
||||
searchAddress: debounce(async function(ev) {
|
||||
const pre_searchCoordinates = ev.target.value.trim().toLowerCase()
|
||||
// allow pasting coordinates lat/lon and lat,lon
|
||||
@@ -159,24 +160,59 @@ export default {
|
||||
|
||||
if (searchCoordinates.length) {
|
||||
this.loading = true
|
||||
const ret = await this.$axios.$get(`placeNominatim/${searchCoordinates}`)
|
||||
if (ret && ret.length) {
|
||||
this.addressList = ret.map(v => {
|
||||
const name = get(v.namedetails, 'alt_name', get(v.namedetails, 'name'))
|
||||
const address = v.display_name ? v.display_name.replace(name, '').replace(/^, ?/, '') : ''
|
||||
return {
|
||||
lat: v.lat,
|
||||
lon: v.lon,
|
||||
name,
|
||||
address
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.addressList = []
|
||||
const ret = await this.$axios.$get(`placeOSM/${this.geocoding_provider_type}/${searchCoordinates}`)
|
||||
if (this.geocoding_provider_type == "Nominatim") {
|
||||
if (ret && ret.length) {
|
||||
this.addressList = ret.map(v => {
|
||||
const name = get(v.namedetails, 'alt_name', get(v.namedetails, 'name'))
|
||||
const address = v.display_name ? v.display_name.replace(name, '').replace(/^, ?/, '') : ''
|
||||
return {
|
||||
class: v.class,
|
||||
type: v.osm_type,
|
||||
lat: v.lat,
|
||||
lon: v.lon,
|
||||
name,
|
||||
address
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.addressList = []
|
||||
}
|
||||
} else if (this.geocoding_provider_type == "Photon") {
|
||||
let photon_properties = ['housenumber', 'street', 'district', 'city', 'county', 'state', 'postcode', 'country']
|
||||
|
||||
if (ret) {
|
||||
this.addressList = ret.features.map(v => {
|
||||
let pre_name = v.properties.name || v.properties.street || ''
|
||||
let pre_address = ''
|
||||
|
||||
photon_properties.forEach((item, i) => {
|
||||
let last = i == (photon_properties.length - 1)
|
||||
if (v.properties[item] && !last) {
|
||||
pre_address += v.properties[item]+', '
|
||||
} else if (v.properties[item]) {
|
||||
pre_address += v.properties[item]
|
||||
}
|
||||
});
|
||||
|
||||
let name = pre_name
|
||||
let address = pre_address
|
||||
return {
|
||||
class: v.properties.osm_key,
|
||||
type: v.properties.osm_type,
|
||||
lat: v.geometry.coordinates[1],
|
||||
lon: v.geometry.coordinates[0],
|
||||
name,
|
||||
address
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.addressList = []
|
||||
}
|
||||
}
|
||||
this.loading = false
|
||||
}
|
||||
}, 300)
|
||||
}, 300)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -61,32 +61,35 @@ v-container
|
||||
|
||||
v-card-actions
|
||||
v-btn(text @click='showSMTP=true')
|
||||
<v-icon v-if='!settings.admin_email' color='error' v-text='mdiAlert'></v-icon> {{$t('admin.show_smtp_setup')}}
|
||||
v-btn(text @click='$emit("complete")' color='primary' v-if='setup') {{$t('common.next')}}
|
||||
v-icon(v-text='mdiArrowRight')
|
||||
<v-icon v-if='!settings.admin_email' color='error' class="mr-2" v-text='mdiAlert'></v-icon> {{$t('admin.show_smtp_setup')}}
|
||||
|
||||
v-btn(text @click='$emit("complete")' color='primary' v-if='setup') {{$t('common.next')}}
|
||||
v-icon(v-text='mdiArrowRight')
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import SMTP from './SMTP.vue'
|
||||
import Geolocation from './Geolocation.vue'
|
||||
import { mapActions, mapState } from 'vuex'
|
||||
import moment from 'dayjs'
|
||||
import tzNames from './tz.json'
|
||||
import { mdiAlert, mdiArrowRight } from '@mdi/js'
|
||||
import { mdiAlert, mdiArrowRight, mdiMap } from '@mdi/js'
|
||||
const locales = require('../../locales/index')
|
||||
|
||||
export default {
|
||||
props: {
|
||||
setup: { type: Boolean, default: false }
|
||||
},
|
||||
components: { SMTP },
|
||||
components: { SMTP, Geolocation },
|
||||
name: 'Settings',
|
||||
data ({ $store }) {
|
||||
return {
|
||||
mdiAlert, mdiArrowRight,
|
||||
mdiAlert, mdiArrowRight, mdiMap,
|
||||
title: $store.state.settings.title,
|
||||
description: $store.state.settings.description,
|
||||
locales: Object.keys(locales).map(locale => ({ value: locale, text: locales[locale] })),
|
||||
showSMTP: false,
|
||||
showGeolocationConfigs: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -270,7 +270,24 @@
|
||||
"blocked": "Blocked",
|
||||
"domain": "Domain",
|
||||
"known_users": "Known users",
|
||||
"created_at": "Created at"
|
||||
"created_at": "Created at",
|
||||
"geolocation_description": "<b>1. Define a provider for geocoding service</b>.<br>Currently, among those listed in the <a href=\"https://wiki.openstreetmap.org/wiki/Nominatim#Alternatives_.2F_Third-party_providers\">wiki of OpenStreetMap</a>, there is support for software <a href=\"https://github.com/osm-search/Nominatim\">Nominatim</a> and <a href=\"https://github.com/komoot/photon\">Photon</a>.<br>You can use one of the related official demos by copying the link in the 'Geocoding provider' field:<ul><li>https://nominatim.openstreetmap.org/search <a href=\"https://operations.osmfoundation.org/policies/nominatim/\"> [Terms of Service]</a></li><li>https://photon.komoot.io/api/ <a href=\"https://photon.komoot.io/\"> [Terms of Service]</a></li></ul><br><b>2. Define a provider for map layers.</b><br>You can find a list of them here: <a href=\"https://leaflet-extras.github.io/leaflet-providers/preview/\">https://leaflet-extras.github.io/leaflet-providers/preview/</a>",
|
||||
"geocoding_provider_type": "Geocoding software",
|
||||
"geocoding_provider_type_help": "The default software is Nominatim",
|
||||
"geocoding_provider": "Geocoding provider",
|
||||
"geocoding_provider_help": "The default provider is Nominatim",
|
||||
"geocoding_countrycodes": "Country codes",
|
||||
"geocoding_countrycodes_help": "Allows you to set a filter to searches based on area codes",
|
||||
"geocoding_test_button": "Test geocoding",
|
||||
"geocoding_test_success": "The geocoding service at {service_name} is working",
|
||||
"geocoding_test_error": "The geocoding service is not reachable at {service_name}",
|
||||
"tilelayer_provider": "Tilelayer provider",
|
||||
"tilelayer_provider_help": "The default provider is OpenStreetMap",
|
||||
"tilelayer_provider_attribution": "Attribution",
|
||||
"tilelayer_test_button": "Test tilelayer",
|
||||
"tilelayer_test_success": "The tilelayer service at {service_name} is working",
|
||||
"tilelayer_test_error": "The tilelayer service is not reachable at {service_name}",
|
||||
"geolocation": "Geolocation"
|
||||
},
|
||||
"auth": {
|
||||
"not_confirmed": "Not confirmed yet…",
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
"updated": "Evento aggiornato",
|
||||
"where_description": "Dov'è il gancio? Se il posto non è presente potrai crearlo.",
|
||||
"address_description": "A che indirizzo?",
|
||||
"address_description_osm": "A che indirizzo? ((<a href='http://osm.org/copyright'>OpenStreetMap</a>)",
|
||||
"address_description_osm": "A che indirizzo? (<a href='http://osm.org/copyright'>OpenStreetMap</a>)",
|
||||
"coordinates_search_description": "Puoi ricercare il posto per nome, o incollare la coppia di coordinate.",
|
||||
"confirmed": "Evento confermato",
|
||||
"not_found": "Evento non trovato",
|
||||
@@ -262,7 +262,24 @@
|
||||
"blocked": "Bloccato",
|
||||
"domain": "Domini",
|
||||
"known_users": "Utenti conosciuti",
|
||||
"created_at": "Creato il"
|
||||
"created_at": "Creato il",
|
||||
"geolocation_description": "<b>1. Definisci un fornitore per il servizio di georeferenziazione (geocodifica)</b>.<br>Al momento, tra quelli elencati nella <a href=\"https://wiki.openstreetmap.org/wiki/Nominatim#Alternatives_.2F_Third-party_providers\">wiki di OpenStreetMap</a>, è presente il supporto per i software <a href=\"https://github.com/osm-search/Nominatim\">Nominatim</a> e <a href=\"https://github.com/komoot/photon\">Photon</a>.<br>Puoi utilizzare una delle relative demo ufficiali copiandone il link nel campo 'Fornitore georeferenziazione':<ul><li>https://nominatim.openstreetmap.org/search [<a href=\"https://operations.osmfoundation.org/policies/nominatim/\">Terms of Service</a>]</li><li>https://photon.komoot.io/api/ [<a href=\"https://photon.komoot.io/\">Terms of Service</a>]</li></ul><br><b>2. Definisci un fornitore di layers per la mappa.</b><br>Qui puoi trovarne una lista: <a href=\"https://leaflet-extras.github.io/leaflet-providers/preview/\">https://leaflet-extras.github.io/leaflet-providers/preview/</a>",
|
||||
"geocoding_provider_type": "Software fornitore georeferenziazione",
|
||||
"geocoding_provider_type_help": "Il software di default è Nominatim",
|
||||
"geocoding_provider": "Fornitore georeferenziazione",
|
||||
"geocoding_provider_help": "Il fornitore di default è Nominatim",
|
||||
"geocoding_countrycodes": "Codici territoriali",
|
||||
"geocoding_countrycodes_help": "Permette di impostare un filtro alle ricerche basato su codici territori nazionali",
|
||||
"geocoding_test_button": "Test geocoding",
|
||||
"geocoding_test_success": "Il servizio di geocoding all'indirizzo {service_name} sta funzionando",
|
||||
"geocoding_test_error": "Il servizio non è raggiungibile all'indirizzo: {service_name}",
|
||||
"tilelayer_provider": "Fornitore tilelayer",
|
||||
"tilelayer_provider_help": "Il fornitore di default è OpenStreetMap",
|
||||
"tilelayer_provider_attribution": "Attribuzione",
|
||||
"tilelayer_test_button": "Test tilelayer",
|
||||
"tilelayer_test_success": "Il servizio di tilelayer all'indirizzo {service_name} sta funzionando",
|
||||
"tilelayer_test_error": "Il servizio non è raggiungibile all'indirizzo: {service_name}",
|
||||
"geolocation": "Geo e mappe"
|
||||
},
|
||||
"auth": {
|
||||
"not_confirmed": "Non ancora confermato…",
|
||||
|
||||
@@ -25,6 +25,13 @@ v-container.container.pa-0.pa-md-3
|
||||
v-tab(href='#places') {{$t('common.places')}}
|
||||
v-tab-item(value='places')
|
||||
Places
|
||||
|
||||
//- GEOCODING / MAPS
|
||||
v-tab(href='#geolocation' v-if='settings.allow_geolocation') {{$t('admin.geolocation')}}
|
||||
v-tab-item(value='geolocation')
|
||||
client-only(placeholder='Loading...')
|
||||
Geolocation
|
||||
|
||||
|
||||
//- Collections
|
||||
v-tab(href='#collections') {{$t('common.collections')}}
|
||||
@@ -71,6 +78,7 @@ export default {
|
||||
Events: () => import(/* webpackChunkName: "admin" */'../components/admin/Events'),
|
||||
Places: () => import(/* webpackChunkName: "admin" */'../components/admin/Places'),
|
||||
Collections: () => import(/* webpackChunkName: "admin" */'../components/admin/Collections'),
|
||||
[process.client && 'Geolocation']: () => import(/* webpackChunkName: "admin" */'../components/admin/Geolocation.vue'),
|
||||
Federation: () => import(/* webpackChunkName: "admin" */'../components/admin/Federation.vue'),
|
||||
Moderation: () => import(/* webpackChunkName: "admin" */'../components/admin/Moderation.vue'),
|
||||
Plugin: () => import(/* webpackChunkName: "admin" */'../components/admin/Plugin.vue'),
|
||||
|
||||
@@ -3,9 +3,12 @@ const Event = require('../models/event')
|
||||
const eventController = require('./event')
|
||||
const exportController = require('./export')
|
||||
|
||||
const { version } = require('../../../package.json')
|
||||
|
||||
const log = require('../../log')
|
||||
const { Op, where, col, fn, cast } = require('sequelize')
|
||||
const NOMINATIM_URL = 'https://nominatim.openstreetmap.org/search'
|
||||
const PHOTON_URL = 'https://photon.komoot.io/api/'
|
||||
const axios = require('axios')
|
||||
|
||||
module.exports = {
|
||||
@@ -76,19 +79,41 @@ module.exports = {
|
||||
|
||||
async _nominatim (req, res) {
|
||||
const details = req.params.place_details
|
||||
const countrycodes = res.locals.settings.geocoding_countrycodes || []
|
||||
const geocoding_provider = res.locals.settings.geocoding_provider || NOMINATIM_URL
|
||||
// ?limit=3&format=json&namedetails=1&addressdetails=1&q=
|
||||
|
||||
const ret = await axios.get(`${NOMINATIM_URL}`, {
|
||||
const ret = await axios.get(`${geocoding_provider}`, {
|
||||
params: {
|
||||
countrycodes: countrycodes.join(','),
|
||||
q: details,
|
||||
limit: 3,
|
||||
format: 'json',
|
||||
addressdetails: 1,
|
||||
namedetails: 1
|
||||
namedetails: 1,
|
||||
},
|
||||
headers: { 'User-Agent': 'gancio 1.6.0' }
|
||||
headers: { 'User-Agent': `gancio ${version}` }
|
||||
})
|
||||
|
||||
return res.json(ret.data)
|
||||
|
||||
},
|
||||
|
||||
async _photon (req, res) {
|
||||
const details = req.params.place_details
|
||||
const geocoding_provider = res.locals.settings.geocoding_provider || PHOTON_URL
|
||||
|
||||
const ret = await axios.get(`${geocoding_provider}`, {
|
||||
params: {
|
||||
q: details,
|
||||
limit: 3,
|
||||
},
|
||||
headers: { 'User-Agent': `gancio ${version}` }
|
||||
})
|
||||
|
||||
// console.log(ret)
|
||||
return res.json(ret.data)
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,11 @@ const defaultSettings = {
|
||||
allow_recurrent_event: false,
|
||||
recurrent_event_visible: false,
|
||||
allow_geolocation: true,
|
||||
geocoding_provider_type: 'Nominatim',
|
||||
geocoding_provider: 'https://nominatim.openstreetmap.org/search',
|
||||
geocoding_countrycodes: [],
|
||||
tilelayer_provider: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
tilelayer_provider_attribution: "<a target=\"_blank\" href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors",
|
||||
enable_federation: true,
|
||||
enable_resources: false,
|
||||
hide_boosts: true,
|
||||
|
||||
@@ -165,7 +165,8 @@ if (config.status !== 'READY') {
|
||||
api.get('/place/all', isAdmin, placeController.getAll)
|
||||
api.get('/place/:placeName', cors, placeController.getEvents)
|
||||
api.get('/place', cors, placeController.search)
|
||||
api.get('/placeNominatim/:place_details', cors, placeController._nominatim)
|
||||
api.get('/placeOSM/Nominatim/:place_details', cors, placeController._nominatim)
|
||||
api.get('/placeOSM/Photon/:place_details', cors, placeController._photon)
|
||||
api.put('/place', isAdmin, placeController.updatePlace)
|
||||
|
||||
api.get('/tag', cors, tagController.search)
|
||||
|
||||
@@ -93,6 +93,11 @@ module.exports = {
|
||||
hide_thumbs: settings.hide_thumbs,
|
||||
hide_calendar: settings.hide_calendar,
|
||||
allow_geolocation: settings.allow_geolocation,
|
||||
geocoding_provider_type: settings.geocoding_provider_type,
|
||||
geocoding_provider: settings.geocoding_provider,
|
||||
geocoding_countrycodes: settings.geocoding_countrycodes,
|
||||
tilelayer_provider: settings.tilelayer_provider,
|
||||
tilelayer_provider_attribution: settings.tilelayer_provider_attribution,
|
||||
footerLinks: settings.footerLinks,
|
||||
about: settings.about
|
||||
}
|
||||
|
||||
987
server/helpers/geolocation.js
Normal file
987
server/helpers/geolocation.js
Normal file
@@ -0,0 +1,987 @@
|
||||
// Iso conversions
|
||||
|
||||
var isoCountries = [
|
||||
{
|
||||
"code": "af",
|
||||
"name": "Afghanistan"
|
||||
},
|
||||
{
|
||||
"code": "ax",
|
||||
"name": "Aland Islands"
|
||||
},
|
||||
{
|
||||
"code": "al",
|
||||
"name": "Albania"
|
||||
},
|
||||
{
|
||||
"code": "dz",
|
||||
"name": "Algeria"
|
||||
},
|
||||
{
|
||||
"code": "as",
|
||||
"name": "American Samoa"
|
||||
},
|
||||
{
|
||||
"code": "ad",
|
||||
"name": "Andorra"
|
||||
},
|
||||
{
|
||||
"code": "ao",
|
||||
"name": "Angola"
|
||||
},
|
||||
{
|
||||
"code": "ai",
|
||||
"name": "Anguilla"
|
||||
},
|
||||
{
|
||||
"code": "aq",
|
||||
"name": "Antarctica"
|
||||
},
|
||||
{
|
||||
"code": "ag",
|
||||
"name": "Antigua And Barbuda"
|
||||
},
|
||||
{
|
||||
"code": "ar",
|
||||
"name": "Argentina"
|
||||
},
|
||||
{
|
||||
"code": "am",
|
||||
"name": "Armenia"
|
||||
},
|
||||
{
|
||||
"code": "aw",
|
||||
"name": "Aruba"
|
||||
},
|
||||
{
|
||||
"code": "au",
|
||||
"name": "Australia"
|
||||
},
|
||||
{
|
||||
"code": "at",
|
||||
"name": "Austria"
|
||||
},
|
||||
{
|
||||
"code": "az",
|
||||
"name": "Azerbaijan"
|
||||
},
|
||||
{
|
||||
"code": "bs",
|
||||
"name": "Bahamas"
|
||||
},
|
||||
{
|
||||
"code": "bh",
|
||||
"name": "Bahrain"
|
||||
},
|
||||
{
|
||||
"code": "bd",
|
||||
"name": "Bangladesh"
|
||||
},
|
||||
{
|
||||
"code": "bb",
|
||||
"name": "Barbados"
|
||||
},
|
||||
{
|
||||
"code": "by",
|
||||
"name": "Belarus"
|
||||
},
|
||||
{
|
||||
"code": "be",
|
||||
"name": "Belgium"
|
||||
},
|
||||
{
|
||||
"code": "bz",
|
||||
"name": "Belize"
|
||||
},
|
||||
{
|
||||
"code": "bj",
|
||||
"name": "Benin"
|
||||
},
|
||||
{
|
||||
"code": "bm",
|
||||
"name": "Bermuda"
|
||||
},
|
||||
{
|
||||
"code": "bt",
|
||||
"name": "Bhutan"
|
||||
},
|
||||
{
|
||||
"code": "bo",
|
||||
"name": "Bolivia"
|
||||
},
|
||||
{
|
||||
"code": "ba",
|
||||
"name": "Bosnia And Herzegovina"
|
||||
},
|
||||
{
|
||||
"code": "bw",
|
||||
"name": "Botswana"
|
||||
},
|
||||
{
|
||||
"code": "bv",
|
||||
"name": "Bouvet Island"
|
||||
},
|
||||
{
|
||||
"code": "br",
|
||||
"name": "Brazil"
|
||||
},
|
||||
{
|
||||
"code": "io",
|
||||
"name": "British Indian Ocean Territory"
|
||||
},
|
||||
{
|
||||
"code": "bn",
|
||||
"name": "Brunei Darussalam"
|
||||
},
|
||||
{
|
||||
"code": "bg",
|
||||
"name": "Bulgaria"
|
||||
},
|
||||
{
|
||||
"code": "bf",
|
||||
"name": "Burkina Faso"
|
||||
},
|
||||
{
|
||||
"code": "bi",
|
||||
"name": "Burundi"
|
||||
},
|
||||
{
|
||||
"code": "kh",
|
||||
"name": "Cambodia"
|
||||
},
|
||||
{
|
||||
"code": "cm",
|
||||
"name": "Cameroon"
|
||||
},
|
||||
{
|
||||
"code": "ca",
|
||||
"name": "Canada"
|
||||
},
|
||||
{
|
||||
"code": "cv",
|
||||
"name": "Cape Verde"
|
||||
},
|
||||
{
|
||||
"code": "ky",
|
||||
"name": "Cayman Islands"
|
||||
},
|
||||
{
|
||||
"code": "cf",
|
||||
"name": "Central African Republic"
|
||||
},
|
||||
{
|
||||
"code": "td",
|
||||
"name": "Chad"
|
||||
},
|
||||
{
|
||||
"code": "cl",
|
||||
"name": "Chile"
|
||||
},
|
||||
{
|
||||
"code": "cn",
|
||||
"name": "China"
|
||||
},
|
||||
{
|
||||
"code": "cx",
|
||||
"name": "Christmas Island"
|
||||
},
|
||||
{
|
||||
"code": "cc",
|
||||
"name": "Cocos (Keeling) Islands"
|
||||
},
|
||||
{
|
||||
"code": "co",
|
||||
"name": "Colombia"
|
||||
},
|
||||
{
|
||||
"code": "km",
|
||||
"name": "Comoros"
|
||||
},
|
||||
{
|
||||
"code": "cg",
|
||||
"name": "Congo"
|
||||
},
|
||||
{
|
||||
"code": "cd",
|
||||
"name": "Congo, Democratic Republic"
|
||||
},
|
||||
{
|
||||
"code": "ck",
|
||||
"name": "Cook Islands"
|
||||
},
|
||||
{
|
||||
"code": "cr",
|
||||
"name": "Costa Rica"
|
||||
},
|
||||
{
|
||||
"code": "ci",
|
||||
"name": "Cote D'Ivoire"
|
||||
},
|
||||
{
|
||||
"code": "hr",
|
||||
"name": "Croatia"
|
||||
},
|
||||
{
|
||||
"code": "cu",
|
||||
"name": "Cuba"
|
||||
},
|
||||
{
|
||||
"code": "cy",
|
||||
"name": "Cyprus"
|
||||
},
|
||||
{
|
||||
"code": "cz",
|
||||
"name": "Czech Republic"
|
||||
},
|
||||
{
|
||||
"code": "dk",
|
||||
"name": "Denmark"
|
||||
},
|
||||
{
|
||||
"code": "dj",
|
||||
"name": "Djibouti"
|
||||
},
|
||||
{
|
||||
"code": "dm",
|
||||
"name": "Dominica"
|
||||
},
|
||||
{
|
||||
"code": "do",
|
||||
"name": "Dominican Republic"
|
||||
},
|
||||
{
|
||||
"code": "ec",
|
||||
"name": "Ecuador"
|
||||
},
|
||||
{
|
||||
"code": "eg",
|
||||
"name": "Egypt"
|
||||
},
|
||||
{
|
||||
"code": "sv",
|
||||
"name": "El Salvador"
|
||||
},
|
||||
{
|
||||
"code": "gq",
|
||||
"name": "Equatorial Guinea"
|
||||
},
|
||||
{
|
||||
"code": "er",
|
||||
"name": "Eritrea"
|
||||
},
|
||||
{
|
||||
"code": "ee",
|
||||
"name": "Estonia"
|
||||
},
|
||||
{
|
||||
"code": "et",
|
||||
"name": "Ethiopia"
|
||||
},
|
||||
{
|
||||
"code": "fk",
|
||||
"name": "Falkland Islands (Malvinas)"
|
||||
},
|
||||
{
|
||||
"code": "fo",
|
||||
"name": "Faroe Islands"
|
||||
},
|
||||
{
|
||||
"code": "fj",
|
||||
"name": "Fiji"
|
||||
},
|
||||
{
|
||||
"code": "fi",
|
||||
"name": "Finland"
|
||||
},
|
||||
{
|
||||
"code": "fr",
|
||||
"name": "France"
|
||||
},
|
||||
{
|
||||
"code": "gf",
|
||||
"name": "French Guiana"
|
||||
},
|
||||
{
|
||||
"code": "pf",
|
||||
"name": "French Polynesia"
|
||||
},
|
||||
{
|
||||
"code": "tf",
|
||||
"name": "French Southern Territories"
|
||||
},
|
||||
{
|
||||
"code": "ga",
|
||||
"name": "Gabon"
|
||||
},
|
||||
{
|
||||
"code": "gm",
|
||||
"name": "Gambia"
|
||||
},
|
||||
{
|
||||
"code": "ge",
|
||||
"name": "Georgia"
|
||||
},
|
||||
{
|
||||
"code": "de",
|
||||
"name": "Germany"
|
||||
},
|
||||
{
|
||||
"code": "gh",
|
||||
"name": "Ghana"
|
||||
},
|
||||
{
|
||||
"code": "gi",
|
||||
"name": "Gibraltar"
|
||||
},
|
||||
{
|
||||
"code": "gr",
|
||||
"name": "Greece"
|
||||
},
|
||||
{
|
||||
"code": "gl",
|
||||
"name": "Greenland"
|
||||
},
|
||||
{
|
||||
"code": "gd",
|
||||
"name": "Grenada"
|
||||
},
|
||||
{
|
||||
"code": "gp",
|
||||
"name": "Guadeloupe"
|
||||
},
|
||||
{
|
||||
"code": "gu",
|
||||
"name": "Guam"
|
||||
},
|
||||
{
|
||||
"code": "gt",
|
||||
"name": "Guatemala"
|
||||
},
|
||||
{
|
||||
"code": "gg",
|
||||
"name": "Guernsey"
|
||||
},
|
||||
{
|
||||
"code": "gn",
|
||||
"name": "Guinea"
|
||||
},
|
||||
{
|
||||
"code": "gw",
|
||||
"name": "Guinea-Bissau"
|
||||
},
|
||||
{
|
||||
"code": "gy",
|
||||
"name": "Guyana"
|
||||
},
|
||||
{
|
||||
"code": "ht",
|
||||
"name": "Haiti"
|
||||
},
|
||||
{
|
||||
"code": "hm",
|
||||
"name": "Heard Island & Mcdonald Islands"
|
||||
},
|
||||
{
|
||||
"code": "va",
|
||||
"name": "Holy See (Vatican City State)"
|
||||
},
|
||||
{
|
||||
"code": "hn",
|
||||
"name": "Honduras"
|
||||
},
|
||||
{
|
||||
"code": "hk",
|
||||
"name": "Hong Kong"
|
||||
},
|
||||
{
|
||||
"code": "hu",
|
||||
"name": "Hungary"
|
||||
},
|
||||
{
|
||||
"code": "is",
|
||||
"name": "Iceland"
|
||||
},
|
||||
{
|
||||
"code": "in",
|
||||
"name": "India"
|
||||
},
|
||||
{
|
||||
"code": "id",
|
||||
"name": "Indonesia"
|
||||
},
|
||||
{
|
||||
"code": "ir",
|
||||
"name": "Iran, Islamic Republic Of"
|
||||
},
|
||||
{
|
||||
"code": "iq",
|
||||
"name": "Iraq"
|
||||
},
|
||||
{
|
||||
"code": "ie",
|
||||
"name": "Ireland"
|
||||
},
|
||||
{
|
||||
"code": "im",
|
||||
"name": "Isle Of Man"
|
||||
},
|
||||
{
|
||||
"code": "il",
|
||||
"name": "Israel"
|
||||
},
|
||||
{
|
||||
"code": "it",
|
||||
"name": "Italy"
|
||||
},
|
||||
{
|
||||
"code": "jm",
|
||||
"name": "Jamaica"
|
||||
},
|
||||
{
|
||||
"code": "jp",
|
||||
"name": "Japan"
|
||||
},
|
||||
{
|
||||
"code": "je",
|
||||
"name": "Jersey"
|
||||
},
|
||||
{
|
||||
"code": "jo",
|
||||
"name": "Jordan"
|
||||
},
|
||||
{
|
||||
"code": "kz",
|
||||
"name": "Kazakhstan"
|
||||
},
|
||||
{
|
||||
"code": "ke",
|
||||
"name": "Kenya"
|
||||
},
|
||||
{
|
||||
"code": "ki",
|
||||
"name": "Kiribati"
|
||||
},
|
||||
{
|
||||
"code": "kr",
|
||||
"name": "Korea"
|
||||
},
|
||||
{
|
||||
"code": "kw",
|
||||
"name": "Kuwait"
|
||||
},
|
||||
{
|
||||
"code": "kg",
|
||||
"name": "Kyrgyzstan"
|
||||
},
|
||||
{
|
||||
"code": "la",
|
||||
"name": "Lao People's Democratic Republic"
|
||||
},
|
||||
{
|
||||
"code": "lv",
|
||||
"name": "Latvia"
|
||||
},
|
||||
{
|
||||
"code": "lb",
|
||||
"name": "Lebanon"
|
||||
},
|
||||
{
|
||||
"code": "ls",
|
||||
"name": "Lesotho"
|
||||
},
|
||||
{
|
||||
"code": "lr",
|
||||
"name": "Liberia"
|
||||
},
|
||||
{
|
||||
"code": "ly",
|
||||
"name": "Libyan Arab Jamahiriya"
|
||||
},
|
||||
{
|
||||
"code": "li",
|
||||
"name": "Liechtenstein"
|
||||
},
|
||||
{
|
||||
"code": "lt",
|
||||
"name": "Lithuania"
|
||||
},
|
||||
{
|
||||
"code": "lu",
|
||||
"name": "Luxembourg"
|
||||
},
|
||||
{
|
||||
"code": "mo",
|
||||
"name": "Macao"
|
||||
},
|
||||
{
|
||||
"code": "mk",
|
||||
"name": "Macedonia"
|
||||
},
|
||||
{
|
||||
"code": "mg",
|
||||
"name": "Madagascar"
|
||||
},
|
||||
{
|
||||
"code": "mw",
|
||||
"name": "Malawi"
|
||||
},
|
||||
{
|
||||
"code": "my",
|
||||
"name": "Malaysia"
|
||||
},
|
||||
{
|
||||
"code": "mv",
|
||||
"name": "Maldives"
|
||||
},
|
||||
{
|
||||
"code": "ml",
|
||||
"name": "Mali"
|
||||
},
|
||||
{
|
||||
"code": "mt",
|
||||
"name": "Malta"
|
||||
},
|
||||
{
|
||||
"code": "mh",
|
||||
"name": "Marshall Islands"
|
||||
},
|
||||
{
|
||||
"code": "mq",
|
||||
"name": "Martinique"
|
||||
},
|
||||
{
|
||||
"code": "mr",
|
||||
"name": "Mauritania"
|
||||
},
|
||||
{
|
||||
"code": "mu",
|
||||
"name": "Mauritius"
|
||||
},
|
||||
{
|
||||
"code": "yt",
|
||||
"name": "Mayotte"
|
||||
},
|
||||
{
|
||||
"code": "mx",
|
||||
"name": "Mexico"
|
||||
},
|
||||
{
|
||||
"code": "fm",
|
||||
"name": "Micronesia, Federated States Of"
|
||||
},
|
||||
{
|
||||
"code": "md",
|
||||
"name": "Moldova"
|
||||
},
|
||||
{
|
||||
"code": "mc",
|
||||
"name": "Monaco"
|
||||
},
|
||||
{
|
||||
"code": "mn",
|
||||
"name": "Mongolia"
|
||||
},
|
||||
{
|
||||
"code": "me",
|
||||
"name": "Montenegro"
|
||||
},
|
||||
{
|
||||
"code": "ms",
|
||||
"name": "Montserrat"
|
||||
},
|
||||
{
|
||||
"code": "ma",
|
||||
"name": "Morocco"
|
||||
},
|
||||
{
|
||||
"code": "mz",
|
||||
"name": "Mozambique"
|
||||
},
|
||||
{
|
||||
"code": "mm",
|
||||
"name": "Myanmar"
|
||||
},
|
||||
{
|
||||
"code": "na",
|
||||
"name": "Namibia"
|
||||
},
|
||||
{
|
||||
"code": "nr",
|
||||
"name": "Nauru"
|
||||
},
|
||||
{
|
||||
"code": "np",
|
||||
"name": "Nepal"
|
||||
},
|
||||
{
|
||||
"code": "nl",
|
||||
"name": "Netherlands"
|
||||
},
|
||||
{
|
||||
"code": "an",
|
||||
"name": "Netherlands Antilles"
|
||||
},
|
||||
{
|
||||
"code": "nc",
|
||||
"name": "New Caledonia"
|
||||
},
|
||||
{
|
||||
"code": "nz",
|
||||
"name": "New Zealand"
|
||||
},
|
||||
{
|
||||
"code": "ni",
|
||||
"name": "Nicaragua"
|
||||
},
|
||||
{
|
||||
"code": "ne",
|
||||
"name": "Niger"
|
||||
},
|
||||
{
|
||||
"code": "ng",
|
||||
"name": "Nigeria"
|
||||
},
|
||||
{
|
||||
"code": "nu",
|
||||
"name": "Niue"
|
||||
},
|
||||
{
|
||||
"code": "nf",
|
||||
"name": "Norfolk Island"
|
||||
},
|
||||
{
|
||||
"code": "mp",
|
||||
"name": "Northern Mariana Islands"
|
||||
},
|
||||
{
|
||||
"code": "no",
|
||||
"name": "Norway"
|
||||
},
|
||||
{
|
||||
"code": "om",
|
||||
"name": "Oman"
|
||||
},
|
||||
{
|
||||
"code": "pk",
|
||||
"name": "Pakistan"
|
||||
},
|
||||
{
|
||||
"code": "pw",
|
||||
"name": "Palau"
|
||||
},
|
||||
{
|
||||
"code": "ps",
|
||||
"name": "Palestinian Territory, Occupied"
|
||||
},
|
||||
{
|
||||
"code": "pa",
|
||||
"name": "Panama"
|
||||
},
|
||||
{
|
||||
"code": "pg",
|
||||
"name": "Papua New Guinea"
|
||||
},
|
||||
{
|
||||
"code": "py",
|
||||
"name": "Paraguay"
|
||||
},
|
||||
{
|
||||
"code": "pe",
|
||||
"name": "Peru"
|
||||
},
|
||||
{
|
||||
"code": "ph",
|
||||
"name": "Philippines"
|
||||
},
|
||||
{
|
||||
"code": "pn",
|
||||
"name": "Pitcairn"
|
||||
},
|
||||
{
|
||||
"code": "pl",
|
||||
"name": "Poland"
|
||||
},
|
||||
{
|
||||
"code": "pt",
|
||||
"name": "Portugal"
|
||||
},
|
||||
{
|
||||
"code": "pr",
|
||||
"name": "Puerto Rico"
|
||||
},
|
||||
{
|
||||
"code": "qa",
|
||||
"name": "Qatar"
|
||||
},
|
||||
{
|
||||
"code": "re",
|
||||
"name": "Reunion"
|
||||
},
|
||||
{
|
||||
"code": "ro",
|
||||
"name": "Romania"
|
||||
},
|
||||
{
|
||||
"code": "ru",
|
||||
"name": "Russian Federation"
|
||||
},
|
||||
{
|
||||
"code": "rw",
|
||||
"name": "Rwanda"
|
||||
},
|
||||
{
|
||||
"code": "bl",
|
||||
"name": "Saint Barthelemy"
|
||||
},
|
||||
{
|
||||
"code": "sh",
|
||||
"name": "Saint Helena"
|
||||
},
|
||||
{
|
||||
"code": "kn",
|
||||
"name": "Saint Kitts And Nevis"
|
||||
},
|
||||
{
|
||||
"code": "lc",
|
||||
"name": "Saint Lucia"
|
||||
},
|
||||
{
|
||||
"code": "mf",
|
||||
"name": "Saint Martin"
|
||||
},
|
||||
{
|
||||
"code": "pm",
|
||||
"name": "Saint Pierre And Miquelon"
|
||||
},
|
||||
{
|
||||
"code": "vc",
|
||||
"name": "Saint Vincent And Grenadines"
|
||||
},
|
||||
{
|
||||
"code": "ws",
|
||||
"name": "Samoa"
|
||||
},
|
||||
{
|
||||
"code": "sm",
|
||||
"name": "San Marino"
|
||||
},
|
||||
{
|
||||
"code": "st",
|
||||
"name": "Sao Tome And Principe"
|
||||
},
|
||||
{
|
||||
"code": "sa",
|
||||
"name": "Saudi Arabia"
|
||||
},
|
||||
{
|
||||
"code": "sn",
|
||||
"name": "Senegal"
|
||||
},
|
||||
{
|
||||
"code": "rs",
|
||||
"name": "Serbia"
|
||||
},
|
||||
{
|
||||
"code": "sc",
|
||||
"name": "Seychelles"
|
||||
},
|
||||
{
|
||||
"code": "sl",
|
||||
"name": "Sierra Leone"
|
||||
},
|
||||
{
|
||||
"code": "sg",
|
||||
"name": "Singapore"
|
||||
},
|
||||
{
|
||||
"code": "sk",
|
||||
"name": "Slovakia"
|
||||
},
|
||||
{
|
||||
"code": "si",
|
||||
"name": "Slovenia"
|
||||
},
|
||||
{
|
||||
"code": "sb",
|
||||
"name": "Solomon Islands"
|
||||
},
|
||||
{
|
||||
"code": "so",
|
||||
"name": "Somalia"
|
||||
},
|
||||
{
|
||||
"code": "za",
|
||||
"name": "South Africa"
|
||||
},
|
||||
{
|
||||
"code": "gs",
|
||||
"name": "South Georgia And Sandwich Isl."
|
||||
},
|
||||
{
|
||||
"code": "es",
|
||||
"name": "Spain"
|
||||
},
|
||||
{
|
||||
"code": "lk",
|
||||
"name": "Sri Lanka"
|
||||
},
|
||||
{
|
||||
"code": "sd",
|
||||
"name": "Sudan"
|
||||
},
|
||||
{
|
||||
"code": "sr",
|
||||
"name": "Suriname"
|
||||
},
|
||||
{
|
||||
"code": "sj",
|
||||
"name": "Svalbard And Jan Mayen"
|
||||
},
|
||||
{
|
||||
"code": "sz",
|
||||
"name": "Swaziland"
|
||||
},
|
||||
{
|
||||
"code": "se",
|
||||
"name": "Sweden"
|
||||
},
|
||||
{
|
||||
"code": "ch",
|
||||
"name": "Switzerland"
|
||||
},
|
||||
{
|
||||
"code": "sy",
|
||||
"name": "Syrian Arab Republic"
|
||||
},
|
||||
{
|
||||
"code": "tw",
|
||||
"name": "Taiwan"
|
||||
},
|
||||
{
|
||||
"code": "tj",
|
||||
"name": "Tajikistan"
|
||||
},
|
||||
{
|
||||
"code": "tz",
|
||||
"name": "Tanzania"
|
||||
},
|
||||
{
|
||||
"code": "th",
|
||||
"name": "Thailand"
|
||||
},
|
||||
{
|
||||
"code": "tl",
|
||||
"name": "Timor-Leste"
|
||||
},
|
||||
{
|
||||
"code": "tg",
|
||||
"name": "Togo"
|
||||
},
|
||||
{
|
||||
"code": "tk",
|
||||
"name": "Tokelau"
|
||||
},
|
||||
{
|
||||
"code": "to",
|
||||
"name": "Tonga"
|
||||
},
|
||||
{
|
||||
"code": "tt",
|
||||
"name": "Trinidad And Tobago"
|
||||
},
|
||||
{
|
||||
"code": "tn",
|
||||
"name": "Tunisia"
|
||||
},
|
||||
{
|
||||
"code": "tr",
|
||||
"name": "Turkey"
|
||||
},
|
||||
{
|
||||
"code": "tm",
|
||||
"name": "Turkmenistan"
|
||||
},
|
||||
{
|
||||
"code": "tc",
|
||||
"name": "Turks And Caicos Islands"
|
||||
},
|
||||
{
|
||||
"code": "tv",
|
||||
"name": "Tuvalu"
|
||||
},
|
||||
{
|
||||
"code": "ug",
|
||||
"name": "Uganda"
|
||||
},
|
||||
{
|
||||
"code": "ua",
|
||||
"name": "Ukraine"
|
||||
},
|
||||
{
|
||||
"code": "ae",
|
||||
"name": "United Arab Emirates"
|
||||
},
|
||||
{
|
||||
"code": "gb",
|
||||
"name": "United Kingdom"
|
||||
},
|
||||
{
|
||||
"code": "us",
|
||||
"name": "United States"
|
||||
},
|
||||
{
|
||||
"code": "um",
|
||||
"name": "United States Outlying Islands"
|
||||
},
|
||||
{
|
||||
"code": "uy",
|
||||
"name": "Uruguay"
|
||||
},
|
||||
{
|
||||
"code": "uz",
|
||||
"name": "Uzbekistan"
|
||||
},
|
||||
{
|
||||
"code": "vu",
|
||||
"name": "Vanuatu"
|
||||
},
|
||||
{
|
||||
"code": "ve",
|
||||
"name": "Venezuela"
|
||||
},
|
||||
{
|
||||
"code": "vn",
|
||||
"name": "Viet Nam"
|
||||
},
|
||||
{
|
||||
"code": "vg",
|
||||
"name": "Virgin Islands, British"
|
||||
},
|
||||
{
|
||||
"code": "vi",
|
||||
"name": "Virgin Islands, U.S."
|
||||
},
|
||||
{
|
||||
"code": "wf",
|
||||
"name": "Wallis And Futuna"
|
||||
},
|
||||
{
|
||||
"code": "eh",
|
||||
"name": "Western Sahara"
|
||||
},
|
||||
{
|
||||
"code": "ye",
|
||||
"name": "Yemen"
|
||||
},
|
||||
{
|
||||
"code": "zm",
|
||||
"name": "Zambia"
|
||||
},
|
||||
{
|
||||
"code": "zw",
|
||||
"name": "Zimbabwe"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
module.exports = { isoCountries }
|
||||
@@ -10,6 +10,11 @@ export const state = () => ({
|
||||
allow_recurrent_event: true,
|
||||
recurrent_event_visible: false,
|
||||
allow_geolocation: false,
|
||||
geocoding_provider_type: '',
|
||||
geocoding_provider: '',
|
||||
geocoding_countrycodes: [],
|
||||
tilelayer_provider: '',
|
||||
tilelayer_provider_attribution: '',
|
||||
enable_federation: false,
|
||||
enable_resources: false,
|
||||
hide_boosts: true,
|
||||
|
||||
Reference in New Issue
Block a user