From e999bcfe686f4ebc68df0dfe0f1a553fc509aa91 Mon Sep 17 00:00:00 2001 From: BRKP5614 Date: Tue, 22 Jun 2021 16:38:14 +0200 Subject: [PATCH 1/6] =?UTF-8?q?IOTMAPCOMP-189=20:=20une=20seule=20colonne?= =?UTF-8?q?=20si=20une=20seule=20aggr=C3=A9gation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iotMapManager/src/iot-map-icons.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iotMapManager/src/iot-map-icons.ts b/src/iotMapManager/src/iot-map-icons.ts index 683dcdfe..c1de91ed 100644 --- a/src/iotMapManager/src/iot-map-icons.ts +++ b/src/iotMapManager/src/iot-map-icons.ts @@ -88,7 +88,7 @@ export function getManualClusterIcon (cluster: IotCluster, config: IotMapConfig) // popup const layerTemp = config.layerTemplates[cluster.layer] - const nbCols = (cluster.colNumber ?? layerTemp?.popupColNumber) ?? 1 + const nbCols = (cluster.aggregation.length === 1) ? 1 : (cluster.colNumber ?? layerTemp?.popupColNumber) ?? 1 let popup = (nbCols > 1) ? `
` : `
` From 26b98e004574dacc178e8feb2b69d3be0ed4696a Mon Sep 17 00:00:00 2001 From: BRKP5614 Date: Thu, 24 Jun 2021 17:31:18 +0200 Subject: [PATCH 2/6] =?UTF-8?q?IOTMAPCOMP-183=20-=20probl=C3=A8me=20de=20s?= =?UTF-8?q?uppression=20des=20clusters=20(idem=20pour=20les=20markers)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iotMapManager/src/iot-map-cluster-manager.ts | 5 +---- src/iotMapManager/src/iot-map-marker-manager.ts | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/iotMapManager/src/iot-map-cluster-manager.ts b/src/iotMapManager/src/iot-map-cluster-manager.ts index 4c4d833e..273668cd 100644 --- a/src/iotMapManager/src/iot-map-cluster-manager.ts +++ b/src/iotMapManager/src/iot-map-cluster-manager.ts @@ -76,10 +76,7 @@ export class IotMapClusterManager { const clusterToRemove: IotMapCluster = this.clustersObjects[clusterId] if (clusterToRemove) { clusterToRemove.removeCluster() - const index = this.clustersObjects.indexOf(clusterToRemove, 0) - if (index > -1) { - this.clustersObjects.splice(index, 1) - } + delete this.clustersObjects[clusterId] } } } diff --git a/src/iotMapManager/src/iot-map-marker-manager.ts b/src/iotMapManager/src/iot-map-marker-manager.ts index 63a69081..aed6c94b 100644 --- a/src/iotMapManager/src/iot-map-marker-manager.ts +++ b/src/iotMapManager/src/iot-map-marker-manager.ts @@ -68,11 +68,7 @@ export class IotMapMarkerManager { const markerToRemove: IotMapMarker = this.markersObjects[markerId] if (markerToRemove) { markerToRemove.removeMarker() - - const index = this.markersObjects.indexOf(markerToRemove, 0) - if (index > -1) { - this.markersObjects.splice(index, 1) - } + delete this.markersObjects[markerId] } } From c953829667d568c18bba81e89a0ce4dce60a7ba9 Mon Sep 17 00:00:00 2001 From: BRKP5614 Date: Fri, 25 Jun 2021 15:52:15 +0200 Subject: [PATCH 3/6] *** Version 2.6.3 *** --- package-lock.json | 6 +++--- package.json | 2 +- src/iotMapManager/css/map.css | 2 +- src/iotMapManager/css/markers.css | 2 +- src/iotMapManager/css/popup.css | 2 +- src/iotMapManager/css/tabs.css | 2 +- src/iotMapManager/import_png.d.ts | 2 +- src/iotMapManager/index.ts | 2 +- src/iotMapManager/iot-map-manager.css | 2 +- src/iotMapManager/package.json | 2 +- src/iotMapManager/readme.md | 3 ++- src/iotMapManager/src/iot-map-area-manager.ts | 2 +- src/iotMapManager/src/iot-map-area.ts | 2 +- src/iotMapManager/src/iot-map-cluster-manager.ts | 2 +- src/iotMapManager/src/iot-map-cluster.ts | 2 +- src/iotMapManager/src/iot-map-common-svg.ts | 2 +- src/iotMapManager/src/iot-map-config.ts | 2 +- src/iotMapManager/src/iot-map-icons.ts | 2 +- src/iotMapManager/src/iot-map-manager.ts | 2 +- src/iotMapManager/src/iot-map-marker-manager.ts | 7 +++++-- src/iotMapManager/src/iot-map-marker.ts | 2 +- src/iotMapManager/src/iot-map-path-manager.ts | 2 +- src/iotMapManager/src/iot-map-path.ts | 2 +- src/iotMapManager/src/iot-map-types.ts | 2 +- src/iotMapManager/src/iot-map-user-marker-manager.ts | 2 +- src/iotMapManager/src/iot-map-user-marker.ts | 2 +- 26 files changed, 33 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b53723a..f3cb1efc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10095,9 +10095,9 @@ } }, "iotmapmanager": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/iotmapmanager/-/iotmapmanager-2.6.2.tgz", - "integrity": "sha512-vrQv6YQzLpFd8oyvgja/AJmT1FIOUSfhvK3hllP/QCxihM5v7KsmUO04QuD+9SDh3FcBZxt9R5NGimdM38asqw==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/iotmapmanager/-/iotmapmanager-2.6.3.tgz", + "integrity": "sha512-L5okGnnoDyVI531esegewNpie/LN8+Rj/tA7vCBUDEXP4ykEuEH4A3oxU3djj+b+EupPGgOgbEF2BKqms6ihbA==", "requires": { "@types/leaflet": "^1.5.19", "@types/leaflet.markercluster": "^1.4.3", diff --git a/package.json b/package.json index 6cada3ed..c495d356 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@types/leaflet": "^1.5.19", "@types/leaflet.markercluster": "^1.4.3", "boosted": "^4.6.0", - "iotmapmanager": "^2.6.2", + "iotmapmanager": "^2.6.3", "leaflet": "^1.6.0", "leaflet.markercluster": "^1.4.1", "zone.js": "^0.11.3" diff --git a/src/iotMapManager/css/map.css b/src/iotMapManager/css/map.css index 1527574c..93df6bb6 100644 --- a/src/iotMapManager/css/map.css +++ b/src/iotMapManager/css/map.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/css/markers.css b/src/iotMapManager/css/markers.css index f5f56ef8..722f5096 100644 --- a/src/iotMapManager/css/markers.css +++ b/src/iotMapManager/css/markers.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/css/popup.css b/src/iotMapManager/css/popup.css index 6d0f6db9..1dc372ca 100644 --- a/src/iotMapManager/css/popup.css +++ b/src/iotMapManager/css/popup.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/css/tabs.css b/src/iotMapManager/css/tabs.css index ea1f1b95..5d63d335 100644 --- a/src/iotMapManager/css/tabs.css +++ b/src/iotMapManager/css/tabs.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/import_png.d.ts b/src/iotMapManager/import_png.d.ts index 2049e003..21dc6277 100644 --- a/src/iotMapManager/import_png.d.ts +++ b/src/iotMapManager/import_png.d.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/index.ts b/src/iotMapManager/index.ts index 7d791dde..132190b2 100644 --- a/src/iotMapManager/index.ts +++ b/src/iotMapManager/index.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/iot-map-manager.css b/src/iotMapManager/iot-map-manager.css index 149adecc..62829148 100644 --- a/src/iotMapManager/iot-map-manager.css +++ b/src/iotMapManager/iot-map-manager.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/package.json b/src/iotMapManager/package.json index 1654a6aa..bca5d12d 100644 --- a/src/iotMapManager/package.json +++ b/src/iotMapManager/package.json @@ -1,6 +1,6 @@ { "name": "iotmapmanager", - "version": "2.6.2", + "version": "2.6.3", "description": "Manage markers, clusters, user marker or paths on IotMaps", "main": "dist/index.js", "types": "lib/index.d.ts", diff --git a/src/iotMapManager/readme.md b/src/iotMapManager/readme.md index f20eb116..e1f43dc1 100644 --- a/src/iotMapManager/readme.md +++ b/src/iotMapManager/readme.md @@ -1,4 +1,4 @@ -# IotMapManager V2.6.2 +# IotMapManager V2.6.3 This library provides management of markers dedicated to projects using mapping. ## use @@ -250,6 +250,7 @@ interface Inner { } ``` +Note: the icon has priority over the label. To update a marker having an icon by a label, set `icon` to `null` and define a label. diff --git a/src/iotMapManager/src/iot-map-area-manager.ts b/src/iotMapManager/src/iot-map-area-manager.ts index 8a9ce711..c14bba1f 100644 --- a/src/iotMapManager/src/iot-map-area-manager.ts +++ b/src/iotMapManager/src/iot-map-area-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-area.ts b/src/iotMapManager/src/iot-map-area.ts index 7ab713cd..99795a59 100644 --- a/src/iotMapManager/src/iot-map-area.ts +++ b/src/iotMapManager/src/iot-map-area.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-cluster-manager.ts b/src/iotMapManager/src/iot-map-cluster-manager.ts index 273668cd..960ae697 100644 --- a/src/iotMapManager/src/iot-map-cluster-manager.ts +++ b/src/iotMapManager/src/iot-map-cluster-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-cluster.ts b/src/iotMapManager/src/iot-map-cluster.ts index 0159e741..1842e8d4 100644 --- a/src/iotMapManager/src/iot-map-cluster.ts +++ b/src/iotMapManager/src/iot-map-cluster.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-common-svg.ts b/src/iotMapManager/src/iot-map-common-svg.ts index d49cd2b2..a5733280 100644 --- a/src/iotMapManager/src/iot-map-common-svg.ts +++ b/src/iotMapManager/src/iot-map-common-svg.ts @@ -1,6 +1,6 @@ /* * Software Name: IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-config.ts b/src/iotMapManager/src/iot-map-config.ts index a5e377d2..75763889 100644 --- a/src/iotMapManager/src/iot-map-config.ts +++ b/src/iotMapManager/src/iot-map-config.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-icons.ts b/src/iotMapManager/src/iot-map-icons.ts index c1de91ed..6c167737 100644 --- a/src/iotMapManager/src/iot-map-icons.ts +++ b/src/iotMapManager/src/iot-map-icons.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-manager.ts b/src/iotMapManager/src/iot-map-manager.ts index 82f9d287..11464f75 100644 --- a/src/iotMapManager/src/iot-map-manager.ts +++ b/src/iotMapManager/src/iot-map-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-marker-manager.ts b/src/iotMapManager/src/iot-map-marker-manager.ts index aed6c94b..d7fe6478 100644 --- a/src/iotMapManager/src/iot-map-marker-manager.ts +++ b/src/iotMapManager/src/iot-map-marker-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -154,10 +154,13 @@ export class IotMapMarkerManager { // inner modified if (params.inner !== undefined) { + if (params.inner.icon === null) { // cmd to remove icon + currentMarkerInfos.inner.icon = undefined + } currentMarkerInfos.inner = { color: params.inner?.color ?? currentMarkerInfos.inner?.color ?? this.config.markers.default.inner.color, icon: params.inner?.icon ?? currentMarkerInfos.inner?.icon, - label: (params.inner?.icon === undefined) ? (params.inner?.label ?? currentMarkerInfos.inner?.label) : undefined + label: params.inner?.label ?? currentMarkerInfos.inner?.label } htmlModificationNeeded = true } diff --git a/src/iotMapManager/src/iot-map-marker.ts b/src/iotMapManager/src/iot-map-marker.ts index d7135eef..f53bf83c 100644 --- a/src/iotMapManager/src/iot-map-marker.ts +++ b/src/iotMapManager/src/iot-map-marker.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-path-manager.ts b/src/iotMapManager/src/iot-map-path-manager.ts index fcbc1d39..4f2ee957 100644 --- a/src/iotMapManager/src/iot-map-path-manager.ts +++ b/src/iotMapManager/src/iot-map-path-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-path.ts b/src/iotMapManager/src/iot-map-path.ts index c6555ea8..9217fcd8 100644 --- a/src/iotMapManager/src/iot-map-path.ts +++ b/src/iotMapManager/src/iot-map-path.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-types.ts b/src/iotMapManager/src/iot-map-types.ts index a6dec1fa..70337794 100644 --- a/src/iotMapManager/src/iot-map-types.ts +++ b/src/iotMapManager/src/iot-map-types.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-user-marker-manager.ts b/src/iotMapManager/src/iot-map-user-marker-manager.ts index 55ef1a0c..4cdf7db9 100644 --- a/src/iotMapManager/src/iot-map-user-marker-manager.ts +++ b/src/iotMapManager/src/iot-map-user-marker-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-user-marker.ts b/src/iotMapManager/src/iot-map-user-marker.ts index 42dee201..2cb5796a 100644 --- a/src/iotMapManager/src/iot-map-user-marker.ts +++ b/src/iotMapManager/src/iot-map-user-marker.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.2 +* Version: 2.6.3 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * From 48838dae202726a60ff712a6cf4f0e03252e182d Mon Sep 17 00:00:00 2001 From: BRKP5614 Date: Tue, 6 Jul 2021 10:47:08 +0200 Subject: [PATCH 4/6] *** Version 2.6.4 *** --- package-lock.json | 6 +- package.json | 2 +- src/iotMapManager/css/map.css | 2 +- src/iotMapManager/css/markers.css | 2 +- src/iotMapManager/css/popup.css | 2 +- src/iotMapManager/css/tabs.css | 2 +- src/iotMapManager/import_png.d.ts | 2 +- src/iotMapManager/index.ts | 2 +- src/iotMapManager/iot-map-manager.css | 2 +- src/iotMapManager/package.json | 2 +- src/iotMapManager/readme.md | 2 +- src/iotMapManager/src/iot-map-area-manager.ts | 2 +- src/iotMapManager/src/iot-map-area.ts | 2 +- .../src/iot-map-cluster-manager.ts | 2 +- src/iotMapManager/src/iot-map-cluster.ts | 6 +- src/iotMapManager/src/iot-map-common-svg.ts | 2 +- src/iotMapManager/src/iot-map-config.ts | 2 +- src/iotMapManager/src/iot-map-icons.ts | 2 +- src/iotMapManager/src/iot-map-manager.ts | 67 ++++++++++++++++--- .../src/iot-map-marker-manager.ts | 2 +- src/iotMapManager/src/iot-map-marker.ts | 15 ++++- src/iotMapManager/src/iot-map-path-manager.ts | 2 +- src/iotMapManager/src/iot-map-path.ts | 2 +- src/iotMapManager/src/iot-map-types.ts | 8 ++- .../src/iot-map-user-marker-manager.ts | 2 +- src/iotMapManager/src/iot-map-user-marker.ts | 6 +- src/map/map.component.ts | 9 +-- 27 files changed, 113 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index f3cb1efc..4e051e73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10095,9 +10095,9 @@ } }, "iotmapmanager": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/iotmapmanager/-/iotmapmanager-2.6.3.tgz", - "integrity": "sha512-L5okGnnoDyVI531esegewNpie/LN8+Rj/tA7vCBUDEXP4ykEuEH4A3oxU3djj+b+EupPGgOgbEF2BKqms6ihbA==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/iotmapmanager/-/iotmapmanager-2.6.4.tgz", + "integrity": "sha512-wRz7N9HE9enAORo8wQJmlldVKBL787BqFtPhxTj3cPO7HAGABmQWJG+QSt7zN+5/mXl/rvRqWzHv0gpApwZ34g==", "requires": { "@types/leaflet": "^1.5.19", "@types/leaflet.markercluster": "^1.4.3", diff --git a/package.json b/package.json index c495d356..e34c98a4 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@types/leaflet": "^1.5.19", "@types/leaflet.markercluster": "^1.4.3", "boosted": "^4.6.0", - "iotmapmanager": "^2.6.3", + "iotmapmanager": "^2.6.4", "leaflet": "^1.6.0", "leaflet.markercluster": "^1.4.1", "zone.js": "^0.11.3" diff --git a/src/iotMapManager/css/map.css b/src/iotMapManager/css/map.css index 93df6bb6..dff1cf07 100644 --- a/src/iotMapManager/css/map.css +++ b/src/iotMapManager/css/map.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/css/markers.css b/src/iotMapManager/css/markers.css index 722f5096..f3827fe1 100644 --- a/src/iotMapManager/css/markers.css +++ b/src/iotMapManager/css/markers.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/css/popup.css b/src/iotMapManager/css/popup.css index 1dc372ca..0166a80b 100644 --- a/src/iotMapManager/css/popup.css +++ b/src/iotMapManager/css/popup.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/css/tabs.css b/src/iotMapManager/css/tabs.css index 5d63d335..25b259e9 100644 --- a/src/iotMapManager/css/tabs.css +++ b/src/iotMapManager/css/tabs.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/import_png.d.ts b/src/iotMapManager/import_png.d.ts index 21dc6277..b50129b7 100644 --- a/src/iotMapManager/import_png.d.ts +++ b/src/iotMapManager/import_png.d.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/index.ts b/src/iotMapManager/index.ts index 132190b2..e13c69a6 100644 --- a/src/iotMapManager/index.ts +++ b/src/iotMapManager/index.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/iot-map-manager.css b/src/iotMapManager/iot-map-manager.css index 62829148..1afd23bc 100644 --- a/src/iotMapManager/iot-map-manager.css +++ b/src/iotMapManager/iot-map-manager.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/package.json b/src/iotMapManager/package.json index bca5d12d..ddd55506 100644 --- a/src/iotMapManager/package.json +++ b/src/iotMapManager/package.json @@ -1,6 +1,6 @@ { "name": "iotmapmanager", - "version": "2.6.3", + "version": "2.6.4", "description": "Manage markers, clusters, user marker or paths on IotMaps", "main": "dist/index.js", "types": "lib/index.d.ts", diff --git a/src/iotMapManager/readme.md b/src/iotMapManager/readme.md index e1f43dc1..f7a09e6a 100644 --- a/src/iotMapManager/readme.md +++ b/src/iotMapManager/readme.md @@ -1,4 +1,4 @@ -# IotMapManager V2.6.3 +# IotMapManager V2.6.4 This library provides management of markers dedicated to projects using mapping. ## use diff --git a/src/iotMapManager/src/iot-map-area-manager.ts b/src/iotMapManager/src/iot-map-area-manager.ts index c14bba1f..e071f402 100644 --- a/src/iotMapManager/src/iot-map-area-manager.ts +++ b/src/iotMapManager/src/iot-map-area-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-area.ts b/src/iotMapManager/src/iot-map-area.ts index 99795a59..de9a7d3d 100644 --- a/src/iotMapManager/src/iot-map-area.ts +++ b/src/iotMapManager/src/iot-map-area.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-cluster-manager.ts b/src/iotMapManager/src/iot-map-cluster-manager.ts index 960ae697..fd1bd7cd 100644 --- a/src/iotMapManager/src/iot-map-cluster-manager.ts +++ b/src/iotMapManager/src/iot-map-cluster-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-cluster.ts b/src/iotMapManager/src/iot-map-cluster.ts index 1842e8d4..139ca58e 100644 --- a/src/iotMapManager/src/iot-map-cluster.ts +++ b/src/iotMapManager/src/iot-map-cluster.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -95,4 +95,8 @@ export class IotMapCluster extends IotMapDisplay { this.map.getIotMap().flyTo(this.getData().location, (zoomLevel !== 18 ? zoomLevel + 1 : 18)) } } + + public isCluster (): boolean { + return true + } } diff --git a/src/iotMapManager/src/iot-map-common-svg.ts b/src/iotMapManager/src/iot-map-common-svg.ts index a5733280..ef079565 100644 --- a/src/iotMapManager/src/iot-map-common-svg.ts +++ b/src/iotMapManager/src/iot-map-common-svg.ts @@ -1,6 +1,6 @@ /* * Software Name: IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-config.ts b/src/iotMapManager/src/iot-map-config.ts index 75763889..628277c4 100644 --- a/src/iotMapManager/src/iot-map-config.ts +++ b/src/iotMapManager/src/iot-map-config.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-icons.ts b/src/iotMapManager/src/iot-map-icons.ts index 6c167737..2aacd409 100644 --- a/src/iotMapManager/src/iot-map-icons.ts +++ b/src/iotMapManager/src/iot-map-icons.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-manager.ts b/src/iotMapManager/src/iot-map-manager.ts index 11464f75..aa75e5a0 100644 --- a/src/iotMapManager/src/iot-map-manager.ts +++ b/src/iotMapManager/src/iot-map-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -92,8 +92,8 @@ export class IotMapManager { if (this.config.map.externalClustering) { // manual clustering layer = new L.FeatureGroup() layer.on('click', this.onElementClick.bind(this)) - .on('mouseover', this.onMarkerMouseOver) - .on('mouseout', this.onMarkerMouseOut) + .on('mouseover', this.onElementMouseOver.bind(this)) + .on('mouseout', this.onElementMouseOut) } else if (layerName === this.config.accuracyCircle.layerName || layerName === this.config.userMarker.layerName || layerName === this.config.path.layerName) { // accuracy area, user marker or path = no clustering @@ -106,7 +106,7 @@ export class IotMapManager { }) layer.on('animationend', this.onZoom.bind(this)) - .on('clustermouseover', this.onClusterMouseOver) + .on('clustermouseover', this.onClusterMouseOver.bind(this)) .on('clustermouseout', this.onClusterMouseOut) .on('click', this.onElementClick.bind(this)) } @@ -249,12 +249,20 @@ export class IotMapManager { * @param event - event data */ private onElementClick (event) { - const element = event.layer - element.elementClicked() // informe cluster to open - if (this.selectedElement === element) { - this.unselectElement(element) + const element: IotMapDisplay = event.layer + if (this.config.map.externalClustering === true) { + if (element.isCluster()) { + element.elementClicked() // inform cluster to open + } } else { - this.selectElement(element) + if (this.selectedElement === element) { + this.unselectElement(element) + } else { + this.selectElement(element) + if (element.hasPopup()) { + this.shiftMap(element.getData().location) + } + } } } @@ -264,6 +272,7 @@ export class IotMapManager { */ private onClusterMouseOver (event) { event.layer.setZIndexOffset(100) + this.shiftMap(event.latlng) } /** @@ -278,15 +287,19 @@ export class IotMapManager { * Called on marker mouse over (to brind manual cluster in front) * @param event - event data */ - private onMarkerMouseOver (event) { + private onElementMouseOver (event) { event.layer.setZIndexOffset(100) + + if (event.layer.isCluster()) { + this.shiftMap(event.layer.getData().location) + } } /** * Called on marker mouse out (to brind manual cluster in background) * @param event - event data */ - private onMarkerMouseOut (event) { + private onElementMouseOut (event) { event.layer.setZIndexOffset(0) } @@ -340,4 +353,36 @@ export class IotMapManager { elt.updateAccuracyDisplay(this.currentDisplayedLayers, this.accuracyDisplayed) } } + + private shiftMap (currentPos: L.LatLngExpression): void { + const eltPos = this.map.latLngToLayerPoint(currentPos) + const mapBounds = this.map.getBounds() + const northEastPos = this.map.latLngToLayerPoint(mapBounds.getNorthEast()) + const southWestPos = this.map.latLngToLayerPoint(mapBounds.getSouthWest()) + + // top + if (eltPos.y - northEastPos.y < 200) { + const shift = 200 - (eltPos.y - northEastPos.y) + northEastPos.y -= shift + southWestPos.y -= shift + } + + // left + if (eltPos.x - southWestPos.x < 150) { + const shift = 150 - (eltPos.x - southWestPos.x) + northEastPos.x -= shift + southWestPos.x -= shift + } + + // bottom - no need to shift + // right + if (northEastPos.x - eltPos.x < 150) { + const shift = 150 - (northEastPos.x - eltPos.x) + northEastPos.x += shift + southWestPos.x += shift + } + + const newMapBounds = L.latLngBounds(this.map.layerPointToLatLng(southWestPos), this.map.layerPointToLatLng(northEastPos)) + this.map.flyToBounds(newMapBounds) + } } diff --git a/src/iotMapManager/src/iot-map-marker-manager.ts b/src/iotMapManager/src/iot-map-marker-manager.ts index d7fe6478..9c00b2fc 100644 --- a/src/iotMapManager/src/iot-map-marker-manager.ts +++ b/src/iotMapManager/src/iot-map-marker-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-marker.ts b/src/iotMapManager/src/iot-map-marker.ts index f53bf83c..dea3dd67 100644 --- a/src/iotMapManager/src/iot-map-marker.ts +++ b/src/iotMapManager/src/iot-map-marker.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -51,6 +51,11 @@ export class IotMapMarker extends IotMapDisplay { this.selected = selected this.setIcon(getMarkerIcon(this.data, this.config, selected)) this.setZIndexOffset((selected) ? 100 : 0) + + // if (this.selected && this.data.popup !== undefined) { + // // move map if marker is too close to the edge + // this.shiftMap() + // } } public getData (): IotMarker { @@ -109,4 +114,12 @@ export class IotMapMarker extends IotMapDisplay { this.map.getLayer(this.config.accuracyCircle.layerName).removeLayer(this.accuracyCircle) } } + + public isCluster (): boolean { + return false + } + + public hasPopup (): boolean { + return this.data.popup !== undefined + } } diff --git a/src/iotMapManager/src/iot-map-path-manager.ts b/src/iotMapManager/src/iot-map-path-manager.ts index 4f2ee957..a9ecfb13 100644 --- a/src/iotMapManager/src/iot-map-path-manager.ts +++ b/src/iotMapManager/src/iot-map-path-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-path.ts b/src/iotMapManager/src/iot-map-path.ts index 9217fcd8..b1f857e9 100644 --- a/src/iotMapManager/src/iot-map-path.ts +++ b/src/iotMapManager/src/iot-map-path.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-types.ts b/src/iotMapManager/src/iot-map-types.ts index 70337794..b914e7ce 100644 --- a/src/iotMapManager/src/iot-map-types.ts +++ b/src/iotMapManager/src/iot-map-types.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -52,6 +52,12 @@ export abstract class IotMapDisplay extends L.Marker { // By default: Nothing to do } + hasPopup (): boolean { + return false + } + + abstract isCluster (): boolean + updateAccuracyDisplay (selectedLayers: string[], display: boolean): void { // eslint-disable-line @typescript-eslint/no-unused-vars // By default: Nothing to do } diff --git a/src/iotMapManager/src/iot-map-user-marker-manager.ts b/src/iotMapManager/src/iot-map-user-marker-manager.ts index 4cdf7db9..9a6e0336 100644 --- a/src/iotMapManager/src/iot-map-user-marker-manager.ts +++ b/src/iotMapManager/src/iot-map-user-marker-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-user-marker.ts b/src/iotMapManager/src/iot-map-user-marker.ts index 2cb5796a..dc95f29f 100644 --- a/src/iotMapManager/src/iot-map-user-marker.ts +++ b/src/iotMapManager/src/iot-map-user-marker.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.3 +* Version: 2.6.4 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -68,6 +68,10 @@ export class IotMapUserMarker extends IotMapDisplay { this.accuracyCircle.setLatLng(newLatLng) } + public isCluster (): boolean { + return false + } + public updateAccuracyDisplay (selectedLayers: string[], display: boolean): void { this.layerDisplayed = selectedLayers.includes(this.config.userMarker.layerName) this.accuracityDisplayed = display diff --git a/src/map/map.component.ts b/src/map/map.component.ts index 4c46455c..49a036eb 100644 --- a/src/map/map.component.ts +++ b/src/map/map.component.ts @@ -99,7 +99,7 @@ export class MapComponent implements AfterViewInit { type: ShapeType.square, anchored: true, plain: false, - // accuracy: 200 + accuracy: 200 }, inner: { icon: 'iotmap-icons-bluetooth', @@ -186,7 +186,7 @@ export class MapComponent implements AfterViewInit { type: ShapeType.square, anchored: true, plain: true, - // accuracy: 300 + accuracy: 300 }, layer: 'etablissements', inner: { @@ -479,7 +479,7 @@ export class MapComponent implements AfterViewInit { lat: 44.897, lng: 4.8813 }, - // accuracy: 150, + accuracy: 150, direction: 180 } @@ -647,8 +647,6 @@ export class MapComponent implements AfterViewInit { } this.commonIotMap.onEltClick = (id) => { - console.log('click on ' + id + ' !') - setTimeout(() => { this.iotMapMarkerManager.updateMarker(id, { popup: { title: 'Update', body: 'Popup mise à jour' } }) }, 3000) @@ -662,4 +660,3 @@ export class MapComponent implements AfterViewInit { this.iotMapAreaManager.addArea(this.zone) } } - From 057725b3db9a95debb6ff033cb8652bd0e8a30c8 Mon Sep 17 00:00:00 2001 From: BRKP5614 Date: Tue, 6 Jul 2021 17:58:11 +0200 Subject: [PATCH 5/6] *** Version 2.6.5 *** --- package-lock.json | 6 +- package.json | 2 +- src/iotMapManager/css/map.css | 2 +- src/iotMapManager/css/markers.css | 2 +- src/iotMapManager/css/popup.css | 2 +- src/iotMapManager/css/tabs.css | 2 +- src/iotMapManager/import_png.d.ts | 2 +- src/iotMapManager/index.ts | 2 +- src/iotMapManager/iot-map-manager.css | 2 +- src/iotMapManager/package.json | 2 +- src/iotMapManager/readme.md | 2 +- src/iotMapManager/src/iot-map-area-manager.ts | 2 +- src/iotMapManager/src/iot-map-area.ts | 2 +- .../src/iot-map-cluster-manager.ts | 2 +- src/iotMapManager/src/iot-map-cluster.ts | 6 +- src/iotMapManager/src/iot-map-common-svg.ts | 2 +- src/iotMapManager/src/iot-map-config.ts | 2 +- src/iotMapManager/src/iot-map-icons.ts | 2 +- src/iotMapManager/src/iot-map-manager.ts | 58 +++---------------- .../src/iot-map-marker-manager.ts | 2 +- src/iotMapManager/src/iot-map-marker.ts | 38 ++++++++++-- src/iotMapManager/src/iot-map-path-manager.ts | 2 +- src/iotMapManager/src/iot-map-path.ts | 2 +- src/iotMapManager/src/iot-map-types.ts | 10 ++-- .../src/iot-map-user-marker-manager.ts | 2 +- src/iotMapManager/src/iot-map-user-marker.ts | 6 +- 26 files changed, 69 insertions(+), 95 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4e051e73..b5f581d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10095,9 +10095,9 @@ } }, "iotmapmanager": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/iotmapmanager/-/iotmapmanager-2.6.4.tgz", - "integrity": "sha512-wRz7N9HE9enAORo8wQJmlldVKBL787BqFtPhxTj3cPO7HAGABmQWJG+QSt7zN+5/mXl/rvRqWzHv0gpApwZ34g==", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/iotmapmanager/-/iotmapmanager-2.6.5.tgz", + "integrity": "sha512-lWc7+6ytexUFWsEVWVXG3TJjCmDIhdvg5p89fXUZv6EKvnEgoAxCbncB1HSTlEOc64vVYzIEJ6Dcx/332ek3IA==", "requires": { "@types/leaflet": "^1.5.19", "@types/leaflet.markercluster": "^1.4.3", diff --git a/package.json b/package.json index e34c98a4..80d21139 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@types/leaflet": "^1.5.19", "@types/leaflet.markercluster": "^1.4.3", "boosted": "^4.6.0", - "iotmapmanager": "^2.6.4", + "iotmapmanager": "^2.6.5", "leaflet": "^1.6.0", "leaflet.markercluster": "^1.4.1", "zone.js": "^0.11.3" diff --git a/src/iotMapManager/css/map.css b/src/iotMapManager/css/map.css index dff1cf07..62feb499 100644 --- a/src/iotMapManager/css/map.css +++ b/src/iotMapManager/css/map.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/css/markers.css b/src/iotMapManager/css/markers.css index f3827fe1..badb8fcf 100644 --- a/src/iotMapManager/css/markers.css +++ b/src/iotMapManager/css/markers.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/css/popup.css b/src/iotMapManager/css/popup.css index 0166a80b..a26e8e26 100644 --- a/src/iotMapManager/css/popup.css +++ b/src/iotMapManager/css/popup.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/css/tabs.css b/src/iotMapManager/css/tabs.css index 25b259e9..6c56c3f3 100644 --- a/src/iotMapManager/css/tabs.css +++ b/src/iotMapManager/css/tabs.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/import_png.d.ts b/src/iotMapManager/import_png.d.ts index b50129b7..a8518147 100644 --- a/src/iotMapManager/import_png.d.ts +++ b/src/iotMapManager/import_png.d.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/index.ts b/src/iotMapManager/index.ts index e13c69a6..135c75cc 100644 --- a/src/iotMapManager/index.ts +++ b/src/iotMapManager/index.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/iot-map-manager.css b/src/iotMapManager/iot-map-manager.css index 1afd23bc..b49320e4 100644 --- a/src/iotMapManager/iot-map-manager.css +++ b/src/iotMapManager/iot-map-manager.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/package.json b/src/iotMapManager/package.json index ddd55506..3a2a0405 100644 --- a/src/iotMapManager/package.json +++ b/src/iotMapManager/package.json @@ -1,6 +1,6 @@ { "name": "iotmapmanager", - "version": "2.6.4", + "version": "2.6.5", "description": "Manage markers, clusters, user marker or paths on IotMaps", "main": "dist/index.js", "types": "lib/index.d.ts", diff --git a/src/iotMapManager/readme.md b/src/iotMapManager/readme.md index f7a09e6a..76ecb27a 100644 --- a/src/iotMapManager/readme.md +++ b/src/iotMapManager/readme.md @@ -1,4 +1,4 @@ -# IotMapManager V2.6.4 +# IotMapManager V2.6.5 This library provides management of markers dedicated to projects using mapping. ## use diff --git a/src/iotMapManager/src/iot-map-area-manager.ts b/src/iotMapManager/src/iot-map-area-manager.ts index e071f402..c2607e47 100644 --- a/src/iotMapManager/src/iot-map-area-manager.ts +++ b/src/iotMapManager/src/iot-map-area-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-area.ts b/src/iotMapManager/src/iot-map-area.ts index de9a7d3d..efb0b63b 100644 --- a/src/iotMapManager/src/iot-map-area.ts +++ b/src/iotMapManager/src/iot-map-area.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-cluster-manager.ts b/src/iotMapManager/src/iot-map-cluster-manager.ts index fd1bd7cd..f4be166d 100644 --- a/src/iotMapManager/src/iot-map-cluster-manager.ts +++ b/src/iotMapManager/src/iot-map-cluster-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-cluster.ts b/src/iotMapManager/src/iot-map-cluster.ts index 139ca58e..36359aa3 100644 --- a/src/iotMapManager/src/iot-map-cluster.ts +++ b/src/iotMapManager/src/iot-map-cluster.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -95,8 +95,4 @@ export class IotMapCluster extends IotMapDisplay { this.map.getIotMap().flyTo(this.getData().location, (zoomLevel !== 18 ? zoomLevel + 1 : 18)) } } - - public isCluster (): boolean { - return true - } } diff --git a/src/iotMapManager/src/iot-map-common-svg.ts b/src/iotMapManager/src/iot-map-common-svg.ts index ef079565..844670b2 100644 --- a/src/iotMapManager/src/iot-map-common-svg.ts +++ b/src/iotMapManager/src/iot-map-common-svg.ts @@ -1,6 +1,6 @@ /* * Software Name: IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-config.ts b/src/iotMapManager/src/iot-map-config.ts index 628277c4..af4245e3 100644 --- a/src/iotMapManager/src/iot-map-config.ts +++ b/src/iotMapManager/src/iot-map-config.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-icons.ts b/src/iotMapManager/src/iot-map-icons.ts index 2aacd409..a9aaad40 100644 --- a/src/iotMapManager/src/iot-map-icons.ts +++ b/src/iotMapManager/src/iot-map-icons.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-manager.ts b/src/iotMapManager/src/iot-map-manager.ts index aa75e5a0..5163f459 100644 --- a/src/iotMapManager/src/iot-map-manager.ts +++ b/src/iotMapManager/src/iot-map-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -250,20 +250,15 @@ export class IotMapManager { */ private onElementClick (event) { const element: IotMapDisplay = event.layer - if (this.config.map.externalClustering === true) { - if (element.isCluster()) { - element.elementClicked() // inform cluster to open - } + + if (this.selectedElement === element) { + this.unselectElement(element) } else { - if (this.selectedElement === element) { - this.unselectElement(element) - } else { - this.selectElement(element) - if (element.hasPopup()) { - this.shiftMap(element.getData().location) - } - } + this.selectElement(element) } + + element.elementClicked() // inform cluster to open + element.shiftMap() } /** @@ -272,7 +267,6 @@ export class IotMapManager { */ private onClusterMouseOver (event) { event.layer.setZIndexOffset(100) - this.shiftMap(event.latlng) } /** @@ -289,10 +283,6 @@ export class IotMapManager { */ private onElementMouseOver (event) { event.layer.setZIndexOffset(100) - - if (event.layer.isCluster()) { - this.shiftMap(event.layer.getData().location) - } } /** @@ -353,36 +343,4 @@ export class IotMapManager { elt.updateAccuracyDisplay(this.currentDisplayedLayers, this.accuracyDisplayed) } } - - private shiftMap (currentPos: L.LatLngExpression): void { - const eltPos = this.map.latLngToLayerPoint(currentPos) - const mapBounds = this.map.getBounds() - const northEastPos = this.map.latLngToLayerPoint(mapBounds.getNorthEast()) - const southWestPos = this.map.latLngToLayerPoint(mapBounds.getSouthWest()) - - // top - if (eltPos.y - northEastPos.y < 200) { - const shift = 200 - (eltPos.y - northEastPos.y) - northEastPos.y -= shift - southWestPos.y -= shift - } - - // left - if (eltPos.x - southWestPos.x < 150) { - const shift = 150 - (eltPos.x - southWestPos.x) - northEastPos.x -= shift - southWestPos.x -= shift - } - - // bottom - no need to shift - // right - if (northEastPos.x - eltPos.x < 150) { - const shift = 150 - (northEastPos.x - eltPos.x) - northEastPos.x += shift - southWestPos.x += shift - } - - const newMapBounds = L.latLngBounds(this.map.layerPointToLatLng(southWestPos), this.map.layerPointToLatLng(northEastPos)) - this.map.flyToBounds(newMapBounds) - } } diff --git a/src/iotMapManager/src/iot-map-marker-manager.ts b/src/iotMapManager/src/iot-map-marker-manager.ts index 9c00b2fc..2d896eaa 100644 --- a/src/iotMapManager/src/iot-map-marker-manager.ts +++ b/src/iotMapManager/src/iot-map-marker-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-marker.ts b/src/iotMapManager/src/iot-map-marker.ts index dea3dd67..3013143a 100644 --- a/src/iotMapManager/src/iot-map-marker.ts +++ b/src/iotMapManager/src/iot-map-marker.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -115,11 +115,37 @@ export class IotMapMarker extends IotMapDisplay { } } - public isCluster (): boolean { - return false - } + public shiftMap (): void { + if (this.selected && this.data.popup !== undefined) { + const eltPos = this.map.getIotMap().latLngToLayerPoint(this.data.location) + const mapBounds = this.map.getIotMap().getBounds() + const northEastPos = this.map.getIotMap().latLngToLayerPoint(mapBounds.getNorthEast()) + const southWestPos = this.map.getIotMap().latLngToLayerPoint(mapBounds.getSouthWest()) + + // top + if (eltPos.y - northEastPos.y < 200) { + const shift = 200 - (eltPos.y - northEastPos.y) + northEastPos.y -= shift + southWestPos.y -= shift + } + + // left + if (eltPos.x - southWestPos.x < 150) { + const shift = 150 - (eltPos.x - southWestPos.x) + northEastPos.x -= shift + southWestPos.x -= shift + } - public hasPopup (): boolean { - return this.data.popup !== undefined + // bottom - no need to shift + // right + if (northEastPos.x - eltPos.x < 150) { + const shift = 150 - (northEastPos.x - eltPos.x) + northEastPos.x += shift + southWestPos.x += shift + } + + const newMapBounds = L.latLngBounds(this.map.getIotMap().layerPointToLatLng(southWestPos), this.map.getIotMap().layerPointToLatLng(northEastPos)) + this.map.getIotMap().flyToBounds(newMapBounds) + } } } diff --git a/src/iotMapManager/src/iot-map-path-manager.ts b/src/iotMapManager/src/iot-map-path-manager.ts index a9ecfb13..18934cdc 100644 --- a/src/iotMapManager/src/iot-map-path-manager.ts +++ b/src/iotMapManager/src/iot-map-path-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-path.ts b/src/iotMapManager/src/iot-map-path.ts index b1f857e9..ecdd4737 100644 --- a/src/iotMapManager/src/iot-map-path.ts +++ b/src/iotMapManager/src/iot-map-path.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-types.ts b/src/iotMapManager/src/iot-map-types.ts index b914e7ce..425415e9 100644 --- a/src/iotMapManager/src/iot-map-types.ts +++ b/src/iotMapManager/src/iot-map-types.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -48,16 +48,14 @@ export abstract class IotMapDisplay extends L.Marker { // By default: Nothing to do } + // By default: Nothing to do elementClicked (): void { - // By default: Nothing to do } - hasPopup (): boolean { - return false + shiftMap (): void { + // By default: Nothing to do } - abstract isCluster (): boolean - updateAccuracyDisplay (selectedLayers: string[], display: boolean): void { // eslint-disable-line @typescript-eslint/no-unused-vars // By default: Nothing to do } diff --git a/src/iotMapManager/src/iot-map-user-marker-manager.ts b/src/iotMapManager/src/iot-map-user-marker-manager.ts index 9a6e0336..d922b6b8 100644 --- a/src/iotMapManager/src/iot-map-user-marker-manager.ts +++ b/src/iotMapManager/src/iot-map-user-marker-manager.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/src/iot-map-user-marker.ts b/src/iotMapManager/src/iot-map-user-marker.ts index dc95f29f..c0fdab46 100644 --- a/src/iotMapManager/src/iot-map-user-marker.ts +++ b/src/iotMapManager/src/iot-map-user-marker.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.4 +* Version: 2.6.5 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -68,10 +68,6 @@ export class IotMapUserMarker extends IotMapDisplay { this.accuracyCircle.setLatLng(newLatLng) } - public isCluster (): boolean { - return false - } - public updateAccuracyDisplay (selectedLayers: string[], display: boolean): void { this.layerDisplayed = selectedLayers.includes(this.config.userMarker.layerName) this.accuracityDisplayed = display From b8633ad7e8c2aaadb51523b1eeef376b72711cd5 Mon Sep 17 00:00:00 2001 From: BRKP5614 Date: Tue, 6 Jul 2021 18:01:41 +0200 Subject: [PATCH 6/6] *** Version 2.6.5 *** --- src/iotMapManager/src/iot-map-types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iotMapManager/src/iot-map-types.ts b/src/iotMapManager/src/iot-map-types.ts index 425415e9..4d18c277 100644 --- a/src/iotMapManager/src/iot-map-types.ts +++ b/src/iotMapManager/src/iot-map-types.ts @@ -48,8 +48,8 @@ export abstract class IotMapDisplay extends L.Marker { // By default: Nothing to do } - // By default: Nothing to do elementClicked (): void { + // By default: Nothing to do } shiftMap (): void {