umap-project 2.1.3__py3-none-any.whl → 2.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of umap-project might be problematic. Click here for more details.
- umap/__init__.py +1 -1
- umap/context_processors.py +1 -0
- umap/locale/br/LC_MESSAGES/django.mo +0 -0
- umap/locale/en/LC_MESSAGES/django.po +32 -32
- umap/locale/hu/LC_MESSAGES/django.mo +0 -0
- umap/locale/it/LC_MESSAGES/django.mo +0 -0
- umap/locale/ms/LC_MESSAGES/django.mo +0 -0
- umap/migrations/0020_alter_tilelayer_url_template.py +19 -0
- umap/migrations/0021_remove_map_description.py +16 -0
- umap/models.py +8 -6
- umap/settings/base.py +1 -0
- umap/static/umap/base.css +43 -156
- umap/static/umap/content.css +7 -25
- umap/static/umap/css/icon.css +112 -0
- umap/static/umap/css/panel.css +140 -0
- umap/static/umap/img/16-white.svg +5 -1
- umap/static/umap/img/16.svg +7 -4
- umap/static/umap/img/24-white.svg +3 -1
- umap/static/umap/img/24.svg +3 -4
- umap/static/umap/img/source/16-white.svg +176 -940
- umap/static/umap/img/source/16.svg +8 -5
- umap/static/umap/img/source/24-white.svg +5 -3
- umap/static/umap/img/source/24.svg +6 -7
- umap/static/umap/js/modules/browser.js +97 -73
- umap/static/umap/js/modules/dompurify.js +12 -0
- umap/static/umap/js/modules/facets.js +149 -0
- umap/static/umap/js/modules/global.js +9 -1
- umap/static/umap/js/modules/i18n.js +7 -0
- umap/static/umap/js/modules/orderable.js +84 -0
- umap/static/umap/js/modules/panel.js +76 -0
- umap/static/umap/js/modules/request.js +0 -1
- umap/static/umap/js/modules/schema.js +324 -223
- umap/static/umap/js/modules/urls.js +1 -16
- umap/static/umap/js/modules/utils.js +340 -0
- umap/static/umap/js/umap.autocomplete.js +40 -25
- umap/static/umap/js/umap.controls.js +227 -369
- umap/static/umap/js/umap.core.js +77 -366
- umap/static/umap/js/umap.datalayer.permissions.js +1 -1
- umap/static/umap/js/umap.features.js +62 -42
- umap/static/umap/js/umap.forms.js +128 -36
- umap/static/umap/js/umap.icon.js +11 -4
- umap/static/umap/js/umap.importer.js +78 -57
- umap/static/umap/js/umap.js +179 -156
- umap/static/umap/js/umap.layer.js +79 -40
- umap/static/umap/js/umap.permissions.js +13 -9
- umap/static/umap/js/umap.popup.js +26 -30
- umap/static/umap/js/umap.share.js +12 -9
- umap/static/umap/js/umap.tableeditor.js +4 -6
- umap/static/umap/js/umap.ui.js +10 -60
- umap/static/umap/locale/am_ET.js +243 -227
- umap/static/umap/locale/am_ET.json +21 -9
- umap/static/umap/locale/ar.js +243 -227
- umap/static/umap/locale/ar.json +21 -9
- umap/static/umap/locale/ast.js +243 -227
- umap/static/umap/locale/ast.json +21 -9
- umap/static/umap/locale/bg.js +243 -227
- umap/static/umap/locale/bg.json +21 -9
- umap/static/umap/locale/br.js +253 -237
- umap/static/umap/locale/br.json +25 -13
- umap/static/umap/locale/ca.js +243 -227
- umap/static/umap/locale/ca.json +21 -9
- umap/static/umap/locale/cs_CZ.js +243 -227
- umap/static/umap/locale/cs_CZ.json +21 -9
- umap/static/umap/locale/da.js +243 -227
- umap/static/umap/locale/da.json +21 -9
- umap/static/umap/locale/de.js +243 -227
- umap/static/umap/locale/de.json +21 -9
- umap/static/umap/locale/el.js +243 -227
- umap/static/umap/locale/el.json +21 -9
- umap/static/umap/locale/en.js +243 -234
- umap/static/umap/locale/en.json +22 -10
- umap/static/umap/locale/en_US.json +21 -9
- umap/static/umap/locale/es.js +243 -227
- umap/static/umap/locale/es.json +21 -9
- umap/static/umap/locale/et.js +243 -227
- umap/static/umap/locale/et.json +21 -9
- umap/static/umap/locale/eu.js +227 -199
- umap/static/umap/locale/eu.json +1 -1
- umap/static/umap/locale/fa_IR.js +243 -227
- umap/static/umap/locale/fa_IR.json +21 -9
- umap/static/umap/locale/fi.js +243 -227
- umap/static/umap/locale/fi.json +21 -9
- umap/static/umap/locale/fr.js +243 -234
- umap/static/umap/locale/fr.json +21 -9
- umap/static/umap/locale/gl.js +243 -227
- umap/static/umap/locale/gl.json +21 -9
- umap/static/umap/locale/he.js +243 -227
- umap/static/umap/locale/he.json +21 -9
- umap/static/umap/locale/hr.js +243 -227
- umap/static/umap/locale/hr.json +21 -9
- umap/static/umap/locale/hu.js +243 -234
- umap/static/umap/locale/hu.json +21 -9
- umap/static/umap/locale/id.js +243 -227
- umap/static/umap/locale/id.json +21 -9
- umap/static/umap/locale/is.js +243 -227
- umap/static/umap/locale/is.json +21 -9
- umap/static/umap/locale/it.js +243 -234
- umap/static/umap/locale/it.json +21 -9
- umap/static/umap/locale/ja.js +243 -227
- umap/static/umap/locale/ja.json +21 -9
- umap/static/umap/locale/ko.js +243 -227
- umap/static/umap/locale/ko.json +21 -9
- umap/static/umap/locale/lt.js +243 -227
- umap/static/umap/locale/lt.json +21 -9
- umap/static/umap/locale/ms.js +243 -234
- umap/static/umap/locale/ms.json +22 -10
- umap/static/umap/locale/nl.js +246 -230
- umap/static/umap/locale/nl.json +21 -9
- umap/static/umap/locale/no.js +243 -227
- umap/static/umap/locale/no.json +21 -9
- umap/static/umap/locale/pl.js +243 -227
- umap/static/umap/locale/pl.json +21 -9
- umap/static/umap/locale/pl_PL.json +21 -9
- umap/static/umap/locale/pt.js +243 -227
- umap/static/umap/locale/pt.json +21 -9
- umap/static/umap/locale/pt_BR.js +243 -227
- umap/static/umap/locale/pt_BR.json +21 -9
- umap/static/umap/locale/pt_PT.js +243 -227
- umap/static/umap/locale/pt_PT.json +21 -9
- umap/static/umap/locale/ro.js +243 -227
- umap/static/umap/locale/ro.json +21 -9
- umap/static/umap/locale/ru.js +243 -227
- umap/static/umap/locale/ru.json +21 -9
- umap/static/umap/locale/si.js +1 -1
- umap/static/umap/locale/si.json +1 -1
- umap/static/umap/locale/sk_SK.js +243 -227
- umap/static/umap/locale/sk_SK.json +21 -9
- umap/static/umap/locale/sl.js +243 -227
- umap/static/umap/locale/sl.json +21 -9
- umap/static/umap/locale/sr.js +243 -227
- umap/static/umap/locale/sr.json +21 -9
- umap/static/umap/locale/sv.js +243 -227
- umap/static/umap/locale/sv.json +21 -9
- umap/static/umap/locale/th_TH.js +243 -227
- umap/static/umap/locale/th_TH.json +21 -9
- umap/static/umap/locale/tr.js +243 -227
- umap/static/umap/locale/tr.json +21 -9
- umap/static/umap/locale/uk_UA.js +243 -227
- umap/static/umap/locale/uk_UA.json +21 -9
- umap/static/umap/locale/vi.js +243 -227
- umap/static/umap/locale/vi.json +21 -9
- umap/static/umap/locale/vi_VN.json +21 -9
- umap/static/umap/locale/zh.js +243 -227
- umap/static/umap/locale/zh.json +21 -9
- umap/static/umap/locale/zh_CN.json +21 -9
- umap/static/umap/locale/zh_TW.Big5.json +21 -9
- umap/static/umap/locale/zh_TW.js +243 -234
- umap/static/umap/locale/zh_TW.json +21 -9
- umap/static/umap/map.css +124 -264
- umap/static/umap/test/DataLayer.js +463 -0
- umap/static/umap/test/Feature.js +0 -226
- umap/static/umap/test/TableEditor.js +104 -0
- umap/static/umap/test/Util.js +0 -521
- umap/static/umap/test/index.html +0 -1
- umap/static/umap/unittests/URLs.js +1 -1
- umap/static/umap/unittests/utils.js +610 -0
- umap/static/umap/vars.css +9 -0
- umap/static/umap/vendors/dompurify/purify.es.mjs +1525 -0
- umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +1 -0
- umap/static/umap/vendors/iconlayers/iconLayers.js +1 -1
- umap/templates/umap/css.html +2 -0
- umap/templates/umap/js.html +0 -1
- umap/templates/umap/map_detail.html +4 -0
- umap/templates/umap/map_table.html +12 -10
- umap/templatetags/umap_tags.py +5 -0
- umap/tests/integration/conftest.py +12 -1
- umap/tests/integration/test_anonymous_owned_map.py +27 -5
- umap/tests/integration/test_basics.py +21 -0
- umap/tests/integration/test_browser.py +12 -25
- umap/tests/integration/test_choropleth.py +1 -1
- umap/tests/integration/test_dashboard.py +10 -0
- umap/tests/integration/test_datalayer.py +8 -6
- umap/tests/integration/test_edit_datalayer.py +24 -19
- umap/tests/integration/test_edit_map.py +189 -2
- umap/tests/integration/test_edit_marker.py +120 -0
- umap/tests/integration/test_edit_polygon.py +122 -0
- umap/tests/integration/test_facets_browser.py +104 -14
- umap/tests/integration/test_import.py +72 -20
- umap/tests/integration/test_map.py +19 -17
- umap/tests/integration/test_map_list.py +28 -0
- umap/tests/integration/test_owned_map.py +10 -10
- umap/tests/integration/test_picto.py +5 -5
- umap/tests/integration/test_querystring.py +9 -15
- umap/tests/integration/test_slideshow.py +0 -5
- umap/tests/integration/test_statics.py +3 -2
- umap/tests/integration/test_tableeditor.py +1 -5
- umap/tests/integration/test_tilelayer.py +10 -0
- umap/tests/integration/test_view_marker.py +64 -0
- umap/tests/integration/test_view_polygon.py +59 -0
- umap/tests/integration/test_view_polyline.py +51 -0
- umap/tests/test_map_views.py +13 -0
- {umap_project-2.1.3.dist-info → umap_project-2.2.0.dist-info}/METADATA +12 -12
- {umap_project-2.1.3.dist-info → umap_project-2.2.0.dist-info}/RECORD +198 -182
- {umap_project-2.1.3.dist-info → umap_project-2.2.0.dist-info}/WHEEL +1 -1
- umap/static/umap/vendors/dompurify/purify.min.js +0 -3
- umap/static/umap/vendors/dompurify/purify.min.js.map +0 -1
- /umap/tests/integration/{test_polygon.py → test_draw_polygon.py} +0 -0
- /umap/tests/integration/{test_polyline.py → test_draw_polyline.py} +0 -0
- {umap_project-2.1.3.dist-info → umap_project-2.2.0.dist-info}/entry_points.txt +0 -0
- {umap_project-2.1.3.dist-info → umap_project-2.2.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<path d="M 16.0401,2.3158 H 2.005 v 14.0351 h 14.0351 z" fill="#ffffff" id="path2351" />
|
|
11
11
|
</mask>
|
|
12
12
|
</defs>
|
|
13
|
-
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="
|
|
13
|
+
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="21.380532" inkscape:cx="34.119824" inkscape:cy="18.264279" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" inkscape:window-width="1920" inkscape:window-height="1011" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" showguides="true" inkscape:guide-bbox="true" inkscape:snap-grids="true" inkscape:snap-to-guides="true" inkscape:showpageshadow="2" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1">
|
|
14
14
|
<inkscape:grid type="xygrid" id="grid3004" empspacing="4" visible="true" enabled="true" snapvisiblegridlinesonly="true" originx="0" originy="0" spacingy="1" spacingx="1" units="px" />
|
|
15
15
|
<sodipodi:guide orientation="-1,0" position="24,168" id="guide3084" inkscape:locked="false" inkscape:label="" inkscape:color="rgb(0,134,229)" />
|
|
16
16
|
<sodipodi:guide orientation="0,1" position="0,120" id="guide3086" inkscape:locked="false" inkscape:label="" inkscape:color="rgb(0,134,229)" />
|
|
@@ -54,9 +54,7 @@
|
|
|
54
54
|
<path inkscape:connector-curvature="0" style="fill:#f2f2f2;fill-opacity:1;stroke:none" d="m 12,913.36213 c -3.865993,0 -7,3.134 -7,7 0,3.8661 3.134007,7.0001 7,7.0001 3.865993,0 7,-3.134 7,-7.0001 0,-3.866 -3.134007,-7 -7,-7 z m -0.15625,1.7187 a 1.250125,1.250125 0 0 1 0.125,0 1.250125,1.250125 0 0 1 1.28125,1.2813 v 2.75 H 16 a 1.250125,1.250125 0 1 1 0,2.5 h -2.75 v 2.7501 a 1.250125,1.250125 0 1 1 -2.5,0 v -2.7501 H 8 a 1.2515615,1.2515615 0 0 1 -0.125,-2.5 1.250125,1.250125 0 0 1 0.125,0 h 2.75 v -2.75 a 1.250125,1.250125 0 0 1 1.09375,-1.2813 z" id="path5340" inkscape:export-filename="/home/ybon/Code/js/leaflet-storage/src/img/zoom-grey-16.png" inkscape:export-xdpi="89.996864" inkscape:export-ydpi="89.996864" />
|
|
55
55
|
<path style="fill:#464646;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 54,819.36218 v 2 h 12 v -2 z m 0,3 v 1 h 4 v -1 z m 5,0 v 1 h 7 v -1 z m -5,2 v 1 h 4 v -1 z m 5,0 v 1 h 7 v -1 z m -5,2 v 1 h 4 v -1 z m 5,0 v 1 h 7 v -1 z m -5,2 v 1 h 4 v -1 z m 5,0 v 1 h 7 v -1 z" id="table" inkscape:connector-curvature="0" inkscape:label="" inkscape:export-filename="/home/ybon/Code/js/leaflet-storage/src/img/browse-data.png" inkscape:export-xdpi="89.996864" inkscape:export-ydpi="89.996864" />
|
|
56
56
|
<g transform="translate(32,-54.000118)" style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#4d4d4d;fill-opacity:1;stroke:none" id="text3784-6" />
|
|
57
|
-
<
|
|
58
|
-
<path inkscape:connector-curvature="0" id="path4384" style="font-variant:normal;font-stretch:normal;font-size:20px;font-family:Arial;-inkscape-font-specification:Arial;fill:#4d4d4d" d="m 35.742187,999.43835 3.076172,-3.07617 -3.066406,-3.0664 1.191406,-1.19141 3.066407,3.06641 3.05664,-3.05664 1.171875,1.18164 -3.046875,3.05664 3.066406,3.0664 -1.191406,1.19138 L 40,997.54382 36.923828,1000.62 35.742187,999.43835" />
|
|
59
|
-
</g>
|
|
57
|
+
<path id="close-9" style="color:#000000;fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.188976;stroke-dasharray:none;stroke-opacity:1" d="m 32.353032,820.00818 -0.707032,0.70704 3.646485,3.64648 -3.646485,3.64648 0.707032,0.70704 3.646484,-3.64649 3.646484,3.64649 0.707032,-0.70704 -3.646485,-3.64648 3.646485,-3.64648 -0.707032,-0.70704 -3.646484,3.64649 z" />
|
|
60
58
|
<path inkscape:connector-curvature="0" d="m 11.192241,853.36196 2e-6,-4.19993 -4.192255,1e-5 -3e-6,-1.62667 h 4.192263 v -4.17331 l 1.608812,0.007 0.0067,4.16664 h 4.192255 l -3.9e-5,1.62662 -4.19222,4e-5 -1.5e-5,4.19994 h -1.615475" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20px;line-height:125%;font-family:Arial;-inkscape-font-specification:Arial;letter-spacing:0px;word-spacing:0px;fill:#4d4d4d;fill-opacity:1;stroke:none" id="add" />
|
|
61
59
|
<path style="fill:#4d4d4d;fill-opacity:1;stroke:none" d="m 63.71429,866.36218 -1.14285,1.14286 2.28571,2.28572 L 66,868.6479 Z M 62,868.07646 l -6.285714,6.28574 2.285715,2.2857 6.285719,-6.28572 z M 55.714286,874.3622 54,878.36219 58.000001,876.6479 Z" id="edit" inkscape:connector-curvature="0" sodipodi:nodetypes="cccccccccccccc" />
|
|
62
60
|
<text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" x="39.647079" y="918.79706" id="text4457-6"><tspan y="918.79706" x="39.647079" sodipodi:role="line" id="tspan4459-6" style="font-size:30.4762px;line-height:1.25;font-family:sans-serif"> </tspan></text>
|
|
@@ -196,6 +194,11 @@
|
|
|
196
194
|
<path style="fill:#464646;fill-opacity:1;stroke-width:0.727273" d="m 42.545455,974.90763 c 0,0.80333 -0.651223,1.45455 -1.454546,1.45455 H 30.909091 c -0.803323,0 -1.454546,-0.65122 -1.454546,-1.45455 2.557093,0 9.805435,0 13.09091,0 z" id="path8303-6" />
|
|
197
195
|
<path style="fill:none;fill-rule:evenodd;stroke:#464646;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1)" d="m 36,963.87832 v 8.3163" id="path16669" sodipodi:nodetypes="cc" />
|
|
198
196
|
</g>
|
|
199
|
-
<path id="copy" style="fill:#4d4d4d;paint-order:fill markers stroke" d="m
|
|
197
|
+
<path id="copy" style="fill:#4d4d4d;paint-order:fill markers stroke" d="m 154.25,962.61218 v 3.5 h 4 v 4 h 3.5 v -7.5 z m -4,4 v 7.5 h 7.5 v -7.5 z" />
|
|
198
|
+
<path style="fill:none;fill-rule:evenodd;stroke:#4d4d4d;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:none" d="m 134,964.36218 -4,4 4.28879,3.97691" id="path1" sodipodi:nodetypes="ccc" />
|
|
199
|
+
<path d="m 113.37897,943.55658 0.9072,0.5491 c 0.1786,0.10817 0.2366,0.34196 0.1294,0.52223 -0.0319,0.0535 -0.0764,0.0983 -0.1294,0.13055 l -7.00717,4.24121 -7.00708,-4.24121 c -0.17869,-0.10817 -0.23664,-0.34196 -0.12942,-0.52222 0.0319,-0.0536 0.0763,-0.0984 0.12942,-0.13056 l 0.90714,-0.5491 6.09994,3.69219 z m 0,3.57799 0.9072,0.5491 c 0.1786,0.1081 0.2366,0.3419 0.1294,0.5222 -0.0319,0.0535 -0.0764,0.0983 -0.1294,0.1306 l -6.61891,4.0061 c -0.239,0.1447 -0.53753,0.1447 -0.77652,0 l -6.61882,-4.0061 c -0.17869,-0.1082 -0.23664,-0.342 -0.12942,-0.5223 0.0319,-0.0536 0.0763,-0.0984 0.12942,-0.1305 l 0.90714,-0.5491 6.09994,3.6921 z m -5.71171,-10.57501 6.61891,4.00621 c 0.1786,0.10815 0.2366,0.34196 0.1294,0.52222 -0.0319,0.0536 -0.0764,0.0984 -0.1294,0.13056 l -7.00717,4.24119 -7.00708,-4.24119 c -0.17869,-0.10815 -0.23664,-0.34196 -0.12942,-0.52222 0.0319,-0.0536 0.0763,-0.0984 0.12942,-0.13056 l 6.61882,-4.00621 c 0.23899,-0.14465 0.53752,-0.14465 0.77652,0 z" fill="#4d4d4d" id="path437" style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.178;stroke-dasharray:none;stroke-opacity:1" />
|
|
200
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="m 87.166638,966.62162 -3.166579,-2.99638 -3.166613,2.99638 -0.833375,-0.78858 3.4333,-3.24873 c 0.312979,-0.29613 0.82041,-0.29613 1.133389,0 l 3.43324,3.24873 z m -6.333275,3.48122 3.166626,2.99639 3.166649,-2.99639 0.833362,0.78859 -3.433322,3.24872 c -0.312968,0.29608 -0.820411,0.29608 -1.133378,0 l -3.4333,-3.24872 z" fill="#efefef" id="path1-675" style="stroke-width:0.999996;fill:#464646;fill-opacity:1" />
|
|
201
|
+
<path style="fill:#464646;fill-opacity:1;stroke-width:0.999996" d="m 63.166637,974.36218 -3.166626,-2.99639 -3.166649,2.99639 -0.833362,-0.78859 3.433322,-3.24872 c 0.312968,-0.29608 0.820411,-0.29608 1.133378,0 l 3.4333,3.24872 z" id="path5" />
|
|
202
|
+
<path style="fill:#464646;fill-opacity:1;stroke-width:0.999996" d="m 56.000071,963.15076 3.43324,3.24873 c 0.312979,0.29613 0.82041,0.29613 1.133389,0 l 3.4333,-3.24873 -0.833375,-0.78858 -3.166613,2.99638 -3.166579,-2.99638 z" id="path1-675-2" />
|
|
200
203
|
</g>
|
|
201
204
|
</svg>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
2
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
3
|
|
|
4
|
-
<svg width="180" height="180" viewBox="0 0 47.624994 47.624994" version="1.1" id="svg2876" inkscape:version="1.3 (
|
|
5
|
-
<sodipodi:namedview id="namedview2878" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" showgrid="true" showguides="true" inkscape:zoom="8.
|
|
4
|
+
<svg width="180" height="180" viewBox="0 0 47.624994 47.624994" version="1.1" id="svg2876" inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)" sodipodi:docname="24-white.svg" inkscape:export-filename="../24-white.svg" inkscape:export-xdpi="7.52" inkscape:export-ydpi="7.52" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
|
5
|
+
<sodipodi:namedview id="namedview2878" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" showgrid="true" showguides="true" inkscape:zoom="8.2673128" inkscape:cx="89.569612" inkscape:cy="93.077402" inkscape:window-width="1920" inkscape:window-height="1011" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="layer1">
|
|
6
6
|
<inkscape:grid type="xygrid" id="grid2997" empspacing="4" originx="0" originy="0" spacingy="0.2645833" spacingx="0.2645833" units="px" visible="true" />
|
|
7
7
|
<sodipodi:guide position="9.525,47.625" orientation="-1,0" id="guide3404" inkscape:locked="false" inkscape:label="" inkscape:color="rgb(0,134,229)" />
|
|
8
8
|
<sodipodi:guide position="0,38.099995" orientation="0,1" id="guide3408" inkscape:locked="false" inkscape:label="" inkscape:color="rgb(0,134,229)" />
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
<path style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#f2f2f2;fill-opacity:1;stroke:#999999;stroke-width:0.0661458;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker:none;enable-background:accumulate" d="m 2.8497553,33.337461 v 0.132292 0.79375 0.132292 h 0.132292 0.347266 l -0.42168,3.704166 h -0.454753 -0.132291 v 0.132292 0.79375 0.132292 h 0.132291 0.79375 0.132292 v -0.132292 -0.421693 c 0,0 3.6291619,-2.885599 3.6297519,-2.885599 h 0.47129 0.132291 v -0.132291 -0.79375 -0.132292 h -0.132291 -0.79375 -0.132292 v 0.132292 0.214974 l -2.645833,-0.95086 v -0.587031 -0.132292 h -0.132292 -0.7937499 z m 0.264584,0.264584 h 0.5291659 v 0.529166 h -0.5291659 z m 3.7041659,1.322916 h 0.529167 v 0.529167 h -0.529167 z m -4.2333329,3.439584 h 0.529167 v 0.529166 h -0.529167 z" id="rect4058-1-2" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccc" />
|
|
55
55
|
<path style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#f2f2f2;fill-opacity:1;stroke:#999999;stroke-width:0.0661458;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker:none;enable-background:accumulate" d="m 4.9168132,40.216628 h -0.926042 -0.132292 v 0.132292 0.79375 0.132291 h 0.132292 0.79375 0.132292 v -0.132291 -0.421667 l 2.645833,-0.181901 v 0.338984 0.132292 h 0.132292 0.793749 0.132292 v -0.132292 -0.79375 -0.132291 h -0.132292 -0.305924 l -0.644922,-2.116667 h 0.471289 0.132292 v -0.132292 -0.79375 -0.132291 h -0.132292 -0.79375 -0.181901 c 0,0.79375 0,0.79375 0,0.79375 0,0 -2.067057,2.645833 -2.116666,2.645833 z m 2.430859,-3.175 h 0.529167 v 0.529167 h -0.529167 z m 0.479557,3.175 h 0.529167 v 0.529167 h -0.529167 z m -3.704166,0.264583 c 0.529166,0 0,0 0.529166,0 v 0.529167 h -0.529166 z" id="rect4058-1-2-0" inkscape:connector-curvature="0" sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccc" />
|
|
56
56
|
</g>
|
|
57
|
-
<path style="fill:#f2f2f2;fill-opacity:1;stroke:#999999;stroke-width:0.0661458;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="m 23.812498,26.987496 c 1.753504,0 3.175,-1.4215 3.175,-3.175 0,-1.753499 -1.421496,-3.174999 -3.175,-3.174999 -1.753505,0 -3.175,1.4215 -3.175,3.174999 0,1.7535 1.421495,3.175 3.175,3.175 z m 0,-1.322916 -1.852083,-1.852084 h 1.322916 v -1.587499 h 1.058333 v 1.587499 h 1.322917 z" id="download" class="sprite" />
|
|
58
57
|
<g id="multiline">
|
|
59
58
|
<path inkscape:connector-curvature="0" style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#f2f2f2;fill-opacity:1;stroke:#999999;stroke-width:0.0661458;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker:none;enable-background:accumulate" d="m 11.906249,29.898045 v 0.132292 0.79375 0.132292 h 0.132291 0.79375 0.132292 v -0.132292 -0.09096 l 2.645832,1.058334 v 0.355547 0.115755 l 0.289388,0.0164 h 0.636654 0.132292 v -0.132292 -0.79375 -0.132291 h -0.132292 -0.79375 -0.132292 v 0.132291 0.148829 l -2.645832,-1.058334 v -0.413411 -0.132292 h -0.132292 -0.79375 z m 0.264583,0.264584 h 0.529167 v 0.529166 h -0.529167 z m 3.704166,1.322916 h 0.529166 v 0.529167 h -0.529166 z" id="rect4058-9" sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccc" />
|
|
60
59
|
<path inkscape:connector-curvature="0" style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#f2f2f2;fill-opacity:1;stroke:#999999;stroke-width:0.0661458;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker:none;enable-background:accumulate" d="m 12.989387,32.320492 v 0.355547 0.115755 l 1.876888,2.926953 h 0.636653 0.132292 v 0.132292 0.79375 0.132291 h -0.132292 -0.79375 -0.132291 v -0.132291 -0.79375 -0.09922 l -1.876888,-2.94349 h -0.636654 -0.132292 v -0.132291 -0.79375 -0.132292 h 0.132292 0.79375 0.132292 v 0.132292 0.148828 z m -0.264584,-0.305912 h -0.529166 v 0.529167 h 0.529166 z m 2.645834,3.96875 h -0.529167 v 0.529167 h 0.529167 z" id="rect4058-9-5" sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccc" />
|
|
@@ -79,5 +78,8 @@
|
|
|
79
78
|
</g>
|
|
80
79
|
<path d="m 24.352274,6.3088036 h 0.03307 v -0.033073 -3.5463449 -0.033073 h -0.03307 -3.713451 -0.03307 v 0.033073 3.5463449 0.033073 h 0.03307 z m -3.978696,-4.1590643 h 4.24394 c 0.06157,0 0.120624,0.024461 0.164174,0.068002 0.04355,0.043541 0.068,0.102595 0.068,0.1641723 v 4.2439399 c 0,0.061569 -0.02445,0.1206236 -0.068,0.164174 -0.04355,0.04355 -0.102605,0.067998 -0.164174,0.067998 h -4.24394 c -0.06158,0 -0.120631,-0.024447 -0.164172,-0.067998 -0.04354,-0.04355 -0.068,-0.1026054 -0.068,-0.164174 v -4.2439399 c 0,-0.061577 0.02446,-0.1206315 0.068,-0.1641723 0.04354,-0.043541 0.102595,-0.068002 0.164172,-0.068002 z" fill="#f2f2f2" stroke="#999999" stroke-width="0.0657188" id="path1286" />
|
|
81
80
|
</g>
|
|
81
|
+
<g id="info" transform="matrix(0.33072916,0,0,0.33072916,-11.906249,-256.10415)" style="stroke-width:0.8">
|
|
82
|
+
<path id="path3762" style="fill:#f2f2f2;fill-opacity:1;stroke:#999999;stroke-width:0.2;stroke-dasharray:none;stroke-opacity:1" d="m 107.99999,838.36217 a 8,8 0 0 0 -7.999998,8 8,8 0 0 0 7.999998,8 8,8 0 0 0 8,-8 8,8 0 0 0 -8,-8 z m 0,2.5 a 1.5,1.5 0 0 1 1.5,1.5 1.5,1.5 0 0 1 -1.5,1.5 1.5,1.5 0 0 1 -1.5,-1.5 1.5,1.5 0 0 1 1.5,-1.5 z m -1,4.5 h 2 v 6 h -2 z" />
|
|
83
|
+
</g>
|
|
82
84
|
</g>
|
|
83
85
|
</svg>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
2
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
3
|
|
|
4
|
-
<svg width="180" height="180" viewBox="0 0 47.624999 47.624999" version="1.1" id="svg6237" inkscape:version="1.
|
|
5
|
-
<sodipodi:namedview id="namedview6239" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" showgrid="true" showguides="true" inkscape:zoom="
|
|
6
|
-
<inkscape:grid type="xygrid" id="grid6358" empspacing="4" originx="0" originy="0" />
|
|
4
|
+
<svg width="180" height="180" viewBox="0 0 47.624999 47.624999" version="1.1" id="svg6237" inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)" sodipodi:docname="24.svg" inkscape:export-filename="../24.svg" inkscape:export-xdpi="7.52" inkscape:export-ydpi="7.52" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
|
5
|
+
<sodipodi:namedview id="namedview6239" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" showgrid="true" showguides="true" inkscape:zoom="11.97607" inkscape:cx="98.404568" inkscape:cy="77.696607" inkscape:window-width="1920" inkscape:window-height="1011" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="layer1">
|
|
6
|
+
<inkscape:grid type="xygrid" id="grid6358" empspacing="4" originx="0" originy="0" spacingy="1" spacingx="1" units="px" visible="true" />
|
|
7
7
|
<sodipodi:guide position="9.5249999,47.624999" orientation="-1,0" id="guide6360" inkscape:locked="false" inkscape:label="" inkscape:color="rgb(0,134,229)" />
|
|
8
8
|
<sodipodi:guide position="19.05,47.625" orientation="-1,0" id="guide6362" inkscape:locked="false" inkscape:label="" inkscape:color="rgb(0,134,229)" />
|
|
9
9
|
<sodipodi:guide position="28.574999,47.625" orientation="-1,0" id="guide6364" inkscape:locked="false" inkscape:label="" inkscape:color="rgb(0,134,229)" />
|
|
@@ -32,10 +32,6 @@
|
|
|
32
32
|
<text id="text4455" y="964.36218" x="49.170559" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#4d4d4d;fill-opacity:1;stroke:none" xml:space="preserve"><tspan style="font-weight:bold;font-size:8px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'Sans Bold';fill:#4d4d4d;fill-opacity:1" y="964.36218" x="49.170559" id="tspan4457" sodipodi:role="line">0</tspan></text>
|
|
33
33
|
<text xml:space="preserve" style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#4d4d4d;fill-opacity:1;stroke:none" x="65.048965" y="964.36218" id="text4459"><tspan sodipodi:role="line" id="tspan4461" x="65.048965" y="964.36218" style="font-weight:bold;font-size:8px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'Sans Bold';fill:#4d4d4d;fill-opacity:1">1</tspan></text>
|
|
34
34
|
</g>
|
|
35
|
-
<g id="copyleft" transform="matrix(0.26458333,0,0,0.26458333,1.5821002,-226.05539)" class="sprite">
|
|
36
|
-
<circle transform="matrix(0.02040816,0,0,0.02040816,74,934.36218)" id="circle3841" r="440" cy="490" cx="490" style="fill:none;stroke:#4d4d4d;stroke-width:100;stroke-opacity:1" />
|
|
37
|
-
<path style="fill:#4d4d4d;fill-opacity:1" id="path3843" d="m 83.918365,938.74993 c -2.653058,0 -4.877549,1.85717 -5.448974,4.34692 h 2.673466 c 0.489792,-1.06125 1.551017,-1.79592 2.775508,-1.79592 1.693875,0 3.061225,1.36734 3.061225,3.06125 0,1.69384 -1.36735,3.06117 -3.061225,3.06117 -1.224491,0 -2.285716,-0.73467 -2.775508,-1.7755 h -2.673466 c 0.571425,2.46942 2.795916,4.32658 5.448974,4.32658 3.102041,0 5.612241,-2.51025 5.612241,-5.61225 0,-3.10208 -2.5102,-5.61225 -5.612241,-5.61225 z" inkscape:connector-curvature="0" />
|
|
38
|
-
</g>
|
|
39
35
|
<g id="markers" transform="matrix(0.26458333,0,0,0.26458333,14.287499,-226.04994)" class="sprite">
|
|
40
36
|
<path sodipodi:nodetypes="sccccsssccs" inkscape:connector-curvature="0" id="rect2985" d="m 105.25387,934.36268 c -3.17753,0 -6.346004,2.1278 -7.25387,6.3794 0,2.551 1.806672,7.6679 7.25387,13.6201 1.46368,-1.5994 2.66945,-3.1177 3.64397,-4.5613 -1.4505,-2.1639 -2.41497,-4.0873 -2.96285,-5.7095 -0.22599,0.041 -0.44225,0.063 -0.68112,0.063 -2.0056,0 -3.64396,-1.5346 -3.64396,-3.413 0,-1.8785 1.63836,-3.3811 3.64396,-3.3811 0.51205,0 0.98854,0.076 1.43034,0.2552 0.64347,-0.9222 1.4345,-1.6571 2.31579,-2.169 -1.14444,-0.7114 -2.44633,-1.0845 -3.74613,-1.0845 z" style="fill:#4d4d4d;fill-opacity:1;stroke:none" />
|
|
41
37
|
<path id="path3378" d="m 111,934.36218 c -3.0625,0 -6.125,2.1277 -7,6.383 0,2.5532 1.75,7.6596 7,13.617 5.25,-5.9574 7,-11.0638 7,-13.617 -0.875,-4.2553 -3.9375,-6.383 -7,-6.383 z m 0,2.9788 c 1.933,0 3.5,1.5241 3.5,3.4042 0,1.8801 -1.567,3.4043 -3.5,3.4043 -1.93299,0 -3.5,-1.5242 -3.5,-3.4043 0,-1.8801 1.56701,-3.4042 3.5,-3.4042 z" style="fill:#4d4d4d;fill-opacity:1;stroke:none" inkscape:connector-curvature="0" />
|
|
@@ -106,5 +102,8 @@
|
|
|
106
102
|
</g>
|
|
107
103
|
<path d="m 25.146689,1.8520833 h -4.243941 c -0.07035,0 -0.137815,0.027946 -0.187558,0.077689 -0.04974,0.049744 -0.07769,0.1172099 -0.07769,0.1875586 v 4.2439405 c 0,0.070353 0.02795,0.1378215 0.07769,0.1875632 0.04974,0.049742 0.11721,0.077682 0.187558,0.077682 h 4.243941 c 0.07035,0 0.137821,-0.02794 0.187563,-0.077682 0.04974,-0.049742 0.07768,-0.1172105 0.07768,-0.1875632 v -4.2439405 c 0,-0.070349 -0.02794,-0.1378151 -0.07768,-0.1875586 -0.04974,-0.049743 -0.11721,-0.077689 -0.187563,-0.077689 z m -0.265245,4.1590648 h -3.713451 v -3.5463453 h 3.713451 z" fill="#464646" id="path2378" style="stroke-width:0.264583" />
|
|
108
104
|
</g>
|
|
105
|
+
<g id="info" transform="matrix(0.33072916,0,0,0.33072916,-11.90625,-256.10415)" style="stroke-width:0.8;fill:#4d4d4d;fill-opacity:1">
|
|
106
|
+
<path id="path3762" style="fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.8" d="M 108 838.36217 A 8 8 0 0 0 100 846.36217 A 8 8 0 0 0 108 854.36217 A 8 8 0 0 0 116 846.36217 A 8 8 0 0 0 108 838.36217 z M 108 840.86217 A 1.5 1.5 0 0 1 109.5 842.36217 A 1.5 1.5 0 0 1 108 843.86217 A 1.5 1.5 0 0 1 106.5 842.36217 A 1.5 1.5 0 0 1 108 840.86217 z M 107 845.36217 L 109 845.36217 L 109 851.36217 L 107 851.36217 L 107 845.36217 z " />
|
|
107
|
+
</g>
|
|
109
108
|
</g>
|
|
110
109
|
</svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
import { DomUtil, DomEvent, stamp } from '../../vendors/leaflet/leaflet-src.esm.js'
|
|
2
|
+
import { translate } from './i18n.js'
|
|
3
3
|
|
|
4
4
|
export default class Browser {
|
|
5
5
|
constructor(map) {
|
|
@@ -15,18 +15,27 @@ export default class Browser {
|
|
|
15
15
|
const filter = this.options.filter
|
|
16
16
|
if (filter && !feature.matchFilter(filter, this.filterKeys)) return
|
|
17
17
|
if (this.options.inBbox && !feature.isOnScreen(this.bounds)) return
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
del
|
|
18
|
+
const row = DomUtil.create('li', `${feature.getClassName()} feature`)
|
|
19
|
+
const zoom_to = DomUtil.createButtonIcon(
|
|
20
|
+
row,
|
|
21
|
+
'icon-zoom',
|
|
22
|
+
translate('Bring feature to center')
|
|
23
|
+
)
|
|
24
|
+
const edit = DomUtil.createButtonIcon(
|
|
25
|
+
row,
|
|
26
|
+
'show-on-edit icon-edit',
|
|
27
|
+
translate('Edit this feature')
|
|
28
|
+
)
|
|
29
|
+
const del = DomUtil.createButtonIcon(
|
|
30
|
+
row,
|
|
31
|
+
'show-on-edit icon-delete',
|
|
32
|
+
translate('Delete this feature')
|
|
33
|
+
)
|
|
34
|
+
const colorBox = DomUtil.create('i', 'icon icon-16 feature-color', row)
|
|
35
|
+
const title = DomUtil.create('span', 'feature-title', row)
|
|
36
|
+
const symbol = feature._getIconUrl
|
|
37
|
+
? U.Icon.prototype.formatUrl(feature._getIconUrl(), feature)
|
|
38
|
+
: null
|
|
30
39
|
title.textContent = feature.getDisplayName() || '—'
|
|
31
40
|
const bgcolor = feature.getDynamicOption('color')
|
|
32
41
|
colorBox.style.backgroundColor = bgcolor
|
|
@@ -34,53 +43,31 @@ export default class Browser {
|
|
|
34
43
|
const icon = U.Icon.makeIconElement(symbol, colorBox)
|
|
35
44
|
U.Icon.setIconContrast(icon, colorBox, symbol, bgcolor)
|
|
36
45
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
this.zoomTo(e)
|
|
43
|
-
},
|
|
44
|
-
feature
|
|
45
|
-
)
|
|
46
|
-
DomEvent.on(
|
|
47
|
-
title,
|
|
48
|
-
'click',
|
|
49
|
-
function (e) {
|
|
50
|
-
e.callback = L.bind(this.view, this)
|
|
51
|
-
this.zoomTo(e)
|
|
52
|
-
},
|
|
53
|
-
feature
|
|
54
|
-
)
|
|
46
|
+
const viewFeature = (e) => {
|
|
47
|
+
feature.zoomTo({ ...e, callback: feature.view })
|
|
48
|
+
}
|
|
49
|
+
DomEvent.on(zoom_to, 'click', viewFeature)
|
|
50
|
+
DomEvent.on(title, 'click', viewFeature)
|
|
55
51
|
DomEvent.on(edit, 'click', feature.edit, feature)
|
|
56
52
|
DomEvent.on(del, 'click', feature.confirmDelete, feature)
|
|
57
53
|
// HOTFIX. Remove when this is released:
|
|
58
54
|
// https://github.com/Leaflet/Leaflet/pull/9052
|
|
59
|
-
DomEvent.disableClickPropagation(
|
|
60
|
-
parent.appendChild(
|
|
55
|
+
DomEvent.disableClickPropagation(row)
|
|
56
|
+
parent.appendChild(row)
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
datalayerId(datalayer) {
|
|
64
|
-
return `browse_data_datalayer_${
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
onDataLayerChanged(e) {
|
|
68
|
-
this.updateDatalayer(e.target)
|
|
60
|
+
return `browse_data_datalayer_${stamp(datalayer)}`
|
|
69
61
|
}
|
|
70
62
|
|
|
71
63
|
addDataLayer(datalayer, parent) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
let className = `datalayer ${datalayer.getHidableClass()}`
|
|
65
|
+
if (this.map.panel.mode !== 'condensed') className += ' show-list'
|
|
66
|
+
const container = DomUtil.create('div', className, parent),
|
|
67
|
+
headline = DomUtil.create('h5', '', container)
|
|
75
68
|
container.id = this.datalayerId(datalayer)
|
|
76
|
-
datalayer.renderToolbox(headline)
|
|
77
|
-
DomUtil.add('span', '', headline, datalayer.options.name)
|
|
78
69
|
const ul = DomUtil.create('ul', '', container)
|
|
79
70
|
this.updateDatalayer(datalayer)
|
|
80
|
-
datalayer.on('datachanged', this.onDataLayerChanged, this)
|
|
81
|
-
this.map.ui.once('panel:closed', () => {
|
|
82
|
-
datalayer.off('datachanged', this.onDataLayerChanged, this)
|
|
83
|
-
})
|
|
84
71
|
}
|
|
85
72
|
|
|
86
73
|
updateDatalayer(datalayer) {
|
|
@@ -90,16 +77,25 @@ export default class Browser {
|
|
|
90
77
|
// Panel is not open
|
|
91
78
|
if (!parent) return
|
|
92
79
|
DomUtil.classIf(parent, 'off', !datalayer.isVisible())
|
|
93
|
-
const container = parent.querySelector('ul')
|
|
94
|
-
|
|
80
|
+
const container = parent.querySelector('ul')
|
|
81
|
+
const headline = parent.querySelector('h5')
|
|
82
|
+
const toggleList = () => parent.classList.toggle('show-list')
|
|
83
|
+
headline.innerHTML = ''
|
|
84
|
+
const toggle = DomUtil.create('i', 'icon icon-16 datalayer-toggle-list', headline)
|
|
85
|
+
DomEvent.on(toggle, 'click', toggleList)
|
|
86
|
+
datalayer.renderToolbox(headline)
|
|
87
|
+
const name = DomUtil.create('span', 'datalayer-name', headline)
|
|
88
|
+
name.textContent = datalayer.options.name
|
|
89
|
+
DomEvent.on(name, 'click', toggleList)
|
|
95
90
|
container.innerHTML = ''
|
|
96
91
|
datalayer.eachFeature((feature) => this.addFeature(feature, container))
|
|
97
92
|
|
|
98
93
|
let total = datalayer.count(),
|
|
99
94
|
current = container.querySelectorAll('li').length,
|
|
100
95
|
count = total == current ? total : `${current}/${total}`
|
|
101
|
-
counter
|
|
102
|
-
counter.
|
|
96
|
+
const counter = DomUtil.create('span', 'datalayer-counter', headline)
|
|
97
|
+
counter.textContent = `(${count})`
|
|
98
|
+
counter.title = translate(`Features in this layer: ${count}`)
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
onFormChange() {
|
|
@@ -109,9 +105,12 @@ export default class Browser {
|
|
|
109
105
|
})
|
|
110
106
|
}
|
|
111
107
|
|
|
108
|
+
isOpen() {
|
|
109
|
+
return !!document.querySelector('.umap-browser')
|
|
110
|
+
}
|
|
111
|
+
|
|
112
112
|
onMoveEnd() {
|
|
113
|
-
|
|
114
|
-
if (!isBrowserOpen) return
|
|
113
|
+
if (!this.isOpen()) return
|
|
115
114
|
const isListDynamic = this.options.inBbox
|
|
116
115
|
this.map.eachBrowsableDataLayer((datalayer) => {
|
|
117
116
|
if (!isListDynamic && !datalayer.hasDynamicData()) return
|
|
@@ -119,41 +118,66 @@ export default class Browser {
|
|
|
119
118
|
})
|
|
120
119
|
}
|
|
121
120
|
|
|
121
|
+
update() {
|
|
122
|
+
if (!this.isOpen()) return
|
|
123
|
+
this.dataContainer.innerHTML = ''
|
|
124
|
+
this.map.eachBrowsableDataLayer((datalayer) => {
|
|
125
|
+
this.addDataLayer(datalayer, this.dataContainer)
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
|
|
122
129
|
open() {
|
|
123
130
|
// Get once but use it for each feature later
|
|
124
131
|
this.filterKeys = this.map.getFilterKeys()
|
|
125
|
-
const container = DomUtil.create('div'
|
|
132
|
+
const container = DomUtil.create('div')
|
|
126
133
|
// HOTFIX. Remove when this is released:
|
|
127
134
|
// https://github.com/Leaflet/Leaflet/pull/9052
|
|
128
135
|
DomEvent.disableClickPropagation(container)
|
|
129
136
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
'umap-browse-title',
|
|
133
|
-
container,
|
|
134
|
-
this.map.getOption('name')
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
+
DomUtil.createTitle(container, translate('Browse data'), 'icon-layers')
|
|
138
|
+
this.tabsMenu(container, 'browse')
|
|
137
139
|
const formContainer = DomUtil.create('div', '', container)
|
|
138
|
-
|
|
140
|
+
this.dataContainer = DomUtil.create('div', '', container)
|
|
139
141
|
|
|
140
142
|
const fields = [
|
|
141
|
-
['options.filter', { handler: 'Input', placeholder:
|
|
142
|
-
['options.inBbox', { handler: 'Switch', label:
|
|
143
|
+
['options.filter', { handler: 'Input', placeholder: translate('Filter') }],
|
|
144
|
+
['options.inBbox', { handler: 'Switch', label: translate('Current map view') }],
|
|
143
145
|
]
|
|
144
|
-
const builder = new
|
|
145
|
-
makeDirty: false,
|
|
146
|
+
const builder = new L.FormBuilder(this, fields, {
|
|
146
147
|
callback: () => this.onFormChange(),
|
|
147
148
|
})
|
|
148
149
|
formContainer.appendChild(builder.build())
|
|
149
150
|
|
|
150
|
-
this.map.
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
this.map.panel.open({
|
|
152
|
+
content: container,
|
|
153
|
+
className: 'umap-browser',
|
|
153
154
|
})
|
|
154
155
|
|
|
155
|
-
this.
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
this.update()
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
static backButton(map) {
|
|
160
|
+
const button = DomUtil.create('li', '')
|
|
161
|
+
DomUtil.create('i', 'icon icon-16 icon-back', button)
|
|
162
|
+
button.title = translate('Back to browser')
|
|
163
|
+
// Fixme: remove me when this is merged and released
|
|
164
|
+
// https://github.com/Leaflet/Leaflet/pull/9052
|
|
165
|
+
DomEvent.disableClickPropagation(button)
|
|
166
|
+
DomEvent.on(button, 'click', map.openBrowser, map)
|
|
167
|
+
return button
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
tabsMenu(container, active) {
|
|
171
|
+
const tabs = L.DomUtil.create('div', 'flat-tabs', container)
|
|
172
|
+
const browse = L.DomUtil.add('button', 'flat tab-browse', tabs, L._('Data'))
|
|
173
|
+
DomEvent.on(browse, 'click', this.open, this)
|
|
174
|
+
if (this.map.options.facetKey) {
|
|
175
|
+
const facets = L.DomUtil.add('button', 'flat tab-facets', tabs, L._('Filters'))
|
|
176
|
+
DomEvent.on(facets, 'click', this.map.facets.open, this.map.facets)
|
|
177
|
+
}
|
|
178
|
+
const info = L.DomUtil.add('button', 'flat tab-info', tabs, L._('About'))
|
|
179
|
+
DomEvent.on(info, 'click', this.map.displayCaption, this.map)
|
|
180
|
+
let el = tabs.querySelector(`.tab-${active}`)
|
|
181
|
+
L.DomUtil.addClass(el, 'on')
|
|
158
182
|
}
|
|
159
183
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {default as DOMPurifyInitializer} from '../../vendors/dompurify/purify.es.mjs'
|
|
2
|
+
import { JSDOM } from 'jsdom'
|
|
3
|
+
|
|
4
|
+
console.log(DOMPurifyInitializer)
|
|
5
|
+
|
|
6
|
+
export default function getPurify() {
|
|
7
|
+
if (typeof window === 'undefined') {
|
|
8
|
+
return DOMPurifyInitializer(new JSDOM('').window)
|
|
9
|
+
} else {
|
|
10
|
+
return DOMPurifyInitializer(window)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { DomUtil, DomEvent, stamp } from '../../vendors/leaflet/leaflet-src.esm.js'
|
|
2
|
+
import { translate } from './i18n.js'
|
|
3
|
+
import * as Utils from './utils.js'
|
|
4
|
+
|
|
5
|
+
export default class Facets {
|
|
6
|
+
constructor(map) {
|
|
7
|
+
this.map = map
|
|
8
|
+
this.selected = {}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
compute(names, defined) {
|
|
12
|
+
const properties = {}
|
|
13
|
+
|
|
14
|
+
names.forEach((name) => {
|
|
15
|
+
const type = defined[name]['type']
|
|
16
|
+
properties[name] = { type: type }
|
|
17
|
+
this.selected[name] = { type: type }
|
|
18
|
+
if (!['date', 'datetime', 'number'].includes(type)) {
|
|
19
|
+
properties[name].choices = []
|
|
20
|
+
this.selected[name].choices = []
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
this.map.eachBrowsableDataLayer((datalayer) => {
|
|
25
|
+
datalayer.eachFeature((feature) => {
|
|
26
|
+
names.forEach((name) => {
|
|
27
|
+
let value = feature.properties[name]
|
|
28
|
+
const type = defined[name]['type']
|
|
29
|
+
const parser = this.getParser(type)
|
|
30
|
+
value = parser(value)
|
|
31
|
+
switch (type) {
|
|
32
|
+
case 'date':
|
|
33
|
+
case 'datetime':
|
|
34
|
+
case 'number':
|
|
35
|
+
if (!isNaN(value)) {
|
|
36
|
+
if (isNaN(properties[name].min) || properties[name].min > value) {
|
|
37
|
+
properties[name].min = value
|
|
38
|
+
}
|
|
39
|
+
if (isNaN(properties[name].max) || properties[name].max < value) {
|
|
40
|
+
properties[name].max = value
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
break
|
|
44
|
+
default:
|
|
45
|
+
value = value || translate('<empty value>')
|
|
46
|
+
if (!properties[name].choices.includes(value)) {
|
|
47
|
+
properties[name].choices.push(value)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
return properties
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
redraw() {
|
|
57
|
+
if (this.isOpen()) this.open()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
isOpen() {
|
|
61
|
+
return !!document.querySelector('.umap-facet-search')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
open() {
|
|
65
|
+
const container = L.DomUtil.create('div', 'umap-facet-search')
|
|
66
|
+
const title = L.DomUtil.add(
|
|
67
|
+
'h3',
|
|
68
|
+
'umap-filter-title',
|
|
69
|
+
container,
|
|
70
|
+
translate('Facet search')
|
|
71
|
+
)
|
|
72
|
+
this.map.browser.tabsMenu(container, 'facets')
|
|
73
|
+
const defined = this.getDefined()
|
|
74
|
+
const names = Object.keys(defined)
|
|
75
|
+
const facetProperties = this.compute(names, defined)
|
|
76
|
+
|
|
77
|
+
const filterFeatures = function () {
|
|
78
|
+
let found = false
|
|
79
|
+
this.map.eachBrowsableDataLayer((datalayer) => {
|
|
80
|
+
datalayer.resetLayer(true)
|
|
81
|
+
if (datalayer.hasDataVisible()) found = true
|
|
82
|
+
})
|
|
83
|
+
// TODO: display a results counter in the panel instead.
|
|
84
|
+
if (!found) {
|
|
85
|
+
this.map.ui.alert({
|
|
86
|
+
content: translate('No results for these facets'),
|
|
87
|
+
level: 'info',
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const fields = names.map((name) => {
|
|
93
|
+
let criteria = facetProperties[name]
|
|
94
|
+
let handler = 'FacetSearchChoices'
|
|
95
|
+
switch (criteria['type']) {
|
|
96
|
+
case 'number':
|
|
97
|
+
handler = 'FacetSearchNumber'
|
|
98
|
+
break
|
|
99
|
+
case 'date':
|
|
100
|
+
handler = 'FacetSearchDate'
|
|
101
|
+
break
|
|
102
|
+
case 'datetime':
|
|
103
|
+
handler = 'FacetSearchDateTime'
|
|
104
|
+
break
|
|
105
|
+
}
|
|
106
|
+
let label = defined[name]['label']
|
|
107
|
+
return [
|
|
108
|
+
`selected.${name}`,
|
|
109
|
+
{
|
|
110
|
+
criteria: criteria,
|
|
111
|
+
handler: handler,
|
|
112
|
+
label: label,
|
|
113
|
+
},
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
const builder = new L.FormBuilder(this, fields, {
|
|
118
|
+
callback: filterFeatures,
|
|
119
|
+
callbackContext: this,
|
|
120
|
+
})
|
|
121
|
+
container.appendChild(builder.build())
|
|
122
|
+
|
|
123
|
+
this.map.panel.open({ content: container })
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
getDefined() {
|
|
127
|
+
const defaultType = 'checkbox'
|
|
128
|
+
const allowedTypes = [defaultType, 'radio', 'number', 'date', 'datetime']
|
|
129
|
+
return (this.map.options.facetKey || '').split(',').reduce((acc, curr) => {
|
|
130
|
+
let [name, label, type] = curr.split('|')
|
|
131
|
+
type = allowedTypes.includes(type) ? type : defaultType
|
|
132
|
+
acc[name] = { label: label || name, type: type }
|
|
133
|
+
return acc
|
|
134
|
+
}, {})
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
getParser(type) {
|
|
138
|
+
switch (type) {
|
|
139
|
+
case 'number':
|
|
140
|
+
return parseFloat
|
|
141
|
+
case 'datetime':
|
|
142
|
+
return (v) => new Date(v)
|
|
143
|
+
case 'date':
|
|
144
|
+
return Utils.parseNaiveDate
|
|
145
|
+
default:
|
|
146
|
+
return (v) => String(v || '')
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import URLs from './urls.js'
|
|
2
2
|
import Browser from './browser.js'
|
|
3
|
+
import Facets from './facets.js'
|
|
4
|
+
import { Panel, EditPanel, FullPanel } from './panel.js'
|
|
3
5
|
import * as Utils from './utils.js'
|
|
4
|
-
import {SCHEMA} from './schema.js'
|
|
6
|
+
import { SCHEMA } from './schema.js'
|
|
5
7
|
import { Request, ServerRequest, RequestError, HTTPError, NOKError } from './request.js'
|
|
8
|
+
import Orderable from './orderable.js'
|
|
6
9
|
|
|
7
10
|
// Import modules and export them to the global scope.
|
|
8
11
|
// For the not yet module-compatible JS out there.
|
|
@@ -15,6 +18,11 @@ window.U = {
|
|
|
15
18
|
HTTPError,
|
|
16
19
|
NOKError,
|
|
17
20
|
Browser,
|
|
21
|
+
Facets,
|
|
22
|
+
Panel,
|
|
23
|
+
EditPanel,
|
|
24
|
+
FullPanel,
|
|
18
25
|
Utils,
|
|
19
26
|
SCHEMA,
|
|
27
|
+
Orderable,
|
|
20
28
|
}
|
|
@@ -17,6 +17,13 @@ export function registerLocale(code, locale) {
|
|
|
17
17
|
export function setLocale(code) {
|
|
18
18
|
locale = code
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
// Until we have a proper way to load `locale` directly from this module,
|
|
22
|
+
// without copying to window.L we need to have a getter
|
|
23
|
+
export function getLocale() {
|
|
24
|
+
return locale
|
|
25
|
+
}
|
|
26
|
+
|
|
20
27
|
// @function translate(string: String, data?: Object): String
|
|
21
28
|
// Actually try to translate the `string`, with optionnal variable passed in `data`.
|
|
22
29
|
export function translate(string, data = {}) {
|