From 5852223529ef7df61ec54e95ae8b47970aaace77 Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 25 Jan 2021 17:03:39 +0100 Subject: [PATCH] fix: update unused map package --- package-lock.json | 22 ---------------------- package.json | 2 +- src/app/map/components/map.component.html | 5 ----- src/app/map/components/map.component.ts | 6 +++--- src/app/map/map.module.ts | 3 +-- 5 files changed, 5 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 231f8aa0a..76cfed61c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2645,28 +2645,6 @@ } } }, - "@runette/ngx-leaflet-locate": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@runette/ngx-leaflet-locate/-/ngx-leaflet-locate-1.0.3.tgz", - "integrity": "sha512-U792/VO5PvQKok7H4CHJ+u3L7Vy3Pca3Iki32CXVqloVzUOO0VcNMcF07NoLcXkUHEXX7hJ5I7OGivTyMFcYpQ==", - "requires": { - "@types/leaflet.locatecontrol": "^0.60.7", - "leaflet.locatecontrol": "^0.68.0", - "tslib": "^1.9.0" - }, - "dependencies": { - "leaflet.locatecontrol": { - "version": "0.68.0", - "resolved": "https://registry.npmjs.org/leaflet.locatecontrol/-/leaflet.locatecontrol-0.68.0.tgz", - "integrity": "sha512-jXJCpBvkyH6shjPEOK/DWu/tKX/WdkNeO96jyPrnGelYp9u6wSDj4V1V4aX9+CMTIrEyVB4/4XuU+T7VTRpb6w==" - }, - "tslib": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.0.tgz", - "integrity": "sha512-+Zw5lu0D9tvBMjGP8LpvMb0u2WW2QV3y+D8mO6J+cNzCYIN4sVy43Bf9vl92nqFahutN0I8zHa7cc4vihIshnw==" - } - } - }, "@schematics/angular": { "version": "10.1.3", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-10.1.3.tgz", diff --git a/package.json b/package.json index a6dcfb388..5aeaf424d 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "@angular/router": "~10.1.3", "@asymmetrik/ngx-leaflet": "^8.1.0", "@ngx-translate/core": "^13.0.0", - "@runette/ngx-leaflet-locate": "^1.0.3", "json-server": "^0.16.2", "jwt-decode": "^3.1.2", "leaflet": "^1.7.1", @@ -47,6 +46,7 @@ "@types/jasminewd2": "~2.0.3", "@types/leaflet": "^1.5.17", "@types/node": "^12.12.67", + "@types/leaflet.locatecontrol": "^0.60.7", "codelyzer": "^6.0.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", diff --git a/src/app/map/components/map.component.html b/src/app/map/components/map.component.html index 3503eec70..3af397dbb 100644 --- a/src/app/map/components/map.component.html +++ b/src/app/map/components/map.component.html @@ -1,8 +1,3 @@ <div class="map-wrapper"> <div id="map" class="body-wrap" leaflet [leafletOptions]="mapOptions" (leafletMapReady)="onMapReady($event)"></div> - <!-- <leaflet-locate-control - [map]="map" - [options]="locateOptions" - (location$)="sendLocationEvent($event)" - ></leaflet-locate-control> --> </div> diff --git a/src/app/map/components/map.component.ts b/src/app/map/components/map.component.ts index 0e10c6043..ad2bba78c 100644 --- a/src/app/map/components/map.component.ts +++ b/src/app/map/components/map.component.ts @@ -8,11 +8,10 @@ import { SimpleChanges, ViewChild, } from '@angular/core'; -import { latLng, MapOptions, geoJSON, tileLayer, Map, latLngBounds, layerGroup } from 'leaflet'; +import { latLng, MapOptions, geoJSON, tileLayer, Map, latLngBounds, layerGroup, Control } from 'leaflet'; import { Structure } from '../../models/structure.model'; import { GeojsonService } from '../../services/geojson.service'; import { MapService } from '../services/map.service'; -import { NgxLeafletLocateComponent } from '@runette/ngx-leaflet-locate'; import * as _ from 'lodash'; import { GeoJsonProperties } from '../models/geoJsonProperties.model'; import { MarkerType } from './markerType.enum'; @@ -20,6 +19,7 @@ import { typeStructureEnum } from '../../shared/enum/typeStructure.enum'; import metropole from '../../../assets/geojson/metropole.json'; import brignais from '../../../assets/geojson/brignais.json'; import L from 'leaflet'; +import 'leaflet.locatecontrol'; @Component({ selector: 'app-map', @@ -32,7 +32,6 @@ export class MapComponent implements OnChanges { @Input() public selectedMarkerId: string; @Input() public isMapPhone: boolean; @Input() public locate = false; - @ViewChild(NgxLeafletLocateComponent, { static: false }) locateComponent: NgxLeafletLocateComponent; @Output() selectedStructure: EventEmitter<Structure> = new EventEmitter<Structure>(); @Output() locatationTrigger: EventEmitter<boolean> = new EventEmitter<boolean>(); private lc; @@ -182,6 +181,7 @@ export class MapComponent implements OnChanges { this.map = map; // Handle location this.lc = L.control.locate(this.locateOptions).addTo(this.map); + // .locate(this.locateOptions).addTo(this.map); this.map.on('locationfound', () => { this.locatationTrigger.emit(true); }); diff --git a/src/app/map/map.module.ts b/src/app/map/map.module.ts index 521ecc678..fbb935ca5 100644 --- a/src/app/map/map.module.ts +++ b/src/app/map/map.module.ts @@ -3,10 +3,9 @@ import { CommonModule, DatePipe } from '@angular/common'; import { SharedModule } from '../shared/shared.module'; import { MapComponents } from './components'; import { LeafletModule } from '@asymmetrik/ngx-leaflet'; -import { NgxLeafletLocateModule } from '@runette/ngx-leaflet-locate'; import { BrowserModule } from '@angular/platform-browser'; @NgModule({ - imports: [CommonModule, BrowserModule, SharedModule, NgxLeafletLocateModule, LeafletModule], + imports: [CommonModule, BrowserModule, SharedModule, LeafletModule], declarations: [MapComponents], providers: [DatePipe], exports: [MapComponents], -- GitLab