umap-project 2.1.3__py3-none-any.whl → 2.2.0b0__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.

Files changed (196) hide show
  1. umap/__init__.py +1 -1
  2. umap/context_processors.py +1 -0
  3. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/en/LC_MESSAGES/django.po +32 -32
  5. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  6. umap/locale/it/LC_MESSAGES/django.mo +0 -0
  7. umap/locale/ms/LC_MESSAGES/django.mo +0 -0
  8. umap/migrations/0020_alter_tilelayer_url_template.py +19 -0
  9. umap/migrations/0021_remove_map_description.py +16 -0
  10. umap/models.py +8 -6
  11. umap/settings/base.py +1 -0
  12. umap/static/umap/base.css +29 -151
  13. umap/static/umap/content.css +7 -25
  14. umap/static/umap/css/icon.css +112 -0
  15. umap/static/umap/css/panel.css +140 -0
  16. umap/static/umap/img/16-white.svg +5 -1
  17. umap/static/umap/img/16.svg +7 -4
  18. umap/static/umap/img/24-white.svg +3 -1
  19. umap/static/umap/img/24.svg +3 -4
  20. umap/static/umap/img/source/16-white.svg +176 -940
  21. umap/static/umap/img/source/16.svg +8 -5
  22. umap/static/umap/img/source/24-white.svg +5 -3
  23. umap/static/umap/img/source/24.svg +6 -7
  24. umap/static/umap/js/modules/browser.js +82 -73
  25. umap/static/umap/js/modules/dompurify.js +12 -0
  26. umap/static/umap/js/modules/facets.js +148 -0
  27. umap/static/umap/js/modules/global.js +9 -1
  28. umap/static/umap/js/modules/i18n.js +7 -0
  29. umap/static/umap/js/modules/orderable.js +84 -0
  30. umap/static/umap/js/modules/panel.js +76 -0
  31. umap/static/umap/js/modules/request.js +0 -1
  32. umap/static/umap/js/modules/schema.js +324 -223
  33. umap/static/umap/js/modules/urls.js +1 -16
  34. umap/static/umap/js/modules/utils.js +340 -0
  35. umap/static/umap/js/umap.controls.js +183 -330
  36. umap/static/umap/js/umap.core.js +60 -364
  37. umap/static/umap/js/umap.datalayer.permissions.js +1 -1
  38. umap/static/umap/js/umap.features.js +60 -40
  39. umap/static/umap/js/umap.forms.js +111 -25
  40. umap/static/umap/js/umap.icon.js +11 -4
  41. umap/static/umap/js/umap.importer.js +24 -17
  42. umap/static/umap/js/umap.js +170 -145
  43. umap/static/umap/js/umap.layer.js +71 -40
  44. umap/static/umap/js/umap.permissions.js +9 -11
  45. umap/static/umap/js/umap.popup.js +10 -21
  46. umap/static/umap/js/umap.share.js +11 -8
  47. umap/static/umap/js/umap.tableeditor.js +4 -6
  48. umap/static/umap/js/umap.ui.js +0 -51
  49. umap/static/umap/locale/am_ET.js +242 -227
  50. umap/static/umap/locale/am_ET.json +18 -7
  51. umap/static/umap/locale/ar.js +242 -227
  52. umap/static/umap/locale/ar.json +18 -7
  53. umap/static/umap/locale/ast.js +242 -227
  54. umap/static/umap/locale/ast.json +18 -7
  55. umap/static/umap/locale/bg.js +242 -227
  56. umap/static/umap/locale/bg.json +18 -7
  57. umap/static/umap/locale/br.js +252 -237
  58. umap/static/umap/locale/br.json +22 -11
  59. umap/static/umap/locale/ca.js +242 -227
  60. umap/static/umap/locale/ca.json +18 -7
  61. umap/static/umap/locale/cs_CZ.js +242 -227
  62. umap/static/umap/locale/cs_CZ.json +18 -7
  63. umap/static/umap/locale/da.js +242 -227
  64. umap/static/umap/locale/da.json +18 -7
  65. umap/static/umap/locale/de.js +242 -227
  66. umap/static/umap/locale/de.json +18 -7
  67. umap/static/umap/locale/el.js +242 -227
  68. umap/static/umap/locale/el.json +18 -7
  69. umap/static/umap/locale/en.js +242 -234
  70. umap/static/umap/locale/en.json +19 -8
  71. umap/static/umap/locale/en_US.json +18 -7
  72. umap/static/umap/locale/es.js +242 -227
  73. umap/static/umap/locale/es.json +18 -7
  74. umap/static/umap/locale/et.js +242 -227
  75. umap/static/umap/locale/et.json +18 -7
  76. umap/static/umap/locale/eu.js +227 -199
  77. umap/static/umap/locale/eu.json +1 -1
  78. umap/static/umap/locale/fa_IR.js +242 -227
  79. umap/static/umap/locale/fa_IR.json +18 -7
  80. umap/static/umap/locale/fi.js +242 -227
  81. umap/static/umap/locale/fi.json +18 -7
  82. umap/static/umap/locale/fr.js +242 -234
  83. umap/static/umap/locale/fr.json +18 -7
  84. umap/static/umap/locale/gl.js +242 -227
  85. umap/static/umap/locale/gl.json +18 -7
  86. umap/static/umap/locale/he.js +242 -227
  87. umap/static/umap/locale/he.json +18 -7
  88. umap/static/umap/locale/hr.js +242 -227
  89. umap/static/umap/locale/hr.json +18 -7
  90. umap/static/umap/locale/hu.js +242 -234
  91. umap/static/umap/locale/hu.json +18 -7
  92. umap/static/umap/locale/id.js +242 -227
  93. umap/static/umap/locale/id.json +18 -7
  94. umap/static/umap/locale/is.js +242 -227
  95. umap/static/umap/locale/is.json +18 -7
  96. umap/static/umap/locale/it.js +242 -234
  97. umap/static/umap/locale/it.json +18 -7
  98. umap/static/umap/locale/ja.js +242 -227
  99. umap/static/umap/locale/ja.json +18 -7
  100. umap/static/umap/locale/ko.js +242 -227
  101. umap/static/umap/locale/ko.json +18 -7
  102. umap/static/umap/locale/lt.js +242 -227
  103. umap/static/umap/locale/lt.json +18 -7
  104. umap/static/umap/locale/ms.js +242 -234
  105. umap/static/umap/locale/ms.json +19 -8
  106. umap/static/umap/locale/nl.js +245 -230
  107. umap/static/umap/locale/nl.json +18 -7
  108. umap/static/umap/locale/no.js +242 -227
  109. umap/static/umap/locale/no.json +18 -7
  110. umap/static/umap/locale/pl.js +242 -227
  111. umap/static/umap/locale/pl.json +18 -7
  112. umap/static/umap/locale/pl_PL.json +18 -7
  113. umap/static/umap/locale/pt.js +242 -227
  114. umap/static/umap/locale/pt.json +18 -7
  115. umap/static/umap/locale/pt_BR.js +242 -227
  116. umap/static/umap/locale/pt_BR.json +18 -7
  117. umap/static/umap/locale/pt_PT.js +242 -227
  118. umap/static/umap/locale/pt_PT.json +18 -7
  119. umap/static/umap/locale/ro.js +242 -227
  120. umap/static/umap/locale/ro.json +18 -7
  121. umap/static/umap/locale/ru.js +242 -227
  122. umap/static/umap/locale/ru.json +18 -7
  123. umap/static/umap/locale/si.js +1 -1
  124. umap/static/umap/locale/si.json +1 -1
  125. umap/static/umap/locale/sk_SK.js +242 -227
  126. umap/static/umap/locale/sk_SK.json +18 -7
  127. umap/static/umap/locale/sl.js +242 -227
  128. umap/static/umap/locale/sl.json +18 -7
  129. umap/static/umap/locale/sr.js +242 -227
  130. umap/static/umap/locale/sr.json +18 -7
  131. umap/static/umap/locale/sv.js +242 -227
  132. umap/static/umap/locale/sv.json +18 -7
  133. umap/static/umap/locale/th_TH.js +242 -227
  134. umap/static/umap/locale/th_TH.json +18 -7
  135. umap/static/umap/locale/tr.js +242 -227
  136. umap/static/umap/locale/tr.json +18 -7
  137. umap/static/umap/locale/uk_UA.js +242 -227
  138. umap/static/umap/locale/uk_UA.json +18 -7
  139. umap/static/umap/locale/vi.js +242 -227
  140. umap/static/umap/locale/vi.json +18 -7
  141. umap/static/umap/locale/vi_VN.json +18 -7
  142. umap/static/umap/locale/zh.js +242 -227
  143. umap/static/umap/locale/zh.json +18 -7
  144. umap/static/umap/locale/zh_CN.json +18 -7
  145. umap/static/umap/locale/zh_TW.Big5.json +18 -7
  146. umap/static/umap/locale/zh_TW.js +242 -234
  147. umap/static/umap/locale/zh_TW.json +18 -7
  148. umap/static/umap/map.css +114 -265
  149. umap/static/umap/test/DataLayer.js +463 -0
  150. umap/static/umap/test/Feature.js +0 -226
  151. umap/static/umap/test/TableEditor.js +104 -0
  152. umap/static/umap/test/Util.js +0 -521
  153. umap/static/umap/test/index.html +0 -1
  154. umap/static/umap/unittests/URLs.js +1 -1
  155. umap/static/umap/unittests/utils.js +610 -0
  156. umap/static/umap/vars.css +9 -0
  157. umap/static/umap/vendors/dompurify/purify.es.mjs +1525 -0
  158. umap/static/umap/vendors/iconlayers/iconLayers.js +1 -1
  159. umap/templates/umap/css.html +2 -0
  160. umap/templates/umap/js.html +0 -1
  161. umap/templates/umap/map_detail.html +4 -0
  162. umap/templates/umap/map_table.html +12 -10
  163. umap/templatetags/umap_tags.py +5 -0
  164. umap/tests/integration/conftest.py +12 -1
  165. umap/tests/integration/test_anonymous_owned_map.py +6 -5
  166. umap/tests/integration/test_browser.py +12 -25
  167. umap/tests/integration/test_choropleth.py +1 -1
  168. umap/tests/integration/test_dashboard.py +10 -0
  169. umap/tests/integration/test_datalayer.py +8 -6
  170. umap/tests/integration/test_edit_datalayer.py +24 -19
  171. umap/tests/integration/test_edit_map.py +182 -2
  172. umap/tests/integration/test_edit_marker.py +120 -0
  173. umap/tests/integration/test_edit_polygon.py +122 -0
  174. umap/tests/integration/test_facets_browser.py +104 -14
  175. umap/tests/integration/test_import.py +70 -20
  176. umap/tests/integration/test_map.py +19 -17
  177. umap/tests/integration/test_map_list.py +28 -0
  178. umap/tests/integration/test_owned_map.py +10 -10
  179. umap/tests/integration/test_picto.py +5 -5
  180. umap/tests/integration/test_querystring.py +9 -15
  181. umap/tests/integration/test_slideshow.py +0 -5
  182. umap/tests/integration/test_statics.py +3 -2
  183. umap/tests/integration/test_tableeditor.py +1 -5
  184. umap/tests/integration/test_view_marker.py +64 -0
  185. umap/tests/integration/test_view_polygon.py +59 -0
  186. umap/tests/integration/test_view_polyline.py +51 -0
  187. umap/tests/test_map_views.py +13 -0
  188. {umap_project-2.1.3.dist-info → umap_project-2.2.0b0.dist-info}/METADATA +8 -8
  189. {umap_project-2.1.3.dist-info → umap_project-2.2.0b0.dist-info}/RECORD +194 -178
  190. umap/static/umap/vendors/dompurify/purify.min.js +0 -3
  191. umap/static/umap/vendors/dompurify/purify.min.js.map +0 -1
  192. /umap/tests/integration/{test_polygon.py → test_draw_polygon.py} +0 -0
  193. /umap/tests/integration/{test_polyline.py → test_draw_polyline.py} +0 -0
  194. {umap_project-2.1.3.dist-info → umap_project-2.2.0b0.dist-info}/WHEEL +0 -0
  195. {umap_project-2.1.3.dist-info → umap_project-2.2.0b0.dist-info}/entry_points.txt +0 -0
  196. {umap_project-2.1.3.dist-info → umap_project-2.2.0b0.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="17.305658" inkscape:cx="54.779771" inkscape:cy="162.69245" 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">
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
- <g id="close" 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" transform="translate(-3.9999995,-172)">
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 58.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" />
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 (0e150ed6c4, 2023-07-21)" 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.6832784" inkscape:cx="145.10648" inkscape:cy="121.84338" inkscape:window-width="1920" inkscape:window-height="1019" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="layer1">
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.2.2 (b0a8486541, 2022-12-01)" 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="17.994316" inkscape:cx="76.551951" inkscape:cy="18.089045" inkscape:window-width="1920" inkscape:window-height="1019" 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" />
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
- // Uses `L._`` from Leaflet.i18n which we cannot import as a module yet
2
- import { DomUtil, DomEvent } from '../../vendors/leaflet/leaflet-src.esm.js'
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 feature_li = DomUtil.create('li', `${feature.getClassName()} feature`),
19
- zoom_to = DomUtil.create('i', 'feature-zoom_to', feature_li),
20
- edit = DomUtil.create('i', 'show-on-edit feature-edit', feature_li),
21
- del = DomUtil.create('i', 'show-on-edit feature-delete', feature_li),
22
- colorBox = DomUtil.create('i', 'feature-color', feature_li),
23
- title = DomUtil.create('span', 'feature-title', feature_li),
24
- symbol = feature._getIconUrl
25
- ? U.Icon.prototype.formatUrl(feature._getIconUrl(), feature)
26
- : null
27
- zoom_to.title = L._('Bring feature to center')
28
- edit.title = L._('Edit this feature')
29
- del.title = L._('Delete this feature')
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
- DomEvent.on(
38
- zoom_to,
39
- 'click',
40
- function (e) {
41
- e.callback = L.bind(this.view, this)
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(feature_li)
60
- parent.appendChild(feature_li)
55
+ DomEvent.disableClickPropagation(row)
56
+ parent.appendChild(row)
61
57
  }
62
58
 
63
59
  datalayerId(datalayer) {
64
- return `browse_data_datalayer_${L.stamp(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
- const container = DomUtil.create('div', datalayer.getHidableClass(), parent),
73
- headline = DomUtil.create('h5', '', container),
74
- counter = DomUtil.create('span', 'datalayer-counter', headline)
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
- counter = parent.querySelector('.datalayer-counter')
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.textContent = count
102
- counter.title = L._('Features in this layer: {count}', { count: count })
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
- const isBrowserOpen = !!document.querySelector('.umap-browse-data')
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,51 @@ 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', 'umap-browse-data')
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
- const title = DomUtil.add(
131
- 'h3',
132
- 'umap-browse-title',
133
- container,
134
- this.map.getOption('name')
135
- )
136
-
137
+ DomUtil.createTitle(container, translate('Browse data'), 'icon-layers')
137
138
  const formContainer = DomUtil.create('div', '', container)
138
- const dataContainer = DomUtil.create('div', 'umap-browse-features', container)
139
+ this.dataContainer = DomUtil.create('div', '', container)
139
140
 
140
141
  const fields = [
141
- ['options.filter', { handler: 'Input', placeholder: L._('Filter') }],
142
- ['options.inBbox', { handler: 'Switch', label: L._('Current map view') }],
142
+ ['options.filter', { handler: 'Input', placeholder: translate('Filter') }],
143
+ ['options.inBbox', { handler: 'Switch', label: translate('Current map view') }],
143
144
  ]
144
- const builder = new U.FormBuilder(this, fields, {
145
- makeDirty: false,
145
+ const builder = new L.FormBuilder(this, fields, {
146
146
  callback: () => this.onFormChange(),
147
147
  })
148
148
  formContainer.appendChild(builder.build())
149
149
 
150
- this.map.ui.openPanel({
151
- data: { html: container },
152
- actions: [this.map._aboutLink()],
150
+ this.map.panel.open({
151
+ content: container,
152
+ className: 'umap-browser',
153
153
  })
154
154
 
155
- this.map.eachBrowsableDataLayer((datalayer) => {
156
- this.addDataLayer(datalayer, dataContainer)
157
- })
155
+ this.update()
156
+ }
157
+
158
+ static backButton(map) {
159
+ const button = DomUtil.create('li', '')
160
+ DomUtil.create('i', 'icon icon-16 icon-back', button)
161
+ button.title = translate('Back to browser')
162
+ // Fixme: remove me when this is merged and released
163
+ // https://github.com/Leaflet/Leaflet/pull/9052
164
+ DomEvent.disableClickPropagation(button)
165
+ DomEvent.on(button, 'click', map.openBrowser, map)
166
+ return button
158
167
  }
159
168
  }
@@ -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,148 @@
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
+ const defined = this.getDefined()
73
+ const names = Object.keys(defined)
74
+ const facetProperties = this.compute(names, defined)
75
+
76
+ const filterFeatures = function () {
77
+ let found = false
78
+ this.map.eachBrowsableDataLayer((datalayer) => {
79
+ datalayer.resetLayer(true)
80
+ if (datalayer.hasDataVisible()) found = true
81
+ })
82
+ // TODO: display a results counter in the panel instead.
83
+ if (!found) {
84
+ this.map.ui.alert({
85
+ content: translate('No results for these facets'),
86
+ level: 'info',
87
+ })
88
+ }
89
+ }
90
+
91
+ const fields = names.map((name) => {
92
+ let criteria = facetProperties[name]
93
+ let handler = 'FacetSearchChoices'
94
+ switch (criteria['type']) {
95
+ case 'number':
96
+ handler = 'FacetSearchNumber'
97
+ break
98
+ case 'date':
99
+ handler = 'FacetSearchDate'
100
+ break
101
+ case 'datetime':
102
+ handler = 'FacetSearchDateTime'
103
+ break
104
+ }
105
+ let label = defined[name]['label']
106
+ return [
107
+ `selected.${name}`,
108
+ {
109
+ criteria: criteria,
110
+ handler: handler,
111
+ label: label,
112
+ },
113
+ ]
114
+ })
115
+
116
+ const builder = new L.FormBuilder(this, fields, {
117
+ callback: filterFeatures,
118
+ callbackContext: this,
119
+ })
120
+ container.appendChild(builder.build())
121
+
122
+ this.map.panel.open({ content: container })
123
+ }
124
+
125
+ getDefined() {
126
+ const defaultType = 'checkbox'
127
+ const allowedTypes = [defaultType, 'radio', 'number', 'date', 'datetime']
128
+ return (this.map.options.facetKey || '').split(',').reduce((acc, curr) => {
129
+ let [name, label, type] = curr.split('|')
130
+ type = allowedTypes.includes(type) ? type : defaultType
131
+ acc[name] = { label: label || name, type: type }
132
+ return acc
133
+ }, {})
134
+ }
135
+
136
+ getParser(type) {
137
+ switch (type) {
138
+ case 'number':
139
+ return parseFloat
140
+ case 'datetime':
141
+ return (v) => new Date(v)
142
+ case 'date':
143
+ return Utils.parseNaiveDate
144
+ default:
145
+ return (v) => String(v || '')
146
+ }
147
+ }
148
+ }
@@ -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 = {}) {
@@ -0,0 +1,84 @@
1
+ import { DomEvent } from '../../vendors/leaflet/leaflet-src.esm.js'
2
+
3
+ export default class Orderable {
4
+ constructor(parent, onDrop, selector = '.orderable') {
5
+ this.parent = parent
6
+ this.onCommit = onDrop
7
+ this.src = null
8
+ this.dst = null
9
+ this.els = this.parent.querySelectorAll(selector)
10
+ for (let i = 0; i < this.els.length; i++) this.makeDraggable(this.els[i])
11
+ }
12
+
13
+ makeDraggable(node) {
14
+ node.draggable = true
15
+ DomEvent.on(node, 'dragstart', this.onDragStart, this)
16
+ DomEvent.on(node, 'dragenter', this.onDragEnter, this)
17
+ DomEvent.on(node, 'dragover', this.onDragOver, this)
18
+ DomEvent.on(node, 'dragleave', this.onDragLeave, this)
19
+ DomEvent.on(node, 'drop', this.onDrop, this)
20
+ DomEvent.on(node, 'dragend', this.onDragEnd, this)
21
+ }
22
+
23
+ nodeIndex(node) {
24
+ return Array.prototype.indexOf.call(this.parent.children, node)
25
+ }
26
+
27
+ findTarget(node) {
28
+ while (node) {
29
+ if (this.nodeIndex(node) !== -1) return node
30
+ node = node.parentNode
31
+ }
32
+ }
33
+
34
+ onDragStart(e) {
35
+ // e.target is the source node.
36
+ const realSrc = document.elementFromPoint(e.clientX, e.clientY);
37
+ // Only allow drag from the handle
38
+ if (!realSrc.classList.contains('icon-drag')) {
39
+ e.preventDefault()
40
+ return
41
+ }
42
+ this.src = e.target
43
+ this.initialIndex = this.nodeIndex(this.src)
44
+ this.src.classList.add('ordering')
45
+ e.dataTransfer.effectAllowed = 'move'
46
+ e.dataTransfer.setData('text/html', this.src.innerHTML)
47
+ }
48
+
49
+ onDragOver(e) {
50
+ DomEvent.stop(e)
51
+ if (e.preventDefault) e.preventDefault() // Necessary. Allows us to drop.
52
+ e.dataTransfer.dropEffect = 'move'
53
+ return false
54
+ }
55
+
56
+ onDragEnter(e) {
57
+ DomEvent.stop(e)
58
+ // e.target is the current hover target.
59
+ const dst = this.findTarget(e.target)
60
+ if (!dst || dst === this.src) return
61
+ this.dst = dst
62
+ const targetIndex = this.nodeIndex(this.dst),
63
+ srcIndex = this.nodeIndex(this.src)
64
+ if (targetIndex > srcIndex) this.parent.insertBefore(this.dst, this.src)
65
+ else this.parent.insertBefore(this.src, this.dst)
66
+ }
67
+
68
+ onDragLeave(e) {
69
+ // e.target is previous target element.
70
+ }
71
+
72
+ onDrop(e) {
73
+ // e.target is current target element.
74
+ if (e.stopPropagation) e.stopPropagation() // Stops the browser from redirecting.
75
+ if (!this.dst) return
76
+ this.onCommit(this.src, this.dst, this.initialIndex, this.nodeIndex(this.src))
77
+ return false
78
+ }
79
+
80
+ onDragEnd(e) {
81
+ // e.target is the source node.
82
+ this.src.classList.remove('ordering')
83
+ }
84
+ }