@gouvfr-anct/mediation-numerique
Version:
📚 Bibliothèque pour la cartographie de l’offre de médiation numérique.
90 lines (89 loc) • 3.81 kB
TypeScript
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
import { Map, MapOptions } from 'leaflet';
import { GeometryPolygonConfiguration } from '../../configurations/geometry-polygon.configuration';
import { InitialPositionConfiguration } from '../../configurations/initial-position.configuration';
import { MarkerTypeConfiguration } from '../../configurations/marker-type.configuration';
import { ZoomLevelConfiguration } from '../../configurations/zoom-level.configuration';
import { Structure } from '../models/structure.model';
import { GeoJsonRepository } from '../repositories/geo-json.repository';
import { MapService } from './map.service';
import * as i0 from "@angular/core";
export declare class MapComponent implements OnChanges {
private readonly metropole;
private readonly markerType;
private readonly zoomLevel;
private readonly initialPosition;
private readonly geoJsonService;
private readonly mapService;
isOrientationForm: boolean;
structures: Structure[];
structuresToPrint: Structure[];
toogleToolTipId: string;
selectedMarkerId: string;
isMapPhone: boolean;
searchedValue: string | [number, number];
selectedStructure: EventEmitter<Structure>;
orientationButtonClick: EventEmitter<Structure>;
private currentStructure;
map: Map;
mapOptions: MapOptions;
zoomOptions: {
animate: boolean;
duration: number;
};
clickout(event: any): void;
constructor(metropole: GeometryPolygonConfiguration, markerType: MarkerTypeConfiguration, zoomLevel: ZoomLevelConfiguration, initialPosition: InitialPositionConfiguration, geoJsonService: GeoJsonRepository, mapService: MapService);
ngOnChanges(changes: SimpleChanges): void;
processTownCoordinate(queryString: string): void;
/**
* Create a user position marcker and center the map on it with a zoom level defined in ZoomLevel
* @param coords {[number, number]} Map center position
*/
centerOnCoordinates(coords: [number, number]): void;
/**
* Get structures positions and add marker corresponding to those positons on the map
*/
private handleStructurePosition;
private isToPrint;
/**
* Returns according marker type base on {MarkerType}
* @param {Structure} structure
* @returns {number}
*/
private getMarkerType;
/**
* Return the map marker type given a structure id
* @param {string} id - Structure id
* @returns {number}
*/
private getMarkerTypeByStructureId;
private getStructuresPositions;
/**
* Create tooltip for display
* @param structure Structure
*/
private buildToolTip;
private buildMdmPopUp;
/**
* Add marker when map is ready to be showned
* @param map map
*/
onMapReady(map: Map): void;
/**
* Init map options :
* - Metropole bounds based on a WMS service hosted by data.grandlyon.com
* - Map Layer based on open street maps
*/
private initializeMapOptions;
private initMDMLayer;
private centerLeafletMapOnMarker;
private initMetropoleLayer;
/**
* Close previous markers
* - if strucure is closed
* - if a new marker is selected
*/
private closePreviousMarker;
static ɵfac: i0.ɵɵFactoryDeclaration<MapComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MapComponent, "app-map", never, { "isOrientationForm": "isOrientationForm"; "structures": "structures"; "structuresToPrint": "structuresToPrint"; "toogleToolTipId": "toogleToolTipId"; "selectedMarkerId": "selectedMarkerId"; "isMapPhone": "isMapPhone"; "searchedValue": "searchedValue"; }, { "selectedStructure": "selectedStructure"; "orientationButtonClick": "orientationButtonClick"; }, never, never, false>;
}