diff --git a/package-lock.json b/package-lock.json index 486bfff8..df9af751 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10095,9 +10095,9 @@ } }, "iotmapmanager": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/iotmapmanager/-/iotmapmanager-2.6.7.tgz", - "integrity": "sha512-iLnwuteSJ3ibZKu99zoS3bD1Ur9hqjuqBzvoztjtzCBJWYsByb+7TVFxNVRiZvjCqB+iqPs7s8lt4uj+m9oKRw==", + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/iotmapmanager/-/iotmapmanager-2.6.8.tgz", + "integrity": "sha512-SnE04uXRh10Lc7IbTZBcjtd0wMcNKTOffm5SakKN2+Up5leVaHRXTtcylTfSOLW//GspELm78X00jhIZ7nN8cg==", "requires": { "@types/leaflet": "^1.5.19", "@types/leaflet.markercluster": "^1.4.3", diff --git a/package.json b/package.json index 75e1ec85..e258fdb1 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.7", + "iotmapmanager": "^2.6.8", "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 5196053f..a61a206f 100644 --- a/src/iotMapManager/css/map.css +++ b/src/iotMapManager/css/map.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.7 +* Version: 2.6.8 * 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 882eb993..df9249ce 100644 --- a/src/iotMapManager/css/markers.css +++ b/src/iotMapManager/css/markers.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.7 +* Version: 2.6.8 * 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 d1f05c25..c2caf151 100644 --- a/src/iotMapManager/css/popup.css +++ b/src/iotMapManager/css/popup.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.7 +* Version: 2.6.8 * 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 cea2271f..361c016b 100644 --- a/src/iotMapManager/css/tabs.css +++ b/src/iotMapManager/css/tabs.css @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.7 +* Version: 2.6.8 * 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 c2477e3b..c2ecb9c0 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.7 +* Version: 2.6.8 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/index.ts b/src/iotMapManager/index.ts index b95b9776..34d16402 100644 --- a/src/iotMapManager/index.ts +++ b/src/iotMapManager/index.ts @@ -1,6 +1,6 @@ /* * Software Name : IotMapManager -* Version: 2.6.7 +* Version: 2.6.8 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/iotMapManager/package.json b/src/iotMapManager/package.json index f577191b..989a9683 100644 --- a/src/iotMapManager/package.json +++ b/src/iotMapManager/package.json @@ -1,6 +1,6 @@ { "name": "iotmapmanager", - "version": "2.6.7", + "version": "2.6.8", "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 79ac7fb8..22678e17 100644 --- a/src/iotMapManager/readme.md +++ b/src/iotMapManager/readme.md @@ -1,4 +1,4 @@ -# IotMapManager V2.6.7 +# IotMapManager V2.6.8 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 d200b254..821e0431 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.7 +* Version: 2.6.8 * 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 7a8e5cec..2388b059 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.7 +* Version: 2.6.8 * 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 56a9eb11..3d345135 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.7 +* Version: 2.6.8 * 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 ad1dcd43..3edf9e0d 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.7 +* Version: 2.6.8 * 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 cb8b1c43..c3e12b51 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.7 +* Version: 2.6.8 * 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 6dd2fede..4f989806 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.7 +* Version: 2.6.8 * 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 70148f3b..d1c7aac5 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.7 +* Version: 2.6.8 * 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 f8e6f940..2741464c 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.7 +* Version: 2.6.8 * 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 f431bbbf..7c7c7785 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.7 +* Version: 2.6.8 * 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 254dd150..e581b5ef 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.7 +* Version: 2.6.8 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * @@ -51,11 +51,6 @@ 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 { @@ -122,11 +117,15 @@ export class IotMapMarker extends IotMapDisplay { const northEastPos = this.map.getIotMap().latLngToLayerPoint(mapBounds.getNorthEast()) const southWestPos = this.map.getIotMap().latLngToLayerPoint(mapBounds.getSouthWest()) + let needToshift = false + // top if (eltPos.y - northEastPos.y < 200) { const shift = 200 - (eltPos.y - northEastPos.y) northEastPos.y -= shift southWestPos.y -= shift + + needToshift = true } // left @@ -134,6 +133,8 @@ export class IotMapMarker extends IotMapDisplay { const shift = 150 - (eltPos.x - southWestPos.x) northEastPos.x -= shift southWestPos.x -= shift + + needToshift = true } // bottom - no need to shift @@ -142,10 +143,14 @@ export class IotMapMarker extends IotMapDisplay { const shift = 150 - (northEastPos.x - eltPos.x) northEastPos.x += shift southWestPos.x += shift + + needToshift = true } - const newMapBounds = L.latLngBounds(this.map.getIotMap().layerPointToLatLng(southWestPos), this.map.getIotMap().layerPointToLatLng(northEastPos)) - this.map.getIotMap().flyToBounds(newMapBounds) + if (needToshift) { + 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 e1f17cba..4b74e8bc 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.7 +* Version: 2.6.8 * 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 a822b88b..030309ba 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.7 +* Version: 2.6.8 * 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 af807f47..d7c2d9aa 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.7 +* Version: 2.6.8 * 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 5755a164..d2a89e01 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.7 +* Version: 2.6.8 * 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 18306633..3058f7e5 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.7 +* Version: 2.6.8 * SPDX-FileCopyrightText: Copyright (c) 2020 Orange * SPDX-License-Identifier: MIT * diff --git a/src/map/map.component.ts b/src/map/map.component.ts index e013852a..721eca54 100644 --- a/src/map/map.component.ts +++ b/src/map/map.component.ts @@ -48,6 +48,48 @@ export class MapComponent implements AfterViewInit { }, inner: { label: 'H' + }, + popup: { + title: 'S1', + body: 'body de s1' + } + }, + { + id: 's1bis', + location: { + lat: 44.895, + lng: 4.870 + }, + template: 'square', + status: 'test', // 'warning', + tab: { + content: '' + }, + inner: { + label: 'H' + }, + popup: { + title: 'S1bis', + body: 'body de s1bis' + } + }, + { + id: 's1ter', + location: { + lat: 44.895, + lng: 4.870 + }, + template: 'square', + status: 'test', // 'warning', + tab: { + content: '' + }, + inner: { + label: 'H' + }, + popup: { + title: 'S1ter', + body: 'body de s1ter' } }, { @@ -630,7 +672,7 @@ export class MapComponent implements AfterViewInit { } }, map: { - externalClustering: true, + externalClustering: false, layerControl: true, exclusiveLayers: false }, @@ -665,13 +707,6 @@ export class MapComponent implements AfterViewInit { console.log('map bounds changed: [' + coord.getNorthEast().lat + ', ' + coord.getNorthEast().lng + '] / [' + coord.getSouthWest().lat + ', ' + coord.getSouthWest().lng + ']') } - this.commonIotMap.onEltClick = (id) => { - console.log('click on ' + id + ' !') - - setTimeout(() => { - this.iotMapMarkerManager.updateMarker(id, { popup: { title: 'Update', body: 'Popup mise à jour' } }) - }, 3000) - } this.commonIotMap.init('iotMap') this.iotMapMarkerManager.addMarkers(this.markersList) this.iotMapClusterManager.addClusters(this.clustersList)