Working on my Angular 8 project, I needed to display several markers on a map, so I chose to utilize Leaflet. Since there were potentially thousands of markers involved, I opted for Leaflet.PixiOverlay to ensure smooth performance. After installing and importing all the necessary libraries:
import * as PIXI from 'pixi.js';
import 'leaflet-pixi-overlay';
import * as L from 'leaflet';
Everything seemed fine at this point. However, when attempting to draw a marker (following the guidance provided by Leaflet.PixiOverlay), I encountered an issue.
const pixiOverlay = L.pixiOverlay(function(utils) {
// Code goes here
}, pixiContainer);
pixiOverlay.addTo(this.map);
The problem arises with L.pixiOverlay
, highlighted in red, accompanied by the following compilation error:
ERROR: .... /pages/maps/map.component.ts(86,29): error TS2339: Property 'pixiOverlay' does not exist on type 'typeof import("C:/Users/ .... /node_modules/@types/leaflet/index")'.
Could anyone offer some insights or solutions? Appreciate your help in advance.