dwilhelm89 / Leaflet.StyleEditor

Edit the style of features within Leaflet.
MIT License
174 stars 48 forks source link

StyleEditor Errors using Internet Explorer #92

Open kyscott opened 4 years ago

kyscott commented 4 years ago

I noticed an issue with using the StyleEditor in Internet Explorer. When trying to open a page with a Leaflet Map with the StyleEditor integrated, the page doesn't load and the console throws an error. It says that it's looking for a ':' in the Form.js file on the line with the function called "showFormElementForStyleOption". I believe this may be an error with ES6 as everything works fine in Firefox, Chrome and Edge.

Is this is a known issue and is there a possible resolution to make things work in Internet Explorer?

fupduck commented 4 years ago

Currently I use the babel default and everything is transpiled to ES6. Changing this should not be too difficult. I'll have a look. What IE do you want to support?

kyscott commented 4 years ago

Got ya, I appreciate it. It would be IE 11 that I'd want to support.

fupduck commented 4 years ago

@kyscott Did this problem resolve? It should work on IE11, as it is only ES5 - but I have no option to test this.

pipedreamer007 commented 4 years ago

@fupduck I noticed in the project's package.json that the "main" property points to source code rather than the distribution directory's minified javascript. Could you modify it to point to the minified javascript file?

By doing this, I believe @kyscott and everyone else will get access to your transpiled IE 11-compatible code...as the source code itself isn't IE 11-compatible. Many thanks for your help & work!

fupduck commented 4 years ago

@pipedreamer007 Thanks for the hint. I thought it would be good practice to point to the non minified version as this helps other projects which use i.e. webpack. I just read https://stackoverflow.com/questions/48673408/should-javascript-npm-packages-be-minified and will try to create a new npmjs package. I suggest either 'leaflet-styleeditor-minified' of 'leaflet-styleeditor-es5'.

EvoDevMan commented 4 years ago

@fupduck I wanted to know the status of creating a new npmjs package that points to the minified version of leaflet style editor. Is that still an item you are working on since this does resolve the IE 11 compatibility issue for leaflet style editor?

fupduck commented 4 years ago

@EvoDevMan yes - hopefully will have time this weekend

fupduck commented 4 years ago

@kyscott @EvoDevMan @pipedreamer007 now published https://www.npmjs.com/package/leaflet-styleeditor-minified

fupduck commented 4 years ago

@fupduck Memo: create option to use travis for publishing

pipedreamer007 commented 4 years ago

@fupduck Many thanks for your hard work & excellent plug-in! I actually learned a bit looking at your project.

fupduck commented 4 years ago

@pipedreamer007 thanks this means a lot to me :)