diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index eaffaa11..a2f92be9 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -779,6 +779,37 @@ input[type=hidden].blur + [type="button"] { } +/* *********** */ +/* Importers */ +/* *********** */ +#importers button { + background: none; + font-size: 1.2rem; + border: none; +} +#importers button:before { + background-image: url(./img/importers/random.svg); + background-repeat: no-repeat; + background-position: center; + content: ''; + width: 100%; + height: 50px; + display: block; +} +#importers .geodatamine:before { + background-image: url(./img/importers/geodatamine.svg); +} +#importers .communesfr:before { + background-image: url(./img/importers/communesfr.svg); +} +#importers .overpass:before { + background-image: url(./img/importers/overpass.svg); +} +#importers .datasets:before { + background-image: url(./img/importers/datasets.svg); +} + + /* *********** */ /* Various */ /* *********** */ diff --git a/umap/static/umap/img/importers/communesfr.svg b/umap/static/umap/img/importers/communesfr.svg new file mode 100644 index 00000000..d0e6a498 --- /dev/null +++ b/umap/static/umap/img/importers/communesfr.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/umap/static/umap/img/importers/datasets.svg b/umap/static/umap/img/importers/datasets.svg new file mode 100644 index 00000000..80ae1436 --- /dev/null +++ b/umap/static/umap/img/importers/datasets.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/umap/static/umap/img/importers/geodatamine.svg b/umap/static/umap/img/importers/geodatamine.svg new file mode 100644 index 00000000..ec40a1e2 --- /dev/null +++ b/umap/static/umap/img/importers/geodatamine.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/umap/static/umap/img/importers/overpass.svg b/umap/static/umap/img/importers/overpass.svg new file mode 100644 index 00000000..3067edaf --- /dev/null +++ b/umap/static/umap/img/importers/overpass.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/umap/static/umap/img/importers/random.svg b/umap/static/umap/img/importers/random.svg new file mode 100644 index 00000000..45aa3c58 --- /dev/null +++ b/umap/static/umap/img/importers/random.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/umap/static/umap/img/importers/random1.svg b/umap/static/umap/img/importers/random1.svg new file mode 100644 index 00000000..5d034851 --- /dev/null +++ b/umap/static/umap/img/importers/random1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/umap/static/umap/img/importers/random2.svg b/umap/static/umap/img/importers/random2.svg new file mode 100644 index 00000000..6819af0e --- /dev/null +++ b/umap/static/umap/img/importers/random2.svg @@ -0,0 +1,4 @@ + + + + diff --git a/umap/static/umap/js/modules/help.js b/umap/static/umap/js/modules/help.js index fc46ef0b..74c2b9f2 100644 --- a/umap/static/umap/js/modules/help.js +++ b/umap/static/umap/js/modules/help.js @@ -151,9 +151,9 @@ const ENTRIES = {
${translate('More info about Overpass syntax')}: https://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide
diff --git a/umap/static/umap/js/modules/importer.js b/umap/static/umap/js/modules/importer.js index bf6c50c7..76bb53b8 100644 --- a/umap/static/umap/js/modules/importer.js +++ b/umap/static/umap/js/modules/importer.js @@ -13,7 +13,7 @@ const TEMPLATE = `
-
${translate('Import helpers:')}
+

${translate('Import helpers:')}

@@ -130,7 +130,7 @@ export default class Importer { if (this.IMPORTERS.length) { for (const plugin of this.IMPORTERS) { L.DomUtil.createButton( - 'flat', + plugin.id, this.container.querySelector('#importers'), plugin.name, () => plugin.open(this) diff --git a/umap/static/umap/js/modules/importers/communesfr.js b/umap/static/umap/js/modules/importers/communesfr.js index 9c66e3c6..7b08252b 100644 --- a/umap/static/umap/js/modules/importers/communesfr.js +++ b/umap/static/umap/js/modules/importers/communesfr.js @@ -14,6 +14,7 @@ class Autocomplete extends SingleMixin(BaseAjax) { export class Importer { constructor(map, options) { this.name = options.name || 'Communes' + this.id = 'communesfr' } async open(importer) { @@ -38,7 +39,7 @@ export class Importer { importer.dialog.open({ content: container, - className: 'communes dark', + className: `${this.id} dark`, }) } } diff --git a/umap/static/umap/js/modules/importers/datasets.js b/umap/static/umap/js/modules/importers/datasets.js index 8f6be2b6..10445644 100644 --- a/umap/static/umap/js/modules/importers/datasets.js +++ b/umap/static/umap/js/modules/importers/datasets.js @@ -5,6 +5,7 @@ export class Importer { constructor(map, options) { this.name = options.name || 'Datasets' this.choices = options?.choices + this.id = 'datasets' } async open(importer) { @@ -34,7 +35,7 @@ export class Importer { importer.dialog.open({ content: container, - className: 'datasets dark', + className: `${this.id} dark`, }) } } diff --git a/umap/static/umap/js/modules/importers/geodatamine.js b/umap/static/umap/js/modules/importers/geodatamine.js index 1706698e..acfdd049 100644 --- a/umap/static/umap/js/modules/importers/geodatamine.js +++ b/umap/static/umap/js/modules/importers/geodatamine.js @@ -40,6 +40,7 @@ export class Importer { this.map = map this.name = options.name || 'GeoDataMine' this.baseUrl = options?.url || 'https://geodatamine.fr' + this.id = 'geodatamine' } async open(importer) { @@ -85,7 +86,7 @@ export class Importer { importer.dialog.open({ content: container, - className: 'geodatamine dark', + className: `${this.id} dark`, }) } } diff --git a/umap/static/umap/js/modules/importers/overpass.js b/umap/static/umap/js/modules/importers/overpass.js index 012b58b4..58fe5e42 100644 --- a/umap/static/umap/js/modules/importers/overpass.js +++ b/umap/static/umap/js/modules/importers/overpass.js @@ -37,6 +37,7 @@ export class Importer { this.map = map this.name = options.name || 'Overpass' this.baseUrl = options?.url || 'https://overpass-api.de/api/interpreter' + this.id = 'overpass' } async open(importer) { @@ -76,7 +77,7 @@ export class Importer { importer.dialog.open({ content: container, - className: 'overpass dark', + className: `${this.id} dark`, }) } }