ChadKillingsworth/geolocation-marker

Having trouble getting your api to work

Closed this issue · 2 comments

Hello,

I have included your geolocation-marker.js API after the google maps API. Using your example code I only get a zoomed in map of Australia. Not circle or dot. Not my location.

I am getting this Javascript error from line #17 of your API.

class GeolocationMarker extends google.maps.MVCObject {

Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

I am also getting a Uncaught ReferenceError: GeolocationMarker is not defined. I assume it's tied to the above problem.

I put together this jsfiddle that show what is happening. Do you have an idea what is going wrong?

I attached a screen shot of the errors.
capture

That src is an ES6 module. I can add the 'add strict' statement, but then you'll get:

geolocation-marker.js:273 Uncaught SyntaxError: Unexpected token export

No browser has native support for ES6 modules. That's why the compressed version in the root is ES5 syntax. The ES6 source requires transpilation to be useful.

And I just realized the REAME doesn't link to the released code which is why you are trying to use the native source. Let me fix that.