Socket
Socket
Sign inDemoInstall

echarts-extension-gmap

Package Overview
Dependencies
3
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

2

dist/echarts-extension-gmap.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],t):"object"==typeof exports?exports.gmap=t(require("echarts")):e.gmap=t(e.echarts)}(window,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e){e.exports=JSON.parse('{"a":"echarts-extension-gmap","b":"1.0.2"}')},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")(),p=Object.prototype.toString,f=Math.max,l=Math.min,g=function(){return u.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(d(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=d(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=r.test(e);return s||i.test(e)?a(e.slice(2),s?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var o,r,i,a,s,c,u=0,p=!1,h=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=o,i=r;return o=r=void 0,u=t,a=e.apply(i,n)}function _(e){return u=e,s=setTimeout(b,t),p?v(e):a}function x(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-u>=i}function b(){var e=g();if(x(e))return w(e);s=setTimeout(b,function(e){var n=t-(e-c);return h?l(n,i-(e-u)):n}(e))}function w(e){return s=void 0,y&&o?v(e):(o=r=void 0,a)}function O(){var e=g(),n=x(e);if(o=arguments,r=this,c=e,n){if(void 0===s)return _(c);if(h)return s=setTimeout(b,t),v(c)}return void 0===s&&(s=setTimeout(b,t)),a}return t=m(t)||0,d(n)&&(p=!!n.leading,i=(h="maxWait"in n)?f(m(n.maxWait)||0,t):i,y="trailing"in n?!!n.trailing:y),O.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=c=r=s=void 0},O.flush=function(){return void 0===s?a:w(g())},O}}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"version",(function(){return o.b})),n.d(t,"name",(function(){return o.a}));var o=n(1),r=n(0);function i(e,t){this._gmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}var a,s=i.prototype,c=["echartsLayerZIndex","renderOnMoving"];function u(e,t){return t=t||[0,0],r.util.map([0,1],(function(n){var o=t[n],r=e[n]/2,i=[],a=[];return i[n]=o-r,a[n]=o+r,i[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(i)[n]-this.dataToPoint(a)[n])}),this)}function p(){function e(e,t){this._root=e,this.setMap(t)}return e.prototype=new google.maps.OverlayView,e.prototype.onAdd=function(){this.getMap().__overlayProjection=this.getProjection(),gmap.getDiv().querySelector(".gm-style > div").appendChild(this._root)},e.prototype.draw=function(){google.maps.event.trigger(this.getMap(),"gmaprender")},e.prototype.onRemove=function(){this._root.parentNode.removeChild(this._root),this._root=null},e.prototype.setZIndex=function(e){this._root.style.zIndex=e},e.prototype.getZIndex=function(){return this._root.style.zIndex},e}function f(e,t){var n=t.__overlayProjection;if(n)return n.fromLatLngToContainerPixel(e)}s.dimensions=["lng","lat"],s.setZoom=function(e){this._zoom=e},s.setCenter=function(e){var t=new google.maps.LatLng(e[1],e[0]);this._center=f(t,this._gmap)},s.setMapOffset=function(e){this._mapOffset=e},s.setGoogleMap=function(e){this._gmap=e},s.getGoogleMap=function(){return this._gmap},s.dataToPoint=function(e){var t=f(new google.maps.LatLng(e[1],e[0]),this._gmap);if(t){var n=this._mapOffset;return[t.x-n[0],t.y-n[1]]}},s.pointToData=function(e){var t=this._mapOffset,n=function(e,t){var n=t.__overlayProjection;if(!n)return;return n.fromContainerPixelToLatLng(e)}(new google.maps.Point(e[0]+t[0],e[1]+t[1]),this._gmap);return[n.lng(),n.lat()]},s.getViewRect=function(){var e=this._api;return new r.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},s.getRoamTransform=function(){return r.matrix.create()},s.prepareCustoms=function(e){var t=this.getViewRect();return{coordSys:{type:"gmap",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:r.util.bind(this.dataToPoint,this),size:r.util.bind(u,this)}}},i.dimensions=s.dimensions,i.create=function(e,t){var n,o=t.getDom();e.eachComponent("gmap",(function(e){var s=t.getZr().painter,u=s.getViewportRoot();if("undefined"==typeof google||void 0===google.maps||void 0===google.maps.Map)throw new Error("It seems that Google Map API has not been loaded completely yet.");if(a=a||p(),n)throw new Error("Only one google map component can exist");var f=e.getGoogleMap();if(!f){var l=o.querySelector(".ec-extension-google-map");l&&(u.style.left="0px",u.style.top="0px",u.style.width="100%",u.style.height="100%",o.removeChild(l)),(l=document.createElement("div")).style.cssText="width:100%;height:100%",l.classList.add("ec-extension-google-map"),o.appendChild(l);var g=r.util.clone(e.get()),d=g.echartsLayerZIndex;r.util.each(c,(function(e){delete g[e]}));var m=g.center;r.util.isArray(m)&&(g.center={lng:m[0],lat:m[1]}),f=new google.maps.Map(l,g),e.setGoogleMap(f),e.__projectionChangeListener&&e.__projectionChangeListener.remove(),e.__projectionChangeListener=google.maps.event.addListener(f,"projection_changed",(function(){var t=e.getEChartsLayer();t&&t.setMap(null);var n=new a(u,f);n.setZIndex(d),e.setEChartsLayer(n)})),s.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}var h=[null!=(m=e.get("center")).lng?m.lng:m[0],null!=m.lat?m.lat:m[1]],y=e.get("zoom");if(m&&y){var v=f.getCenter(),_=f.getZoom();if(e.centerOrZoomChanged([v.lng(),v.lat()],_)){var x=new google.maps.LatLng(h[1],h[0]);f.setOptions({center:x,zoom:y})}}(n=new i(f,t)).setMapOffset(e.__mapOffset||[0,0]),n.setZoom(y),n.setCenter(h),e.coordinateSystem=n})),e.eachSeries((function(e){"gmap"===e.get("coordinateSystem")&&(e.coordinateSystem=n)}))};var l=i;r.extendComponentModel({type:"gmap",setGoogleMap:function(e){this.__gmap=e},getGoogleMap:function(){return this.__gmap},setEChartsLayer:function(e){this.__echartsLayer=e},getEChartsLayer:function(){return this.__echartsLayer},setCenterAndZoom:function(e,t){this.option.center=e,this.option.zoom=t},centerOrZoomChanged:function(e,t){var n,o,r=this.option;return n=e,o=r.center,!(n&&o&&n[0]===o[0]&&n[1]===o[1]&&t===r.zoom)},defaultOption:{center:{lat:39.90923,lng:116.397428},zoom:5,echartsLayerZIndex:2e3,renderOnMoving:!0}});var g=n(2),d=n.n(g);r.extendComponentView({type:"gmap",render:function(e,t,n){var o=!0,i=e.getGoogleMap(),a=n.getZr().painter.getViewportRoot(),s=e.coordinateSystem,c=i.getDiv(),u=e.get("renderOnMoving"),p=c.clientWidth,f=c.clientHeight,l=function(){if(!o){var t=c.clientWidth,r=c.clientHeight;if(t!==p||r!==f)return g.call(this);var i=[-parseInt(c.style.left,10)||0,-parseInt(c.style.top,10)||0];a.style.left=i[0]+"px",a.style.top=i[1]+"px",s.setMapOffset(i),e.__mapOffset=i,n.dispatchAction({type:"gmapRoam"})}},g=function(){r.getInstanceByDom(n.getDom()).resize()};this._oldRenderHandler&&this._oldRenderHandler.remove(),u||(l=d()(l,100),resizeChart=d()(resizeChart,100)),this._oldRenderHandler=google.maps.event.addListener(i,"gmaprender",l),o=!1},dispose:function(e,t){var n=e.getComponent("gmap"),o=n.getGoogleMap();google.maps.event.clearInstanceListeners(o);var r=o.getDiv();r.parentNode.remove(r),n.setGoogleMap(null),n.setEChartsLayer(null),n.coordinateSystem.setGoogleMap(null)}});r.registerCoordinateSystem("amap",l),r.registerAction({type:"gmapRoam",event:"gmapRoam",update:"updateLayout"},(function(e,t){t.eachComponent("gmap",(function(e){var t=e.getGoogleMap(),n=t.getCenter();e.setCenterAndZoom([n.lng(),n.lat()],t.getZoom())}))}))}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],t):"object"==typeof exports?exports.gmap=t(require("echarts")):e.gmap=t(e.echarts)}(window,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e){e.exports=JSON.parse('{"a":"echarts-extension-gmap","b":"1.0.3"}')},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")(),p=Object.prototype.toString,l=Math.max,f=Math.min,g=function(){return u.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(d(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=d(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=r.test(e);return s||i.test(e)?a(e.slice(2),s?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var o,r,i,a,s,c,u=0,p=!1,h=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=o,i=r;return o=r=void 0,u=t,a=e.apply(i,n)}function _(e){return u=e,s=setTimeout(b,t),p?v(e):a}function x(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-u>=i}function b(){var e=g();if(x(e))return w(e);s=setTimeout(b,function(e){var n=t-(e-c);return h?f(n,i-(e-u)):n}(e))}function w(e){return s=void 0,y&&o?v(e):(o=r=void 0,a)}function O(){var e=g(),n=x(e);if(o=arguments,r=this,c=e,n){if(void 0===s)return _(c);if(h)return s=setTimeout(b,t),v(c)}return void 0===s&&(s=setTimeout(b,t)),a}return t=m(t)||0,d(n)&&(p=!!n.leading,i=(h="maxWait"in n)?l(m(n.maxWait)||0,t):i,y="trailing"in n?!!n.trailing:y),O.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=c=r=s=void 0},O.flush=function(){return void 0===s?a:w(g())},O}}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"version",(function(){return o.b})),n.d(t,"name",(function(){return o.a}));var o=n(1),r=n(0);function i(e,t){this._gmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}var a,s=i.prototype,c=["echartsLayerZIndex","renderOnMoving"];function u(e,t){return t=t||[0,0],r.util.map([0,1],(function(n){var o=t[n],r=e[n]/2,i=[],a=[];return i[n]=o-r,a[n]=o+r,i[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(i)[n]-this.dataToPoint(a)[n])}),this)}function p(e,t){var n=t.__overlayProjection;if(n)return n.fromLatLngToContainerPixel(e)}s.dimensions=["lng","lat"],s.setZoom=function(e){this._zoom=e},s.setCenter=function(e){var t=new google.maps.LatLng(e[1],e[0]);this._center=p(t,this._gmap)},s.setMapOffset=function(e){this._mapOffset=e},s.setGoogleMap=function(e){this._gmap=e},s.getGoogleMap=function(){return this._gmap},s.dataToPoint=function(e){var t=p(new google.maps.LatLng(e[1],e[0]),this._gmap);if(t){var n=this._mapOffset;return[t.x-n[0],t.y-n[1]]}},s.pointToData=function(e){var t=this._mapOffset,n=function(e,t){var n=t.__overlayProjection;if(!n)return;return n.fromContainerPixelToLatLng(e)}(new google.maps.Point(e[0]+t[0],e[1]+t[1]),this._gmap);return[n.lng(),n.lat()]},s.getViewRect=function(){var e=this._api;return new r.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},s.getRoamTransform=function(){return r.matrix.create()},s.prepareCustoms=function(e){var t=this.getViewRect();return{coordSys:{type:"gmap",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:r.util.bind(this.dataToPoint,this),size:r.util.bind(u,this)}}},i.dimensions=s.dimensions,i.create=function(e,t){var n,o=t.getDom();e.eachComponent("gmap",(function(e){var s=t.getZr().painter,u=s.getViewportRoot();if("undefined"==typeof google||void 0===google.maps||void 0===google.maps.Map)throw new Error("It seems that Google Map API has not been loaded completely yet.");if(a=a||function(){function e(e,t){this._root=e,this.setMap(t)}return e.prototype=new google.maps.OverlayView,e.prototype.onAdd=function(){var e=this.getMap();e.__overlayProjection=this.getProjection(),e.getDiv().querySelector(".gm-style > div").appendChild(this._root)},e.prototype.draw=function(){google.maps.event.trigger(this.getMap(),"gmaprender")},e.prototype.onRemove=function(){this._root.parentNode.removeChild(this._root),this._root=null},e.prototype.setZIndex=function(e){this._root.style.zIndex=e},e.prototype.getZIndex=function(){return this._root.style.zIndex},e}(),n)throw new Error("Only one google map component can exist");var p=e.getGoogleMap();if(!p){var l=o.querySelector(".ec-extension-google-map");l&&(u.style.left="0px",u.style.top="0px",u.style.width="100%",u.style.height="100%",o.removeChild(l)),(l=document.createElement("div")).style.cssText="width:100%;height:100%",l.classList.add("ec-extension-google-map"),o.appendChild(l);var f=r.util.clone(e.get()),g=f.echartsLayerZIndex;r.util.each(c,(function(e){delete f[e]}));var d=f.center;r.util.isArray(d)&&(f.center={lng:d[0],lat:d[1]}),p=new google.maps.Map(l,f),e.setGoogleMap(p),e.__projectionChangeListener&&e.__projectionChangeListener.remove(),e.__projectionChangeListener=google.maps.event.addListener(p,"projection_changed",(function(){var t=e.getEChartsLayer();t&&t.setMap(null);var n=new a(u,p);n.setZIndex(g),e.setEChartsLayer(n)})),s.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}var m=[null!=(d=e.get("center")).lng?d.lng:d[0],null!=d.lat?d.lat:d[1]],h=e.get("zoom");if(d&&h){var y=p.getCenter(),v=p.getZoom();if(e.centerOrZoomChanged([y.lng(),y.lat()],v)){var _=new google.maps.LatLng(m[1],m[0]);p.setOptions({center:_,zoom:h})}}(n=new i(p,t)).setMapOffset(e.__mapOffset||[0,0]),n.setZoom(h),n.setCenter(m),e.coordinateSystem=n})),e.eachSeries((function(e){"gmap"===e.get("coordinateSystem")&&(e.coordinateSystem=n)}))};var l=i;r.extendComponentModel({type:"gmap",setGoogleMap:function(e){this.__gmap=e},getGoogleMap:function(){return this.__gmap},setEChartsLayer:function(e){this.__echartsLayer=e},getEChartsLayer:function(){return this.__echartsLayer},setCenterAndZoom:function(e,t){this.option.center=e,this.option.zoom=t},centerOrZoomChanged:function(e,t){var n,o,r=this.option;return n=e,o=r.center,!(n&&o&&n[0]===o[0]&&n[1]===o[1]&&t===r.zoom)},defaultOption:{center:{lat:39.90923,lng:116.397428},zoom:5,echartsLayerZIndex:2e3,renderOnMoving:!0}});var f=n(2),g=n.n(f);r.extendComponentView({type:"gmap",render:function(e,t,n){var o=!0,i=e.getGoogleMap(),a=n.getZr().painter.getViewportRoot(),s=e.coordinateSystem,c=i.getDiv(),u=e.get("renderOnMoving"),p=c.clientWidth,l=c.clientHeight,f=function(){if(!o){var t=c.clientWidth,r=c.clientHeight;if(t!==p||r!==l)return d.call(this);var i=[-parseInt(c.style.left,10)||0,-parseInt(c.style.top,10)||0];a.style.left=i[0]+"px",a.style.top=i[1]+"px",s.setMapOffset(i),e.__mapOffset=i,n.dispatchAction({type:"gmapRoam"})}},d=function(){r.getInstanceByDom(n.getDom()).resize()};this._oldRenderHandler&&this._oldRenderHandler.remove(),u||(f=g()(f,100),resizeChart=g()(resizeChart,100)),this._oldRenderHandler=google.maps.event.addListener(i,"gmaprender",f),o=!1},dispose:function(e,t){this._oldRenderHandler&&this._oldRenderHandler.remove(),this._oldRenderHandler=null;var n=e.getComponent("gmap"),o=n.getGoogleMap();delete o.__overlayProjection,google.maps.event.clearInstanceListeners(o);var r=o.getDiv();r.parentNode.removeChild(r),n.setGoogleMap(null),n.setEChartsLayer(null),n.coordinateSystem.setGoogleMap(null),n.coordinateSystem=null}});r.registerCoordinateSystem("amap",l),r.registerAction({type:"gmapRoam",event:"gmapRoam",update:"updateLayout"},(function(e,t){t.eachComponent("gmap",(function(e){var t=e.getGoogleMap(),n=t.getCenter();e.setCenterAndZoom([n.lng(),n.lat()],t.getZoom())}))}))}])}));
//# sourceMappingURL=echarts-extension-gmap.min.js.map
{
"name": "echarts-extension-gmap",
"version": "1.0.2",
"version": "1.0.3",
"description": "An Google Map(https://www.google.com/maps) extension for ECharts(https://github.com/apache/incubator-echarts)",

@@ -13,3 +13,3 @@ "main": "dist/echarts-extension-gmap.min.js",

"type": "git",
"url": "git+https://github.com/plainheart/echarts-extension-google-map.git"
"url": "git+https://github.com/plainheart/echarts-extension-gmap.git"
},

@@ -31,5 +31,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/plainheart/echarts-extension-google-map/issues"
"url": "https://github.com/plainheart/echarts-extension-gmap/issues"
},
"homepage": "https://github.com/plainheart/echarts-extension-google-map#readme",
"homepage": "https://github.com/plainheart/echarts-extension-gmap#readme",
"devDependencies": {

@@ -36,0 +36,0 @@ "webpack": "^4.29.5",

@@ -86,3 +86,5 @@ [![NPM version](https://img.shields.io/npm/v/echarts-extension-gmap.svg?style=flat)](https://www.npmjs.org/package/echarts-extension-gmap)

// encode the third element of data item as the `value` dimension
value: 2
value: 2,
lng: 0,
lat: 1
}

@@ -89,0 +91,0 @@ }

@@ -81,3 +81,5 @@ [![NPM version](https://img.shields.io/npm/v/echarts-extension-gmap.svg?style=flat)](https://www.npmjs.org/package/echarts-extension-gmap)

encode: {
value: 2
value: 2,
lng: 0,
lat: 1
}

@@ -84,0 +86,0 @@ }

@@ -1,2 +0,2 @@

/* global AMap */
/* global google */

@@ -136,4 +136,4 @@ import { util as zrUtil, graphic, matrix } from "echarts";

viewportRoot.style.top = "0px";
viewportRoot.style.width = '100%'
viewportRoot.style.height = '100%'
viewportRoot.style.width = "100%";
viewportRoot.style.height = "100%";
root.removeChild(gmapRoot);

@@ -226,4 +226,5 @@ }

Overlay.prototype.onAdd = function() {
this.getMap().__overlayProjection = this.getProjection();
gmap.getDiv().querySelector('.gm-style > div').appendChild(this._root);
var gmap = this.getMap();
gmap.__overlayProjection = this.getProjection();
gmap.getDiv().querySelector(".gm-style > div").appendChild(this._root);
};

@@ -235,3 +236,3 @@

Overlay.prototype.draw = function() {
google.maps.event.trigger(this.getMap(), 'gmaprender');
google.maps.event.trigger(this.getMap(), "gmaprender");
};

@@ -238,0 +239,0 @@

@@ -0,3 +1,5 @@

/* global google */
import * as echarts from "echarts";
import debounce from 'lodash.debounce';
import debounce from "lodash.debounce";

@@ -14,3 +16,3 @@ export default echarts.extendComponentView({

var offsetEl = gmap.getDiv();
var renderOnMoving = gmapModel.get('renderOnMoving');
var renderOnMoving = gmapModel.get("renderOnMoving");
var oldWidth = offsetEl.clientWidth;

@@ -63,11 +65,23 @@ var oldHeight = offsetEl.clientHeight;

dispose: function(ecModel, api) {
this._oldRenderHandler && this._oldRenderHandler.remove();
this._oldRenderHandler = null;
var component = ecModel.getComponent("gmap");
var gmapInstance = component.getGoogleMap();
// remove injected projection
delete gmapInstance.__overlayProjection;
// clear all listeners of map instance
google.maps.event.clearInstanceListeners(gmapInstance);
// remove DOM of map instance
var mapDiv = gmapInstance.getDiv();
mapDiv.parentNode.remove(mapDiv);
mapDiv.parentNode.removeChild(mapDiv);
component.setGoogleMap(null);
component.setEChartsLayer(null);
component.coordinateSystem.setGoogleMap(null);
component.coordinateSystem = null;
}
});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc