DenisCarriere / geocoder-geojson

Geocoding results in GeoJSON format
https://www.npmjs.com/package/geocoder-geojson
MIT License
21 stars 10 forks source link

Doesn't work in IE11 #3

Closed polikin closed 7 years ago

polikin commented 7 years ago

The only error IE11 return is Expected ')'.

When I compile my js (with browserify) I get this error:

uglify-js failed on node_modules/geocoder-geojson/index.js : SyntaxError: Unexpected token operator «=», expected punc «,» (line: 37, col: 33, pos: 2041)

DenisCarriere commented 7 years ago

@polikin This is an ES6 module, you might need to use something like Babel. It uses Async & Await functionality from ES6.

This library was intended to be used with NodeJS, however I'm supportive of supporting IE 11 if there's an easy solution to support the many web browsers out there.

DenisCarriere commented 7 years ago

@polikin Try using Webpack, they just released a major release and seems to be very straight forward to use.

Unfortunately, I personally haven't gotten it to work with geocoder-geojson, but maybe it's my current setup, I have to experiment more with it.

https://webpack.js.org/

DenisCarriere commented 7 years ago

Oh it's breaking because of default values in the functions.

function mapbox(address, options = providers_1.Mapbox.Options) {

Try using Webpack instead of Browserify

DenisCarriere commented 7 years ago

@polikin I've got it working now with Browserify & Webpack, so both of them are good to go, I've included some examples in this repo.

https://github.com/DenisCarriere/geocoder-geojson/tree/master/examples

polikin commented 7 years ago

Cool! Thanks!