Browse Source
Merge pull request #3286 from vvlladd28/bugs/map/edit-polygon
Fix createed and updated polygon
pull/3293/head
Igor Kulikov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts
|
|
|
@ -180,7 +180,7 @@ export default abstract class LeafletMap { |
|
|
|
} |
|
|
|
|
|
|
|
addPolygonControl() { |
|
|
|
if (this.options.editablePolygon) { |
|
|
|
if (this.options.showPolygon && this.options.editablePolygon) { |
|
|
|
let mousePositionOnMap: L.LatLng[]; |
|
|
|
let addPolygon: L.Control; |
|
|
|
this.map.on('mousemove', (e: L.LeafletMouseEvent) => { |
|
|
|
@ -195,7 +195,7 @@ export default abstract class LeafletMap { |
|
|
|
icon.options.shadowSize = [0, 0]; |
|
|
|
const newPolygon = L.polygon(mousePositionOnMap).addTo(this.map); |
|
|
|
const datasourcesList = document.createElement('div'); |
|
|
|
const customLatLng = {coordinates: this.convertToPolygonFormat(mousePositionOnMap)}; |
|
|
|
const customLatLng = {[this.options.polygonKeyName]: this.convertToPolygonFormat(mousePositionOnMap)}; |
|
|
|
this.datasources.forEach(ds => { |
|
|
|
const dsItem = document.createElement('p'); |
|
|
|
dsItem.appendChild(document.createTextNode(ds.entityName)); |
|
|
|
|