umap-project 2.4.1__py3-none-any.whl → 2.4.2__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 (110) hide show
  1. umap/__init__.py +1 -1
  2. umap/locale/el/LC_MESSAGES/django.po +145 -90
  3. umap/locale/en/LC_MESSAGES/django.po +13 -13
  4. umap/locale/eu/LC_MESSAGES/django.po +145 -89
  5. umap/static/umap/base.css +1 -1
  6. umap/static/umap/content.css +2 -2
  7. umap/static/umap/css/dialog.css +1 -1
  8. umap/static/umap/css/importers.css +2 -0
  9. umap/static/umap/css/panel.css +2 -2
  10. umap/static/umap/css/tooltip.css +1 -1
  11. umap/static/umap/js/components/alerts/alert.css +1 -1
  12. umap/static/umap/js/components/alerts/alert.js +1 -1
  13. umap/static/umap/js/modules/autocomplete.js +4 -4
  14. umap/static/umap/js/modules/browser.js +6 -6
  15. umap/static/umap/js/modules/caption.js +4 -4
  16. umap/static/umap/js/modules/dompurify.js +2 -3
  17. umap/static/umap/js/modules/facets.js +16 -10
  18. umap/static/umap/js/modules/global.js +16 -16
  19. umap/static/umap/js/modules/help.js +2 -2
  20. umap/static/umap/js/modules/importer.js +6 -6
  21. umap/static/umap/js/modules/importers/geodatamine.js +4 -4
  22. umap/static/umap/js/modules/importers/overpass.js +2 -2
  23. umap/static/umap/js/modules/orderable.js +2 -2
  24. umap/static/umap/js/modules/request.js +1 -1
  25. umap/static/umap/js/modules/rules.js +13 -10
  26. umap/static/umap/js/modules/sync/engine.js +3 -3
  27. umap/static/umap/js/modules/sync/updaters.js +10 -11
  28. umap/static/umap/js/modules/sync/websocket.js +1 -1
  29. umap/static/umap/js/modules/ui/dialog.js +1 -1
  30. umap/static/umap/js/modules/ui/panel.js +1 -1
  31. umap/static/umap/js/modules/ui/tooltip.js +6 -6
  32. umap/static/umap/js/modules/urls.js +1 -2
  33. umap/static/umap/js/modules/utils.js +16 -16
  34. umap/static/umap/js/umap.controls.js +26 -28
  35. umap/static/umap/js/umap.core.js +19 -15
  36. umap/static/umap/js/umap.datalayer.permissions.js +15 -18
  37. umap/static/umap/js/umap.features.js +91 -117
  38. umap/static/umap/js/umap.forms.js +46 -74
  39. umap/static/umap/js/umap.icon.js +17 -22
  40. umap/static/umap/js/umap.js +79 -83
  41. umap/static/umap/js/umap.layer.js +151 -169
  42. umap/static/umap/js/umap.permissions.js +6 -9
  43. umap/static/umap/js/umap.popup.js +19 -19
  44. umap/static/umap/js/umap.share.js +9 -15
  45. umap/static/umap/js/umap.slideshow.js +12 -14
  46. umap/static/umap/js/umap.tableeditor.js +5 -5
  47. umap/static/umap/locale/am_ET.json +5 -2
  48. umap/static/umap/locale/ar.json +5 -2
  49. umap/static/umap/locale/ast.json +5 -2
  50. umap/static/umap/locale/bg.json +5 -2
  51. umap/static/umap/locale/br.json +5 -2
  52. umap/static/umap/locale/ca.json +5 -2
  53. umap/static/umap/locale/cs_CZ.json +5 -2
  54. umap/static/umap/locale/da.json +5 -2
  55. umap/static/umap/locale/de.json +5 -2
  56. umap/static/umap/locale/el.json +10 -7
  57. umap/static/umap/locale/en.json +4 -2
  58. umap/static/umap/locale/en_US.json +5 -2
  59. umap/static/umap/locale/es.json +4 -2
  60. umap/static/umap/locale/et.json +5 -2
  61. umap/static/umap/locale/fa_IR.json +5 -2
  62. umap/static/umap/locale/fi.json +5 -2
  63. umap/static/umap/locale/fr.json +4 -2
  64. umap/static/umap/locale/gl.json +5 -2
  65. umap/static/umap/locale/he.json +5 -2
  66. umap/static/umap/locale/hr.json +5 -2
  67. umap/static/umap/locale/hu.json +5 -2
  68. umap/static/umap/locale/id.json +5 -2
  69. umap/static/umap/locale/is.json +5 -2
  70. umap/static/umap/locale/it.json +5 -2
  71. umap/static/umap/locale/ja.json +5 -2
  72. umap/static/umap/locale/ko.json +5 -2
  73. umap/static/umap/locale/lt.json +5 -2
  74. umap/static/umap/locale/ms.json +5 -2
  75. umap/static/umap/locale/nl.json +5 -2
  76. umap/static/umap/locale/no.json +5 -2
  77. umap/static/umap/locale/pl.json +5 -2
  78. umap/static/umap/locale/pl_PL.json +5 -2
  79. umap/static/umap/locale/pt.json +4 -2
  80. umap/static/umap/locale/pt_BR.json +5 -2
  81. umap/static/umap/locale/pt_PT.json +5 -2
  82. umap/static/umap/locale/ro.json +5 -2
  83. umap/static/umap/locale/ru.json +5 -2
  84. umap/static/umap/locale/sk_SK.json +5 -2
  85. umap/static/umap/locale/sl.json +5 -2
  86. umap/static/umap/locale/sr.json +5 -2
  87. umap/static/umap/locale/sv.json +5 -2
  88. umap/static/umap/locale/th_TH.json +5 -2
  89. umap/static/umap/locale/tr.json +5 -2
  90. umap/static/umap/locale/uk_UA.json +5 -2
  91. umap/static/umap/locale/vi.json +5 -2
  92. umap/static/umap/locale/vi_VN.json +5 -2
  93. umap/static/umap/locale/zh.json +5 -2
  94. umap/static/umap/locale/zh_CN.json +5 -2
  95. umap/static/umap/locale/zh_TW.Big5.json +5 -2
  96. umap/static/umap/locale/zh_TW.json +5 -2
  97. umap/static/umap/map.css +8 -9
  98. umap/static/umap/vars.css +10 -0
  99. umap/static/umap/vendors/dompurify/purify.es.js +5 -59
  100. umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
  101. umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +2 -2
  102. umap/storage.py +1 -1
  103. umap/tests/integration/test_map_preview.py +36 -2
  104. umap/tests/test_views.py +2 -2
  105. umap/views.py +3 -2
  106. {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/METADATA +2 -2
  107. {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/RECORD +110 -110
  108. {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/WHEEL +0 -0
  109. {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/entry_points.txt +0 -0
  110. {umap_project-2.4.1.dist-info → umap_project-2.4.2.dist-info}/licenses/LICENSE +0 -0
@@ -6,7 +6,7 @@ U.FeatureMixin = {
6
6
  subject: 'feature',
7
7
  metadata: {
8
8
  id: this.id,
9
- layerId: this.datalayer?.id || null,
9
+ layerId: this.datalayer?.umap_id || null,
10
10
  featureType: this.getClassName(),
11
11
  },
12
12
  }
@@ -15,7 +15,18 @@ U.FeatureMixin = {
15
15
  onCommit: function () {
16
16
  // When the layer is a remote layer, we don't want to sync the creation of the
17
17
  // points via the websocket, as the other peers will get them themselves.
18
- if (this.datalayer.isRemoteLayer()) return
18
+ if (this.datalayer?.isRemoteLayer()) return
19
+
20
+ // The "endEdit" event is triggered at the end of an edition,
21
+ // and will trigger the sync.
22
+ // In the case of a deletion (or a change of layer), we don't want this
23
+ // event triggered to cause a sync event, as it would reintroduce
24
+ // deleted features.
25
+ // The `._marked_for_deletion` private property is here to track this status.
26
+ if (this._marked_for_deletion === true) {
27
+ this._marked_for_deletion = false
28
+ return
29
+ }
19
30
  this.sync.upsert(this.toGeoJSON())
20
31
  },
21
32
 
@@ -23,13 +34,10 @@ U.FeatureMixin = {
23
34
  return this.toGeoJSON().geometry
24
35
  },
25
36
 
26
- syncDelete: function () {
27
- this.sync.delete()
28
- },
29
-
30
37
  initialize: function (map, latlng, options, id) {
31
38
  this.map = map
32
39
  this.sync = map.sync_engine.proxy(this)
40
+ this._marked_for_deletion = false
33
41
 
34
42
  if (typeof options === 'undefined') {
35
43
  options = {}
@@ -58,19 +66,16 @@ U.FeatureMixin = {
58
66
  }
59
67
  }
60
68
  let isDirty = false
61
- const self = this
62
69
  try {
63
70
  Object.defineProperty(this, 'isDirty', {
64
- get: function () {
65
- return isDirty
66
- },
67
- set: function (status) {
71
+ get: () => isDirty,
72
+ set: (status) => {
68
73
  if (!isDirty && status) {
69
- self.fire('isdirty')
74
+ this.fire('isdirty')
70
75
  }
71
76
  isDirty = status
72
- if (self.datalayer) {
73
- self.datalayer.isDirty = status
77
+ if (this.datalayer) {
78
+ this.datalayer.isDirty = status
74
79
  }
75
80
  },
76
81
  })
@@ -82,10 +87,10 @@ U.FeatureMixin = {
82
87
  this.parentClass.prototype.initialize.call(this, latlng, options)
83
88
  },
84
89
 
85
- preInit: function () {},
90
+ preInit: () => {},
86
91
 
87
92
  isReadOnly: function () {
88
- return this.datalayer && this.datalayer.isDataReadOnly()
93
+ return this.datalayer?.isDataReadOnly()
89
94
  },
90
95
 
91
96
  getSlug: function () {
@@ -228,19 +233,17 @@ U.FeatureMixin = {
228
233
  popupFieldset.appendChild(builder.build())
229
234
  },
230
235
 
231
- getInteractionOptions: function () {
232
- return [
233
- 'properties._umap_options.popupShape',
234
- 'properties._umap_options.popupTemplate',
235
- 'properties._umap_options.showLabel',
236
- 'properties._umap_options.labelDirection',
237
- 'properties._umap_options.labelInteractive',
238
- 'properties._umap_options.outlink',
239
- 'properties._umap_options.outlinkTarget',
240
- ]
241
- },
236
+ getInteractionOptions: () => [
237
+ 'properties._umap_options.popupShape',
238
+ 'properties._umap_options.popupTemplate',
239
+ 'properties._umap_options.showLabel',
240
+ 'properties._umap_options.labelDirection',
241
+ 'properties._umap_options.labelInteractive',
242
+ 'properties._umap_options.outlink',
243
+ 'properties._umap_options.outlinkTarget',
244
+ ],
242
245
 
243
- endEdit: function () {},
246
+ endEdit: () => {},
244
247
 
245
248
  getDisplayName: function (fallback) {
246
249
  if (fallback === undefined) fallback = this.datalayer.options.name
@@ -276,14 +279,12 @@ U.FeatureMixin = {
276
279
  }
277
280
  return false
278
281
  },
282
+
279
283
  del: function (sync) {
280
284
  this.isDirty = true
281
285
  this.map.closePopup()
282
286
  if (this.datalayer) {
283
- this.datalayer.removeLayer(this)
284
- this.disconnectFromDataLayer(this.datalayer)
285
-
286
- if (sync !== false) this.syncDelete()
287
+ this.datalayer.removeLayer(this, sync)
287
288
  }
288
289
  },
289
290
 
@@ -298,7 +299,7 @@ U.FeatureMixin = {
298
299
  }
299
300
  },
300
301
 
301
- cleanProperty: function ([key, value]) {
302
+ cleanProperty: ([key, value]) => {
302
303
  // dot in key will break the dot based property access
303
304
  // while editing the feature
304
305
  key = key.replace('.', '_')
@@ -326,7 +327,9 @@ U.FeatureMixin = {
326
327
  this.datalayer.isDirty = true
327
328
  this.datalayer.removeLayer(this)
328
329
  }
330
+
329
331
  datalayer.addLayer(this)
332
+ this.sync.upsert(this.toGeoJSON())
330
333
  datalayer.isDirty = true
331
334
  this._redraw()
332
335
  },
@@ -411,7 +414,7 @@ U.FeatureMixin = {
411
414
  },
412
415
 
413
416
  _onClick: function (e) {
414
- if (this.map.measureTools && this.map.measureTools.enabled()) return
417
+ if (this.map.measureTools?.enabled()) return
415
418
  this._popupHandlersAdded = true // Prevent leaflet from managing event
416
419
  if (!this.map.editEnabled) {
417
420
  this.view(e)
@@ -434,13 +437,9 @@ U.FeatureMixin = {
434
437
  L.DomEvent.stop(e)
435
438
  },
436
439
 
437
- getPopupToolbarAnchor: function () {
438
- return [0, 0]
439
- },
440
+ getPopupToolbarAnchor: () => [0, 0],
440
441
 
441
- getInplaceToolbarActions: function (e) {
442
- return [U.ToggleEditAction, U.DeleteFeatureAction]
443
- },
442
+ getInplaceToolbarActions: (e) => [U.ToggleEditAction, U.DeleteFeatureAction],
444
443
 
445
444
  _showContextMenu: function (e) {
446
445
  L.DomEvent.stop(e)
@@ -463,7 +462,7 @@ U.FeatureMixin = {
463
462
  if (permalink)
464
463
  items.push({
465
464
  text: L._('Permalink'),
466
- callback: function () {
465
+ callback: () => {
467
466
  window.open(permalink)
468
467
  },
469
468
  })
@@ -477,7 +476,7 @@ U.FeatureMixin = {
477
476
  let items = ['-']
478
477
  if (this.map.editedFeature !== this) {
479
478
  items.push({
480
- text: L._('Edit this feature') + ' (⇧+Click)',
479
+ text: `${L._('Edit this feature')} (⇧+Click)`,
481
480
  callback: this.edit,
482
481
  context: this,
483
482
  iconCls: 'umap-edit',
@@ -508,6 +507,7 @@ U.FeatureMixin = {
508
507
  onRemove: function (map) {
509
508
  this.parentClass.prototype.onRemove.call(this, map)
510
509
  if (this.map.editedFeature === this) {
510
+ this._marked_for_deletion = true
511
511
  this.endEdit()
512
512
  this.map.editPanel.close()
513
513
  }
@@ -546,7 +546,7 @@ U.FeatureMixin = {
546
546
  }
547
547
  keys = keys.split(',')
548
548
  for (let i = 0, value; i < keys.length; i++) {
549
- value = (this.properties[keys[i]] || '') + ''
549
+ value = `${this.properties[keys[i]] || ''}`
550
550
  if (value.toLowerCase().indexOf(filter) !== -1) return true
551
551
  }
552
552
  return false
@@ -554,16 +554,16 @@ U.FeatureMixin = {
554
554
 
555
555
  matchFacets: function () {
556
556
  const selected = this.map.facets.selected
557
- for (let [name, { type, min, max, choices }] of Object.entries(selected)) {
557
+ for (const [name, { type, min, max, choices }] of Object.entries(selected)) {
558
558
  let value = this.properties[name]
559
- let parser = this.map.facets.getParser(type)
559
+ const parser = this.map.facets.getParser(type)
560
560
  value = parser(value)
561
561
  switch (type) {
562
562
  case 'date':
563
563
  case 'datetime':
564
564
  case 'number':
565
- if (!isNaN(min) && !isNaN(value) && min > value) return false
566
- if (!isNaN(max) && !isNaN(value) && max < value) return false
565
+ if (!Number.isNaN(min) && !Number.isNaN(value) && min > value) return false
566
+ if (!Number.isNaN(max) && !Number.isNaN(value) && max < value) return false
567
567
  break
568
568
  default:
569
569
  value = value || L._('<empty value>')
@@ -581,13 +581,9 @@ U.FeatureMixin = {
581
581
  }).addTo(this.map, this, e.latlng, e.vertex)
582
582
  },
583
583
 
584
- getVertexActions: function () {
585
- return [U.DeleteVertexAction]
586
- },
584
+ getVertexActions: () => [U.DeleteVertexAction],
587
585
 
588
- isMulti: function () {
589
- return false
590
- },
586
+ isMulti: () => false,
591
587
 
592
588
  clone: function () {
593
589
  const geoJSON = this.toGeoJSON()
@@ -663,11 +659,7 @@ U.Marker = L.Marker.extend({
663
659
  },
664
660
 
665
661
  _onMouseOut: function () {
666
- if (
667
- this.dragging &&
668
- this.dragging._draggable &&
669
- !this.dragging._draggable._moving
670
- ) {
662
+ if (this.dragging?._draggable && !this.dragging._draggable._moving) {
671
663
  // Do not disable if the mouse went out while dragging
672
664
  this._disableDragging()
673
665
  }
@@ -688,14 +680,14 @@ U.Marker = L.Marker.extend({
688
680
 
689
681
  _disableDragging: function () {
690
682
  if (this.map.editEnabled) {
691
- if (this.editor && this.editor.drawing) return // when creating a new marker, the mouse can trigger the mouseover/mouseout event
683
+ if (this.editor?.drawing) return // when creating a new marker, the mouse can trigger the mouseover/mouseout event
692
684
  // do not listen to them
693
685
  this.disableEdit()
694
686
  }
695
687
  },
696
688
 
697
689
  _redraw: function () {
698
- if (this.datalayer && this.datalayer.isVisible()) {
690
+ if (this.datalayer?.isVisible()) {
699
691
  this._initIcon()
700
692
  this.update()
701
693
  }
@@ -710,8 +702,8 @@ U.Marker = L.Marker.extend({
710
702
  },
711
703
 
712
704
  _getTooltipAnchor: function () {
713
- const anchor = this.options.icon.options.tooltipAnchor.clone(),
714
- direction = this.getOption('labelDirection')
705
+ const anchor = this.options.icon.options.tooltipAnchor.clone()
706
+ const direction = this.getOption('labelDirection')
715
707
  if (direction === 'left') {
716
708
  anchor.x *= -1
717
709
  } else if (direction === 'bottom') {
@@ -746,22 +738,16 @@ U.Marker = L.Marker.extend({
746
738
  return this._latlng
747
739
  },
748
740
 
749
- getClassName: function () {
750
- return 'marker'
751
- },
741
+ getClassName: () => 'marker',
752
742
 
753
- getShapeOptions: function () {
754
- return [
755
- 'properties._umap_options.color',
756
- 'properties._umap_options.iconClass',
757
- 'properties._umap_options.iconUrl',
758
- 'properties._umap_options.iconOpacity',
759
- ]
760
- },
743
+ getShapeOptions: () => [
744
+ 'properties._umap_options.color',
745
+ 'properties._umap_options.iconClass',
746
+ 'properties._umap_options.iconUrl',
747
+ 'properties._umap_options.iconOpacity',
748
+ ],
761
749
 
762
- getAdvancedOptions: function () {
763
- return ['properties._umap_options.zoomTo']
764
- },
750
+ getAdvancedOptions: () => ['properties._umap_options.zoomTo'],
765
751
 
766
752
  appendEditFieldsets: function (container) {
767
753
  U.FeatureMixin.appendEditFieldsets.call(this, container)
@@ -847,21 +833,17 @@ U.PathMixin = {
847
833
  'interactive',
848
834
  ],
849
835
 
850
- getShapeOptions: function () {
851
- return [
852
- 'properties._umap_options.color',
853
- 'properties._umap_options.opacity',
854
- 'properties._umap_options.weight',
855
- ]
856
- },
836
+ getShapeOptions: () => [
837
+ 'properties._umap_options.color',
838
+ 'properties._umap_options.opacity',
839
+ 'properties._umap_options.weight',
840
+ ],
857
841
 
858
- getAdvancedOptions: function () {
859
- return [
860
- 'properties._umap_options.smoothFactor',
861
- 'properties._umap_options.dashArray',
862
- 'properties._umap_options.zoomTo',
863
- ]
864
- },
842
+ getAdvancedOptions: () => [
843
+ 'properties._umap_options.smoothFactor',
844
+ 'properties._umap_options.dashArray',
845
+ 'properties._umap_options.zoomTo',
846
+ ],
865
847
 
866
848
  setStyle: function (options) {
867
849
  options = options || {}
@@ -876,7 +858,7 @@ U.PathMixin = {
876
858
  },
877
859
 
878
860
  _redraw: function () {
879
- if (this.datalayer && this.datalayer.isVisible()) {
861
+ if (this.datalayer?.isVisible()) {
880
862
  this.setStyle()
881
863
  this.resetTooltip()
882
864
  }
@@ -890,14 +872,14 @@ U.PathMixin = {
890
872
  // this.map.on('showmeasure', this.showMeasureTooltip, this);
891
873
  // this.map.on('hidemeasure', this.removeTooltip, this);
892
874
  this.parentClass.prototype.onAdd.call(this, map)
893
- if (this.editing && this.editing.enabled()) this.editing.addHooks()
875
+ if (this.editing?.enabled()) this.editing.addHooks()
894
876
  this.resetTooltip()
895
877
  },
896
878
 
897
879
  onRemove: function (map) {
898
880
  // this.map.off('showmeasure', this.showMeasureTooltip, this);
899
881
  // this.map.off('hidemeasure', this.removeTooltip, this);
900
- if (this.editing && this.editing.enabled()) this.editing.removeHooks()
882
+ if (this.editing?.enabled()) this.editing.removeHooks()
901
883
  U.FeatureMixin.onRemove.call(this, map)
902
884
  },
903
885
 
@@ -919,7 +901,7 @@ U.PathMixin = {
919
901
  },
920
902
 
921
903
  _onMouseOver: function () {
922
- if (this.map.measureTools && this.map.measureTools.enabled()) {
904
+ if (this.map.measureTools?.enabled()) {
923
905
  this.map.tooltip.open({ content: this.getMeasure(), anchor: this })
924
906
  } else if (this.map.editEnabled && !this.map.editedFeature) {
925
907
  this.map.tooltip.open({ content: L._('Click to edit'), anchor: this })
@@ -1070,13 +1052,9 @@ U.Polyline = L.Polyline.extend({
1070
1052
  mainColor: 'color',
1071
1053
  },
1072
1054
 
1073
- isSameClass: function (other) {
1074
- return other instanceof U.Polyline
1075
- },
1055
+ isSameClass: (other) => other instanceof U.Polyline,
1076
1056
 
1077
- getClassName: function () {
1078
- return 'polyline'
1079
- },
1057
+ getClassName: () => 'polyline',
1080
1058
 
1081
1059
  getMeasure: function (shape) {
1082
1060
  const length = L.GeoUtil.lineLength(this.map, shape || this._defaultShape())
@@ -1169,11 +1147,11 @@ U.Polyline = L.Polyline.extend({
1169
1147
  from.reverse()
1170
1148
  toMerge = [from, to]
1171
1149
  }
1172
- const a = toMerge[0],
1173
- b = toMerge[1],
1174
- p1 = this.map.latLngToContainerPoint(a[a.length - 1]),
1175
- p2 = this.map.latLngToContainerPoint(b[0]),
1176
- tolerance = 5 // px on screen
1150
+ const a = toMerge[0]
1151
+ const b = toMerge[1]
1152
+ const p1 = this.map.latLngToContainerPoint(a[a.length - 1])
1153
+ const p2 = this.map.latLngToContainerPoint(b[0])
1154
+ const tolerance = 5 // px on screen
1177
1155
  if (Math.abs(p1.x - p2.x) <= tolerance && Math.abs(p1.y - p2.y) <= tolerance) {
1178
1156
  a.pop()
1179
1157
  }
@@ -1198,8 +1176,8 @@ U.Polyline = L.Polyline.extend({
1198
1176
  },
1199
1177
 
1200
1178
  getVertexActions: function (e) {
1201
- const actions = U.FeatureMixin.getVertexActions.call(this, e),
1202
- index = e.vertex.getIndex()
1179
+ const actions = U.FeatureMixin.getVertexActions.call(this, e)
1180
+ const index = e.vertex.getIndex()
1203
1181
  if (index === 0 || index === e.vertex.getLastIndex())
1204
1182
  actions.push(U.ContinueLineAction)
1205
1183
  else actions.push(U.SplitLineAction)
@@ -1214,15 +1192,11 @@ U.Polygon = L.Polygon.extend({
1214
1192
  mainColor: 'fillColor',
1215
1193
  },
1216
1194
 
1217
- isSameClass: function (other) {
1218
- return other instanceof U.Polygon
1219
- },
1195
+ isSameClass: (other) => other instanceof U.Polygon,
1220
1196
 
1221
- getClassName: function () {
1222
- return 'polygon'
1223
- },
1197
+ getClassName: () => 'polygon',
1224
1198
 
1225
- getShapeOptions: function () {
1199
+ getShapeOptions: () => {
1226
1200
  const options = U.PathMixin.getShapeOptions()
1227
1201
  options.push(
1228
1202
  'properties._umap_options.stroke',
@@ -1233,7 +1207,7 @@ U.Polygon = L.Polygon.extend({
1233
1207
  return options
1234
1208
  },
1235
1209
 
1236
- getInteractionOptions: function () {
1210
+ getInteractionOptions: () => {
1237
1211
  const options = U.FeatureMixin.getInteractionOptions()
1238
1212
  options.push('properties._umap_options.interactive')
1239
1213
  return options
@@ -1245,8 +1219,8 @@ U.Polygon = L.Polygon.extend({
1245
1219
  },
1246
1220
 
1247
1221
  getContextMenuEditItems: function (e) {
1248
- const items = U.PathMixin.getContextMenuEditItems.call(this, e),
1249
- shape = this.shapeAt(e.latlng)
1222
+ const items = U.PathMixin.getContextMenuEditItems.call(this, e)
1223
+ const shape = this.shapeAt(e.latlng)
1250
1224
  // No multi and no holes.
1251
1225
  if (shape && !this.isMulti() && (L.LineUtil.isFlat(shape) || shape.length === 1)) {
1252
1226
  items.push({