import { AfterContentInit, EventEmitter, OnDestroy } from "@angular/core"; import { Feature as GeoJSONFeature, FeatureCollection as GeoJSONFeatureCollection, GeometryObject, Point } from "geojson"; import { GeoJSON, LatLng, Layer, LeafletEvent, LeafletMouseEvent, PathOptions, PopupEvent, TooltipEvent } from "leaflet"; import { LayerGroupProvider } from "./layer-group.provider"; import { LayerProvider } from "./layer.provider"; import * as i0 from "@angular/core"; /** * Interface for the styler function of the GeoJSON directive. * * You can return an individual style (PathOption) for each feature. As basis you get the feature itself and the default * style. * * *Note: This functions is enhanced against the original style function with a default style* * @link http://leafletjs.com/reference-1.2.0.html#geojson-style Original Leaflet documentation */ export declare type IGeoJSONStylerFn = (geoJSON: GeoJSONFeature, defaultStyle: PathOptions) => PathOptions; /** * Interface for the filter function of the GeoJSON directive. * * You can return a boolean value on each feature according if you want to add the feature or not. * @link http://leafletjs.com/reference-1.2.0.html#geojson-filter Original Leaflet documentation */ export declare type IGeoJSONFilterFn = (feature: GeoJSONFeature) => boolean; /** * Interface for the point to layer function of the GeoJSON directive. * * You can return any type of Layer that should represent the feature of type point. * @link http://leafletjs.com/reference-1.2.0.html#geojson-pointtolayer Original Leaflet documentation */ export declare type IGeoJSONPointToLayerFn = (geoJSON: GeoJSONFeature, latLng: LatLng) => Layer; /** * Interface for the protected middleware property of the GeoJSON directive. */ export interface IGeoJSONDirectiveMiddlewareDictionary { styler?: IGeoJSONStylerFn; filter?: IGeoJSONFilterFn; pointToLayer?: IGeoJSONPointToLayerFn; defaultStyle?: PathOptions; } /** * Angular2 directive for GeoJSON of Leaflet. * * *You can use this directive in an Angular2 template after importing `YagaModule`.* * * How to use in a template: * ```html * * * * * ``` * * @link http://leafletjs.com/reference-1.2.0.html#geojson Original Leaflet documentation * @link https://leaflet-ng2.yagajs.org/latest/browser-test?grep=GeoJSON%20Directive Unit-Test * @link https://leaflet-ng2.yagajs.org/latest/coverage/lcov-report/lib/geojson.directive.js.html * Test coverage * @link https://leaflet-ng2.yagajs.org/latest/typedoc/classes/geojson.directive.js.html API documentation * @example https://leaflet-ng2.yagajs.org/latest/examples/geojson-directive/ */ export declare class GeoJSONDirective extends GeoJSON implements OnDestroy, AfterContentInit { protected parentLayerGroupProvider: LayerGroupProvider; dataChange: EventEmitter>; /** * From leaflet fired add event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-add Original Leaflet documentation */ addEvent: EventEmitter; /** * From leaflet fired remove event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-remove Original Leaflet documentation */ removeEvent: EventEmitter; /** * From leaflet fired popupopen event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-popupopen Original Leaflet documentation */ popupopenEvent: EventEmitter; /** * From leaflet fired popupclose event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-popupclose Original Leaflet documentation */ popupcloseEvent: EventEmitter; /** * From leaflet fired tooltipopen event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-tooltipopen Original Leaflet documentation */ tooltipopenEvent: EventEmitter; /** * From leaflet fired tooltipclose event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-tooltipclose Original Leaflet documentation */ tooltipcloseEvent: EventEmitter; /** * From leaflet fired click event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-click Original Leaflet documentation */ clickEvent: EventEmitter; /** * From leaflet fired dblclick event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-dblclick Original Leaflet documentation */ dblclickEvent: EventEmitter; /** * From leaflet fired mousedown event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-mousedown Original Leaflet documentation */ mousedownEvent: EventEmitter; /** * From leaflet fired mouseover event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-mouseover Original Leaflet documentation */ mouseoverEvent: EventEmitter; /** * From leaflet fired mouseout event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-mouseout Original Leaflet documentation */ mouseoutEvent: EventEmitter; /** * From leaflet fired contextmenu event. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-contextmenu Original Leaflet documentation */ contextmenuEvent: EventEmitter; onEachFeatureEvent: EventEmitter<{ feature: GeoJSONFeature; layer: Layer; }>; /** * Property to prevent changes before directive is initialized */ protected initialized: boolean; /** * Object that stores the middleware functions and the default style */ protected middleware: IGeoJSONDirectiveMiddlewareDictionary; constructor(parentLayerGroupProvider: LayerGroupProvider, layerGroupProvider: LayerGroupProvider, layerProvider: LayerProvider); /** * Internal method that provides the initialization of the child popup or tooltip */ ngAfterContentInit(): void; /** * Internal method to provide the removal of the layer in Leaflet, when removing it from the Angular template */ ngOnDestroy(): void; /** * Derived method of the original addData. * @link http://leafletjs.com/reference-1.2.0.html#geojson-adddata Original Leaflet documentation */ addData(data: GeoJSONFeature): Layer; /** * Derived method of the original clearLayers. * @link http://leafletjs.com/reference-1.2.0.html#geojson-clearlayers Original Leaflet documentation */ clearLayers(): this; /** * Method to remove all existing data and add the new data in one step. * * *Note: this is a combination of `clearLayers` and `addData`* */ setData(val: GeoJSONFeatureCollection): this; /** * Two-Way bound property for the data geoJSON data. * Use it with `` or `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-l-geojson Original Leaflet documentation */ set data(val: GeoJSONFeatureCollection); get data(): GeoJSONFeatureCollection; /** * Input for the filter function. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-filter Original Leaflet documentation */ set filter(filterFn: IGeoJSONFilterFn | undefined); get filter(): IGeoJSONFilterFn | undefined; /** * Input for the pointToLayer function. * Use it with `` * @link http://leafletjs.com/reference-1.2.0.html#geojson-pointtolayer Original Leaflet documentation */ set pointToLayer(pointToLayerFn: IGeoJSONPointToLayerFn | undefined); get pointToLayer(): IGeoJSONPointToLayerFn | undefined; /** * Input for the styler function. * Use it with `` * * *Note: The function can follow the `IGeoJSONStylerFn` interface. It enhances the leaflet ones with the default * style as second parameter* * @link http://leafletjs.com/reference-1.2.0.html#geojson-style Original Leaflet documentation */ set styler(stylerFn: IGeoJSONStylerFn | undefined); get styler(): IGeoJSONStylerFn | undefined; /** * Input for the default style. * Use it with `` * * *Note: Leaflet does not provide a default style, it just provides a style function!* */ set defaultStyle(style: PathOptions); get defaultStyle(): PathOptions; /** * Method to apply changes to the geometries */ protected redraw(): void; static ɵfac: i0.ɵɵFactoryDeclaration, [{ skipSelf: true; }, null, null]>; static ɵdir: i0.ɵɵDirectiveDeclaration, "yaga-geojson", never, { "data": "data"; "filter": "filter"; "pointToLayer": "pointToLayer"; "styler": "styler"; "defaultStyle": "defaultStyle"; }, { "dataChange": "dataChange"; "addEvent": "add"; "removeEvent": "remove"; "popupopenEvent": "popupopen"; "popupcloseEvent": "popupclose"; "tooltipopenEvent": "tooltipopen"; "tooltipcloseEvent": "tooltipclose"; "clickEvent": "click"; "dblclickEvent": "dblclick"; "mousedownEvent": "mousedown"; "mouseoverEvent": "mouseover"; "mouseoutEvent": "mouseout"; "contextmenuEvent": "contextmenu"; "onEachFeatureEvent": "onEachFeature"; }, never>; }