Skip to content

Commit

Permalink
*** Version 2.6.5 ***
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrinegateau committed Jul 6, 2021
1 parent 48838da commit 057725b
Show file tree
Hide file tree
Showing 26 changed files with 69 additions and 95 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/css/map.css
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/css/markers.css
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/css/popup.css
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/css/tabs.css
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/import_png.d.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/index.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/iot-map-manager.css
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# IotMapManager V2.6.4
# IotMapManager V2.6.5

This library provides management of markers dedicated to projects using mapping.
## use
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-area-manager.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-area.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-cluster-manager.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
6 changes: 1 addition & 5 deletions src/iotMapManager/src/iot-map-cluster.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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
}
}
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-common-svg.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-config.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-icons.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
58 changes: 8 additions & 50 deletions src/iotMapManager/src/iot-map-manager.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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()
}

/**
Expand All @@ -272,7 +267,6 @@ export class IotMapManager {
*/
private onClusterMouseOver (event) {
event.layer.setZIndexOffset(100)
this.shiftMap(event.latlng)
}

/**
Expand All @@ -289,10 +283,6 @@ export class IotMapManager {
*/
private onElementMouseOver (event) {
event.layer.setZIndexOffset(100)

if (event.layer.isCluster()) {
this.shiftMap(event.layer.getData().location)
}
}

/**
Expand Down Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-marker-manager.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
38 changes: 32 additions & 6 deletions src/iotMapManager/src/iot-map-marker.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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)
}
}
}
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-path-manager.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-path.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
10 changes: 4 additions & 6 deletions src/iotMapManager/src/iot-map-types.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/iotMapManager/src/iot-map-user-marker-manager.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
6 changes: 1 addition & 5 deletions src/iotMapManager/src/iot-map-user-marker.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 057725b

Please sign in to comment.