mirror of
https://github.com/umap-project/umap.git
synced 2025-05-06 22:41:49 +02:00
Compare commits
7 commits
e47796c75f
...
6414535831
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6414535831 | ||
![]() |
c9d532508d | ||
![]() |
6221b709f4 | ||
![]() |
2b2580fa22 | ||
![]() |
26ff82e838 | ||
![]() |
8fa26a02a2 | ||
![]() |
9a900319af |
3 changed files with 8 additions and 5 deletions
|
@ -2,6 +2,7 @@ import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { BaseAjax, SingleMixin } from '../autocomplete.js'
|
import { BaseAjax, SingleMixin } from '../autocomplete.js'
|
||||||
import * as Util from '../utils.js'
|
import * as Util from '../utils.js'
|
||||||
import { AutocompleteCommunes } from './communesfr.js'
|
import { AutocompleteCommunes } from './communesfr.js'
|
||||||
|
import { translate } from '../i18n.js'
|
||||||
|
|
||||||
const TEMPLATE = `
|
const TEMPLATE = `
|
||||||
<h3>Cadastre</h3>
|
<h3>Cadastre</h3>
|
||||||
|
@ -56,6 +57,8 @@ export class Importer {
|
||||||
.open({
|
.open({
|
||||||
template: container,
|
template: container,
|
||||||
className: `${this.id} importer dark`,
|
className: `${this.id} importer dark`,
|
||||||
|
cancel: false,
|
||||||
|
accept: translate('Choose this data'),
|
||||||
})
|
})
|
||||||
.then(confirm)
|
.then(confirm)
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,8 @@ class Autocomplete extends SingleMixin(BaseAjax) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Importer {
|
export class Importer {
|
||||||
constructor(map, options = {}) {
|
constructor(umap, options = {}) {
|
||||||
this.map = map
|
this.umap = umap
|
||||||
this.name = options.name || 'GeoDataMine'
|
this.name = options.name || 'GeoDataMine'
|
||||||
this.baseUrl = options?.url || 'https://geodatamine.fr'
|
this.baseUrl = options?.url || 'https://geodatamine.fr'
|
||||||
this.id = 'geodatamine'
|
this.id = 'geodatamine'
|
||||||
|
@ -49,7 +49,7 @@ export class Importer {
|
||||||
let boundaryName = null
|
let boundaryName = null
|
||||||
const container = DomUtil.create('div')
|
const container = DomUtil.create('div')
|
||||||
container.innerHTML = TEMPLATE
|
container.innerHTML = TEMPLATE
|
||||||
const response = await importer.map.request.get(`${this.baseUrl}/themes`)
|
const response = await this.umap.request.get(`${this.baseUrl}/themes`)
|
||||||
const select = container.querySelector('select')
|
const select = container.querySelector('select')
|
||||||
if (response?.ok) {
|
if (response?.ok) {
|
||||||
const { themes } = await response.json()
|
const { themes } = await response.json()
|
||||||
|
|
|
@ -44,12 +44,12 @@ const ControlsMixin = {
|
||||||
new U.DrawToolbar({ map: this }).addTo(this)
|
new U.DrawToolbar({ map: this }).addTo(this)
|
||||||
const editActions = [
|
const editActions = [
|
||||||
U.EditCaptionAction,
|
U.EditCaptionAction,
|
||||||
U.EditPropertiesAction,
|
U.ImportAction,
|
||||||
U.EditLayersAction,
|
U.EditLayersAction,
|
||||||
U.ChangeTileLayerAction,
|
U.ChangeTileLayerAction,
|
||||||
U.UpdateExtentAction,
|
U.UpdateExtentAction,
|
||||||
U.UpdatePermsAction,
|
U.UpdatePermsAction,
|
||||||
U.ImportAction,
|
U.EditPropertiesAction,
|
||||||
]
|
]
|
||||||
if (this.options.editMode === 'advanced') {
|
if (this.options.editMode === 'advanced') {
|
||||||
new U.SettingsToolbar({ actions: editActions }).addTo(this)
|
new U.SettingsToolbar({ actions: editActions }).addTo(this)
|
||||||
|
|
Loading…
Reference in a new issue