-
Notifications
You must be signed in to change notification settings - Fork 29
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
instantiate a new drawing with a custom control #145
Comments
import * as L from 'leaflet';
This is how I made it and it works... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm attempting to create a custom control to draw a polygon. I can successfully add the toolbar and draw a polygon using the buttons, but I want to do this through a custom toolbar. I'm trying this:
this.polygonDrawer = new Draw.Polygon(this.map,{
metric: false,
feet: false,
shapeOptions: {
color: '#85bb65',
},
})
however it doesn't like the this.map argument. this.map is the instance of my leaflet map in the Angular project. I get an error:
Argument of type 'Map' is not assignable to parameter of type 'DrawMap'.
Type 'Map' is missing the following properties from type 'DrawMap': mergeOptions, addInitHook
DrawMap seems to be a specific type that I can't find a reference for, but TS tells me it is this:
DrawMap(element: string | HTMLElement, options?: MapOptions): DrawMap
I'm not sure how this is supposed to relate to the leaflet map. Why would I need a different reference to the map other than the map I already have?
The text was updated successfully, but these errors were encountered: