react-amap-plugin-geolocation
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -107,3 +107,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
if (!props.__map__) { | ||
throw new Error('Heatmap has to be a child of Map component'); | ||
throw new Error('Geolocation has to be a child of Map component'); | ||
} else { | ||
@@ -110,0 +110,0 @@ _this.map = props.__map__; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.Geolocation=t(require("react")):e.Geolocation=t(e.React)}(this,function(e){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),c=o(1),a=function(e){return e&&e.__esModule?e:{default:e}}(c),f=function(e){function t(e){n(this,t);var o=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if("undefined"!=typeof window){if(!e.__map__)throw new Error("Heatmap has to be a child of Map component");o.map=e.__map__,o.element=e.__ele__,o.resolveGeolocation(e).then(function(){o.triggerCreated(e),o.map.addControl(o.geolocation),o.geolocation.getCurrentPosition()})}return o}return i(t,e),u(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"resolveGeolocation",value:function(e){var t=this;return this.geolocation?new Promise(function(e){e(t.geolocation)}):new Promise(function(o){t.map.plugin(["AMap.Geolocation"],function(){t.geolocation=new window.AMap.Geolocation(e),o(t.geolocation)})})}},{key:"triggerCreated",value:function(e){var t=e.events||{};"created"in t&&"function"==typeof t.created&&t.created(this.geolocation)}},{key:"render",value:function(){return null}}]),t}(a.default.Component);e.exports=f},function(t,o){t.exports=e}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.Geolocation=t(require("react")):e.Geolocation=t(e.React)}(this,function(e){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),c=o(1),a=function(e){return e&&e.__esModule?e:{default:e}}(c),f=function(e){function t(e){n(this,t);var o=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if("undefined"!=typeof window){if(!e.__map__)throw new Error("Geolocation has to be a child of Map component");o.map=e.__map__,o.element=e.__ele__,o.resolveGeolocation(e).then(function(){o.triggerCreated(e),o.map.addControl(o.geolocation),o.geolocation.getCurrentPosition()})}return o}return i(t,e),u(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"resolveGeolocation",value:function(e){var t=this;return this.geolocation?new Promise(function(e){e(t.geolocation)}):new Promise(function(o){t.map.plugin(["AMap.Geolocation"],function(){t.geolocation=new window.AMap.Geolocation(e),o(t.geolocation)})})}},{key:"triggerCreated",value:function(e){var t=e.events||{};"created"in t&&"function"==typeof t.created&&t.created(this.geolocation)}},{key:"render",value:function(){return null}}]),t}(a.default.Component);e.exports=f},function(t,o){t.exports=e}])}); |
{ | ||
"name": "react-amap-plugin-geolocation", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Geolocation plugin for react-amap", | ||
@@ -5,0 +5,0 @@ "main": "./lib/geolocation.min.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11222