- webpack config separation for development and production

- load only the necessary classes from leaflet
This commit is contained in:
Arno Kaimbacher 2021-08-25 17:52:09 +02:00
parent 7857e2c5bb
commit bc44385846
13 changed files with 883 additions and 209 deletions

View file

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import * as L from 'leaflet';
import { Map, circleMarker } from 'leaflet';
// @Injectable({
// // declares that this service should be created
@ -33,7 +33,7 @@ export class MarkerService {
// });
// }
makeCapitalCircleMarkers(map: L.Map): void {
makeCapitalCircleMarkers(map: Map): void {
this.http.get(this.capitalsUrl).subscribe((res: any) => {
let maxPop = Math.max(...res.features.map(x => x.properties.population), 0);
@ -42,7 +42,7 @@ export class MarkerService {
const lon = c.geometry.coordinates[0];
const lat = c.geometry.coordinates[1];
// const circle = L.circleMarker([lat, lon]);
let circle = L.circleMarker([lat, lon], {
let circle = circleMarker([lat, lon], {
radius: MarkerService.scaledRadius(c.properties.population, maxPop)
});
circle.addTo(map);