Wildhoney / Leaflet.FreeDraw

:earth_asia: FreeDraw allows the free-hand drawing of shapes on your Leaflet.js map layer – providing an intuitive and familiar UX for creating geospatial boundaries similar to Zoopla and others. Included out-of-the-box is the concaving of polygons, polygon merging and simplifying, as well as the ability to add edges and modify existing shapes.
https://freedraw.herokuapp.com/
MIT License
544 stars 103 forks source link

We have had the same problem with angular (7/8). #162

Open dhaneshawate opened 4 years ago

dhaneshawate commented 4 years ago

We have had the same problem with angular (7/8). We ended up with a fork where we added the same core-js polyfills that angular does to avoid the zone.js conflict.

FreeDraw.js:

delete: import 'core-js';

add: import 'core-js/es6/symbol'; import 'core-js/es6/object'; import 'core-js/es6/function'; import 'core-js/es6/parse-int'; import 'core-js/es6/parse-float'; import 'core-js/es6/number'; import 'core-js/es6/math'; import 'core-js/es6/string'; import 'core-js/es6/date'; import 'core-js/es6/array'; import 'core-js/es6/regexp'; import 'core-js/es6/map'; import 'core-js/es6/weak-map'; import 'core-js/es6/set';

Originally posted by @AndreasOlausson in https://github.com/Wildhoney/Leaflet.FreeDraw/issues/141#issuecomment-533563770

dhaneshawate commented 4 years ago

i have added above code but still the issue remains. please guide according i am trying to do this in angular 9

AndreasOlausson commented 4 years ago

Try to import Freedraw just before you import Zone.

polyfill.ts (something like this):

import "leaflet-freedraw" /***

However, we don't use freedraw any longer, due the lack of "donut-polygon" support so we have written our own "freedraw".

chriswilley commented 4 years ago

In my case, updating zone.js to 0.10.3 solved this issue.

https://github.com/angular/angular/issues/31724#issuecomment-600634210