mirror of
https://github.com/umap-project/umap.git
synced 2025-05-06 14:31:50 +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 * as Util from '../utils.js'
|
||||
import { AutocompleteCommunes } from './communesfr.js'
|
||||
import { translate } from '../i18n.js'
|
||||
|
||||
const TEMPLATE = `
|
||||
<h3>Cadastre</h3>
|
||||
|
@ -56,6 +57,8 @@ export class Importer {
|
|||
.open({
|
||||
template: container,
|
||||
className: `${this.id} importer dark`,
|
||||
cancel: false,
|
||||
accept: translate('Choose this data'),
|
||||
})
|
||||
.then(confirm)
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@ class Autocomplete extends SingleMixin(BaseAjax) {
|
|||
}
|
||||
|
||||
export class Importer {
|
||||
constructor(map, options = {}) {
|
||||
this.map = map
|
||||
constructor(umap, options = {}) {
|
||||
this.umap = umap
|
||||
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 importer.map.request.get(`${this.baseUrl}/themes`)
|
||||
const response = await this.umap.request.get(`${this.baseUrl}/themes`)
|
||||
const select = container.querySelector('select')
|
||||
if (response?.ok) {
|
||||
const { themes } = await response.json()
|
||||
|
|
|
@ -44,12 +44,12 @@ const ControlsMixin = {
|
|||
new U.DrawToolbar({ map: this }).addTo(this)
|
||||
const editActions = [
|
||||
U.EditCaptionAction,
|
||||
U.EditPropertiesAction,
|
||||
U.ImportAction,
|
||||
U.EditLayersAction,
|
||||
U.ChangeTileLayerAction,
|
||||
U.UpdateExtentAction,
|
||||
U.UpdatePermsAction,
|
||||
U.ImportAction,
|
||||
U.EditPropertiesAction,
|
||||
]
|
||||
if (this.options.editMode === 'advanced') {
|
||||
new U.SettingsToolbar({ actions: editActions }).addTo(this)
|
||||
|
|
Loading…
Reference in a new issue