-
Notifications
You must be signed in to change notification settings - Fork 2
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
Import Leaflet style #9
Comments
Implemented for object and function styles with simple logic. |
Currently doesn't work for point layers, as need to parse their |
I believe this currently only works with style functions if they are anonymous functions directly set as the value of the |
OK, so my current starting point is to get loop through all elements in However, this fails when something (in this case a style property) has a value which is a function call. The corresponding function definition is obviously not part of the Do I have to lop through But it seems like a lot of work... |
No, I think I've got that fundamentally wrong... My existing loop matches the DOM element which is So, obviously without resorting to the completely impossible task of retrieving relevant script via regex, how can I retrieve the source of a function's definition when all I have is a call to it? I have parsed the call, so I know the function name. |
No, I wasn't wrong. Apparently function definitions within a |
Good grief. I've gone all the way round this in my head, just to arrive at: esprima.parse(window.funcName.toString()); |
Not easy - perhaps start with simple styles only (ie when the style is not a function)?
The text was updated successfully, but these errors were encountered: