import { Feature, GeoJsonObject, Point } from 'geojson'; import L from 'leaflet'; class GeoFlowLayer extends L.GeoJSON { public initialize = (data: any, options: L.GeoJSONOptions) => { const modifiedOptions = { onEachFeature: this.onEachFeature.bind(this), pointToLayer: this.pointToLayer.bind(this), ...options, } as L.GeoJSONOptions; L.Util.setOptions(this, modifiedOptions); super.addData(data); } // Place Feature on Map public pointToLayer = (geoJsonPoint: Feature, latLng: L.LatLng) => { } // Feature Initialization public onEachFeature = (feature: Feature, layer: L.Layer) => { layer.on('click', this.handleFeatureClicked, this); layer.on('mouseover', this.handleFeatureMouseOver, this); layer.on('mouseout', this.handleFeatureMouseOut, this); // layer.bindPopup(feature.properties.facilityName); } private handleFeatureClicked = (e: L.LeafletEvent) => { } private handleFeatureMouseOver = (e: L.LeafletEvent) => { } private handleFeatureMouseOut = (e: L.LeafletEvent) => { } } export const FlowLayer = L.GeoJSON.extend(new GeoFlowLayer()); export const flowLayer = () => (new FlowLayer()); ////////////////////////////////////////////////////////////////////// class PieMarker extends L.CircleMarker { }