diff --git a/dist/nlmaps-geolocator.iife.js b/dist/nlmaps-geolocator.iife.js index bdd6f93c..604b75ec 100644 --- a/dist/nlmaps-geolocator.iife.js +++ b/dist/nlmaps-geolocator.iife.js @@ -77,7 +77,7 @@ var EmitOnOff = module.exports = function(thing){ }; }); -const geoLocateDefaultOpts = { +var geoLocateDefaultOpts = { follow: false }; @@ -88,23 +88,23 @@ function positionErrorHandler(error) { this.emit('error', error); } -const GeoLocator = function (opts) { - const state = Object.assign({}, geoLocateDefaultOpts, opts); +var GeoLocator = function GeoLocator(opts) { + var state = Object.assign({}, geoLocateDefaultOpts, opts); return { - start() { + start: function start() { state.started = true; navigator.geolocation.getCurrentPosition(positionHandler.bind(this), positionErrorHandler.bind(this), { maximumAge: 60000 }); return this; }, - stop() { + stop: function stop() { state.started = false; return this; }, - isStarted() { + isStarted: function isStarted() { return state.started; }, - log() { + log: function log() { console.log(state); return this; } @@ -113,13 +113,13 @@ const GeoLocator = function (opts) { function geoLocator(opts) { if ('geolocation' in navigator) { - let geolocator = index(GeoLocator(opts)); + var geolocator = index(GeoLocator(opts)); geolocator.on('position', function (position) { this.stop(); }); return geolocator; } else { - let error = 'geolocation is not available in your browser.'; + var error = 'geolocation is not available in your browser.'; throw error; } } diff --git a/packages/nlmaps-geolocator/.babelrc b/packages/nlmaps-geolocator/.babelrc new file mode 100644 index 00000000..dd006a48 --- /dev/null +++ b/packages/nlmaps-geolocator/.babelrc @@ -0,0 +1,8 @@ +{ + "presets": [ + ["es2015", {"modules": false}] + ], + "plugins": [ + "external-helpers" + ] +} diff --git a/packages/nlmaps-geolocator/build/nlmaps-geolocator.cjs.js b/packages/nlmaps-geolocator/build/nlmaps-geolocator.cjs.js index 5cc67fa2..3f858754 100644 --- a/packages/nlmaps-geolocator/build/nlmaps-geolocator.cjs.js +++ b/packages/nlmaps-geolocator/build/nlmaps-geolocator.cjs.js @@ -76,7 +76,7 @@ var EmitOnOff = module.exports = function(thing){ }; }); -const geoLocateDefaultOpts = { +var geoLocateDefaultOpts = { follow: false }; @@ -87,23 +87,23 @@ function positionErrorHandler(error) { this.emit('error', error); } -const GeoLocator = function (opts) { - const state = Object.assign({}, geoLocateDefaultOpts, opts); +var GeoLocator = function GeoLocator(opts) { + var state = Object.assign({}, geoLocateDefaultOpts, opts); return { - start() { + start: function start() { state.started = true; navigator.geolocation.getCurrentPosition(positionHandler.bind(this), positionErrorHandler.bind(this), { maximumAge: 60000 }); return this; }, - stop() { + stop: function stop() { state.started = false; return this; }, - isStarted() { + isStarted: function isStarted() { return state.started; }, - log() { + log: function log() { console.log(state); return this; } @@ -112,13 +112,13 @@ const GeoLocator = function (opts) { function geoLocator(opts) { if ('geolocation' in navigator) { - let geolocator = index(GeoLocator(opts)); + var geolocator = index(GeoLocator(opts)); geolocator.on('position', function (position) { this.stop(); }); return geolocator; } else { - let error = 'geolocation is not available in your browser.'; + var error = 'geolocation is not available in your browser.'; throw error; } } diff --git a/packages/nlmaps-geolocator/package.json b/packages/nlmaps-geolocator/package.json index 7a3bc0ed..875ecadf 100644 --- a/packages/nlmaps-geolocator/package.json +++ b/packages/nlmaps-geolocator/package.json @@ -1,6 +1,6 @@ { "name": "nlmaps-geolocator", - "version": "1.0.0", + "version": "1.0.1", "description": "", "main": "build/nlmaps-geolocator.cjs.js", "module": "build/nlmaps-geolocator.es.js",