Skip to content

Commit

Permalink
*** Version V2.1.0 ***
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrinegateau committed Apr 9, 2021
1 parent 687132b commit 97ea76a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 16 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.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
"@types/leaflet": "^1.5.19",
"@types/leaflet.markercluster": "^1.4.3",
"boosted": "^4.6.0",
"iotmapmanager": "^2.0.1",
"iotmapmanager-test": "0.0.22",
"iotmapmanager": "^2.1.0",
"leaflet": "^1.6.0",
"leaflet.markercluster": "^1.4.1",
"zone.js": "^0.11.3"
Expand Down
58 changes: 47 additions & 11 deletions src/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,12 @@ export class MapComponent implements AfterViewInit {
lat: 44.885,
lng: 4.870
},

shape: {
type: ShapeType.circle,
percent: 75,
anchored: false
anchored: false,
direction: 0
},
status: 'positive',
inner: {
Expand All @@ -241,6 +243,9 @@ export class MapComponent implements AfterViewInit {
lat: 44.885,
lng: 4.875
},
shape: {
direction: 90
},
template: 'vehicle',
status: 'neutral',
tab: {
Expand All @@ -251,30 +256,39 @@ export class MapComponent implements AfterViewInit {
{
id: 'c3',
layer: 'circles',
location: {
location: {
lat: 44.885,
lng: 4.88
},
shape: {
direction: 45
},
template: 'vehicle',
status: 'warning'
},
{
id: 'c4',
layer: 'circles',
location: {
location: {
lat: 44.885,
lng: 4.885
},
shape: {
direction: 220
},
template: 'vehicle',
status: 'alert'
},
{
id: 'c5',
layer: 'circles',
location: {
location: {
lat: 44.885,
lng: 4.890
},
shape: {
direction: 270
},
template: 'vehicle',
status: 'inactive'
},
Expand All @@ -284,6 +298,9 @@ export class MapComponent implements AfterViewInit {
lat: 44.885,
lng: 4.895
},
shape: {
direction: 320
},
popup: {
title: `<img src='../assets/icons/temperature.svg'><br>`,
body: `La <i>température</i><br><b>de 18°C</b>`,
Expand All @@ -293,8 +310,10 @@ export class MapComponent implements AfterViewInit {
inner: {
label: "H",
color: 'black'
}
}];
},

}
];

clustersList: IotCluster[] = [
{
Expand Down Expand Up @@ -337,7 +356,7 @@ export class MapComponent implements AfterViewInit {
lat: 44.882,
lng: 4.885
},
layer: 'etablissements',
layer: 'vehicles',
contentLabel: 'Entertainment',
childCount: 60,
aggregation: [
Expand Down Expand Up @@ -485,7 +504,7 @@ export class MapComponent implements AfterViewInit {
this.conf.setConfig({
markerTemplates: {
'vehicle': {
layer: 'vehicle',
layer: 'vehicles',
shape: {
type: ShapeType.circle,
anchored: true,
Expand All @@ -497,29 +516,46 @@ export class MapComponent implements AfterViewInit {
}
},
map: {
externalClustering: false,
externalClustering: true,
layerControl: true,
exclusiveLayers: true
},
layerTemplates: {
'etablissements': {
content: `<span class='iotmap-icons-School'></span>`,
type: TabType.normal
},
'meters': {
content: '<img width=16 src="../assets/icons/check_your_balance.svg">'
},
'autos': {
content: 'Cars',
type: TabType.large
}
}
});
})


this.commonIotMap.onMove = () => {
const coord = this.commonIotMap.getIotMap().getBounds()
console.log('map bounds changed: [' + coord.getNorthEast().lat + ', ' + coord.getNorthEast().lng
+ '] / [' + coord.getSouthWest().lat + ', ' + coord.getSouthWest().lng + ']')
}


this.commonIotMap.init('iotMap')
this.iotMapMarkerManager.addMarkers(this.markersList)
this.iotMapClusterManager.addClusters(this.clustersList)
this.iotMapUserMarkerManager.addUserMarker(this.userMarker)
this.iotMapPathManager.addPath(this.chemin)


setTimeout(() => { this.iotMapClusterManager.updateCluster('entertainments', { layer: 'meters'})}, 3000)
setTimeout(() => { this.iotMapClusterManager.updateCluster('services', { layer: 'autos'})}, 3000)


setTimeout(() => { this.iotMapMarkerManager.updateMarker('s1', {shape: {accuracy: 600}})}, 3000)
setTimeout(() => { this.iotMapMarkerManager.removeMarker('s1')}, 5000)
//setTimeout(() => { this.iotMapMarkerManager.removeMarker('s1')}, 5000)
setTimeout(() => { this.iotMapMarkerManager.updateMarker('s5', {shape : { accuracy: undefined}})}, 5000)
}
}
Expand Down
1 change: 1 addition & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/* You can add global styles to this file, and also import other style files */
@import 'iotmapmanager/iot-map-manager.css';
@import "~boosted/dist/css/boosted.min.css";

0 comments on commit 97ea76a

Please sign in to comment.