-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular 9 is this supports? if yes then pls share reference code #133
Comments
I was facing the same issue, what I did was separating the markerOptions object declaration, and passing the object to the marker on its creation time. Like this: ( I am using angular 8 ) let options : any = {
riseOnHover:true,
icon:icon,
contextmenu: true,
contextmenuWidth: 140,
contextmenuItems: [{
text: 'Marker item',
}]
};
let marker : L.Marker = L.marker([address.lat,address.lng],options); |
I am using Angular 14/15. How would this work with typescript since there is no type definitions available? |
Found solution on my own. Where I import 'leaflet-contextmenu', I manually added the type definition called leaflet-contextmenu.d.ts with the following content:
Now, I am able to declare those options, compile and the plugin works. Tested in react with TS, it should work with Angular too. |
Hi
i was install npm in angular 9 project but there is having one issue
contextmenu: true,
giving error is
error TS2345: Argument of type '{ center: [number, number]; zoomControl: false; zoom: number; contextmenu: boolean; contextmenuWidth: number; contextmenuHeight: number; contextmenuItems: { text: string; callback: (e: any) => void; }[]; }' is not assignable to parameter of type 'MapOptions'.
Object literal may only specify known properties, and 'contextmenu' does not exist in type 'MapOptions'.
plz give me any working reference with angular 9
The text was updated successfully, but these errors were encountered: