Commit 72dfa80e2b0cb05b753554f82af013dd99eef3fe
1 parent
287033a627
Exists in
master
eache vessel have different color on map
Showing 4 changed files with 4 additions and 13 deletions Side-by-side Diff
src/app/component/list-vessel/list-vessel.component.ts
View file @
72dfa80
src/app/component/map/map.component.ts
View file @
72dfa80
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | export class MapComponent implements OnInit { |
14 | 14 | vessels: Vessels; |
15 | 15 | public map: L.Map; |
16 | + renderer = L.canvas({ padding: 0.5 }); | |
16 | 17 | circleMarkers: Map<number, CircleMarker> = new Map<number, CircleMarker>(); |
17 | 18 | |
18 | 19 | constructor(private vesselsService: VesselsService) { |
... | ... | @@ -31,9 +32,7 @@ |
31 | 32 | } |
32 | 33 | |
33 | 34 | initMap(): void { |
34 | - this.map = L.map('map', { | |
35 | - preferCanvas: true | |
36 | - }).setView([0, 0], 1); | |
35 | + this.map = L.map('map').setView([0, 0], 1); | |
37 | 36 | L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { |
38 | 37 | attribution: 'map', |
39 | 38 | }).addTo(this.map); |
... | ... | @@ -42,6 +41,7 @@ |
42 | 41 | addCircleMarker(message: Message, color: string): void { |
43 | 42 | const circleMarker = L.circleMarker([+message.latitude, +message.longitude], |
44 | 43 | { |
44 | + renderer: this.renderer, | |
45 | 45 | radius: 0.1, |
46 | 46 | color |
47 | 47 | }).addTo(this.map); |
src/app/model/vessel.ts
View file @
72dfa80