Compare commits

..

1 commit

Author SHA1 Message Date
Yohan Boniface
e47796c75f
Merge ba3a1ccd33 into e01a526935 2024-12-02 19:54:57 +01:00
3 changed files with 5 additions and 8 deletions

View file

@ -2,7 +2,6 @@ import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js'
import { BaseAjax, SingleMixin } from '../autocomplete.js'
import * as Util from '../utils.js'
import { AutocompleteCommunes } from './communesfr.js'
import { translate } from '../i18n.js'
const TEMPLATE = `
<h3>Cadastre</h3>
@ -57,8 +56,6 @@ export class Importer {
.open({
template: container,
className: `${this.id} importer dark`,
cancel: false,
accept: translate('Choose this data'),
})
.then(confirm)
}

View file

@ -37,8 +37,8 @@ class Autocomplete extends SingleMixin(BaseAjax) {
}
export class Importer {
constructor(umap, options = {}) {
this.umap = umap
constructor(map, options = {}) {
this.map = map
this.name = options.name || 'GeoDataMine'
this.baseUrl = options?.url || 'https://geodatamine.fr'
this.id = 'geodatamine'
@ -49,7 +49,7 @@ export class Importer {
let boundaryName = null
const container = DomUtil.create('div')
container.innerHTML = TEMPLATE
const response = await this.umap.request.get(`${this.baseUrl}/themes`)
const response = await importer.map.request.get(`${this.baseUrl}/themes`)
const select = container.querySelector('select')
if (response?.ok) {
const { themes } = await response.json()

View file

@ -44,12 +44,12 @@ const ControlsMixin = {
new U.DrawToolbar({ map: this }).addTo(this)
const editActions = [
U.EditCaptionAction,
U.ImportAction,
U.EditPropertiesAction,
U.EditLayersAction,
U.ChangeTileLayerAction,
U.UpdateExtentAction,
U.UpdatePermsAction,
U.EditPropertiesAction,
U.ImportAction,
]
if (this.options.editMode === 'advanced') {
new U.SettingsToolbar({ actions: editActions }).addTo(this)