未验证 提交 3b61add8 编写于 作者: S sushuang 提交者: GitHub

Merge pull request #12574 from apache/release-dev

Release 4.8.0
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -19,4 +19,4 @@
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("echarts")):"function"==typeof define&&define.amd?define(["exports","echarts"],e):e(t.bmap={},t.echarts)}(this,function(t,o){"use strict";function l(t,e){this._bmap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=new BMap.MercatorProjection}function n(a,r){return r=r||[0,0],o.util.map([0,1],function(t){var e=r[t],o=a[t]/2,n=[],i=[];return n[t]=e-o,i[t]=e+o,n[1-t]=i[1-t]=r[1-t],Math.abs(this.dataToPoint(n)[t]-this.dataToPoint(i)[t])},this)}var f;l.prototype.dimensions=["lng","lat"],l.prototype.setZoom=function(t){this._zoom=t},l.prototype.setCenter=function(t){this._center=this._projection.lngLatToPoint(new BMap.Point(t[0],t[1]))},l.prototype.setMapOffset=function(t){this._mapOffset=t},l.prototype.getBMap=function(){return this._bmap},l.prototype.dataToPoint=function(t){var e=new BMap.Point(t[0],t[1]),o=this._bmap.pointToOverlayPixel(e),n=this._mapOffset;return[o.x-n[0],o.y-n[1]]},l.prototype.pointToData=function(t){var e=this._mapOffset;return[(t=this._bmap.overlayPixelToPoint({x:t[0]+e[0],y:t[1]+e[1]})).lng,t.lat]},l.prototype.getViewRect=function(){var t=this._api;return new o.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},l.prototype.getRoamTransform=function(){return o.matrix.create()},l.prototype.prepareCustoms=function(t){var e=this.getViewRect();return{coordSys:{type:"bmap",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:o.util.bind(this.dataToPoint,this),size:o.util.bind(n,this)}}},l.dimensions=l.prototype.dimensions,l.create=function(t,m){var c,d=m.getDom();t.eachComponent("bmap",function(t){var e=m.getZr().painter,o=e.getViewportRoot();if("undefined"==typeof BMap)throw new Error("BMap api is not loaded");if(f=f||function(){function t(t){this._root=t}return(t.prototype=new BMap.Overlay).initialize=function(t){return t.getPanes().labelPane.appendChild(this._root),this._root},t.prototype.draw=function(){},t}(),c)throw new Error("Only one bmap component can exist");if(!t.__bmap){var n=d.querySelector(".ec-extension-bmap");n&&(o.style.left="0px",o.style.top="0px",d.removeChild(n)),(n=document.createElement("div")).style.cssText="width:100%;height:100%",n.classList.add("ec-extension-bmap"),d.appendChild(n);var i=t.__bmap=new BMap.Map(n),a=new f(o);i.addOverlay(a),e.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}i=t.__bmap;var r=t.get("center"),p=t.get("zoom");if(r&&p){var s=new BMap.Point(r[0],r[1]);i.centerAndZoom(s,p)}(c=new l(i,m)).setMapOffset(t.__mapOffset||[0,0]),c.setZoom(p),c.setCenter(r),t.coordinateSystem=c}),t.eachSeries(function(t){"bmap"===t.get("coordinateSystem")&&(t.coordinateSystem=c)})},o.extendComponentModel({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged:function(t,e){var o=this.option;return!(function(t,e){return t&&e&&t[0]===e[0]&&t[1]===e[1]}(t,o.center)&&e===o.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},mapStyleV2:{},roam:!1}}),o.extendComponentView({type:"bmap",render:function(i,t,a){function e(t,e){if(!r){var o=p.parentNode.parentNode.parentNode,n=[-parseInt(o.style.left,10)||0,-parseInt(o.style.top,10)||0];p.style.left=n[0]+"px",p.style.top=n[1]+"px",s.setMapOffset(n),i.__mapOffset=n,a.dispatchAction({type:"bmapRoam"})}}var r=!0,o=i.getBMap(),p=a.getZr().painter.getViewportRoot(),s=i.coordinateSystem;function n(){r||a.dispatchAction({type:"bmapRoam"})}o.removeEventListener("moving",this._oldMoveHandler),o.removeEventListener("zoomend",this._oldZoomEndHandler),o.addEventListener("moving",e),o.addEventListener("zoomend",n),this._oldMoveHandler=e,this._oldZoomEndHandler=n;var m=i.get("roam");m&&"scale"!==m?o.enableDragging():o.disableDragging(),m&&"move"!==m?(o.enableScrollWheelZoom(),o.enableDoubleClickZoom(),o.enablePinchToZoom()):(o.disableScrollWheelZoom(),o.disableDoubleClickZoom(),o.disablePinchToZoom());var c=i.__mapStyle,d=i.get("mapStyle")||{},l=JSON.stringify(d);JSON.stringify(c)!==l&&(Object.keys(d).length&&o.setMapStyle(d),i.__mapStyle=JSON.parse(l));var f=i.__mapStyle2,h=i.get("mapStyleV2")||{},u=JSON.stringify(h);JSON.stringify(f)!==u&&(Object.keys(h).length&&o.setMapStyleV2(h),i.__mapStyle2=JSON.parse(u)),r=!1}}),o.registerCoordinateSystem("bmap",l),o.registerAction({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(t,e){e.eachComponent("bmap",function(t){var e=t.getBMap(),o=e.getCenter();t.setCenterAndZoom([o.lng,o.lat],e.getZoom())})});t.version="1.0.0"});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("echarts")):"function"==typeof define&&define.amd?define(["exports","echarts"],e):e(t.bmap={},t.echarts)}(this,function(t,o){"use strict";function l(t,e){this._bmap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=new BMap.MercatorProjection}function n(i,a){return a=a||[0,0],o.util.map([0,1],function(t){var e=a[t],o=i[t]/2,n=[],r=[];return n[t]=e-o,r[t]=e+o,n[1-t]=r[1-t]=a[1-t],Math.abs(this.dataToPoint(n)[t]-this.dataToPoint(r)[t])},this)}var d;l.prototype.dimensions=["lng","lat"],l.prototype.setZoom=function(t){this._zoom=t},l.prototype.setCenter=function(t){this._center=this._projection.lngLatToPoint(new BMap.Point(t[0],t[1]))},l.prototype.setMapOffset=function(t){this._mapOffset=t},l.prototype.getBMap=function(){return this._bmap},l.prototype.dataToPoint=function(t){var e=new BMap.Point(t[0],t[1]),o=this._bmap.pointToOverlayPixel(e),n=this._mapOffset;return[o.x-n[0],o.y-n[1]]},l.prototype.pointToData=function(t){var e=this._mapOffset;return[(t=this._bmap.overlayPixelToPoint({x:t[0]+e[0],y:t[1]+e[1]})).lng,t.lat]},l.prototype.getViewRect=function(){var t=this._api;return new o.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},l.prototype.getRoamTransform=function(){return o.matrix.create()},l.prototype.prepareCustoms=function(t){var e=this.getViewRect();return{coordSys:{type:"bmap",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:o.util.bind(this.dataToPoint,this),size:o.util.bind(n,this)}}},l.dimensions=l.prototype.dimensions,l.create=function(t,c){var m,f=c.getDom();t.eachComponent("bmap",function(t){var e=c.getZr().painter,o=e.getViewportRoot();if("undefined"==typeof BMap)throw new Error("BMap api is not loaded");if(d=d||function(){function t(t){this._root=t}return(t.prototype=new BMap.Overlay).initialize=function(t){return t.getPanes().labelPane.appendChild(this._root),this._root},t.prototype.draw=function(){},t}(),m)throw new Error("Only one bmap component can exist");if(!t.__bmap){var n=f.querySelector(".ec-extension-bmap");n&&(o.style.left="0px",o.style.top="0px",f.removeChild(n)),(n=document.createElement("div")).style.cssText="width:100%;height:100%",n.classList.add("ec-extension-bmap"),f.appendChild(n);var r=t.__bmap=new BMap.Map(n),i=new d(o);r.addOverlay(i),e.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}r=t.__bmap;var a=t.get("center"),p=t.get("zoom");if(a&&p){var s=new BMap.Point(a[0],a[1]);r.centerAndZoom(s,p)}(m=new l(r,c)).setMapOffset(t.__mapOffset||[0,0]),m.setZoom(p),m.setCenter(a),t.coordinateSystem=m}),t.eachSeries(function(t){"bmap"===t.get("coordinateSystem")&&(t.coordinateSystem=m)})},o.extendComponentModel({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged:function(t,e){var o=this.option;return!(function(t,e){return t&&e&&t[0]===e[0]&&t[1]===e[1]}(t,o.center)&&e===o.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},mapStyleV2:{},roam:!1}});var p={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},s={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},c=Object.prototype.toString;function h(t){if(null==t||"object"!=typeof t)return t;var e=t,o=c.call(t);if("[object Array]"===o){if(!m(t)){e=[];for(var n=0,r=t.length;n<r;n++)e[n]=h(t[n])}}else if(s[o]){if(!m(t)){var i=t.constructor;if(t.constructor.from)e=i.from(t);else{e=new i(t.length);for(n=0,r=t.length;n<r;n++)e[n]=h(t[n])}}}else if(!p[o]&&!m(t)&&!function(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}(t))for(var a in e={},t)t.hasOwnProperty(a)&&(e[a]=h(t[a]));return e}var e="__ec_primitive__";function m(t){return t[e]}o.extendComponentView({type:"bmap",render:function(r,t,i){function e(t,e){if(!a){var o=p.parentNode.parentNode.parentNode,n=[-parseInt(o.style.left,10)||0,-parseInt(o.style.top,10)||0];p.style.left=n[0]+"px",p.style.top=n[1]+"px",s.setMapOffset(n),r.__mapOffset=n,i.dispatchAction({type:"bmapRoam"})}}var a=!0,o=r.getBMap(),p=i.getZr().painter.getViewportRoot(),s=r.coordinateSystem;function n(){a||i.dispatchAction({type:"bmapRoam"})}o.removeEventListener("moving",this._oldMoveHandler),o.removeEventListener("zoomend",this._oldZoomEndHandler),o.addEventListener("moving",e),o.addEventListener("zoomend",n),this._oldMoveHandler=e,this._oldZoomEndHandler=n;var c=r.get("roam");c&&"scale"!==c?o.enableDragging():o.disableDragging(),c&&"move"!==c?(o.enableScrollWheelZoom(),o.enableDoubleClickZoom(),o.enablePinchToZoom()):(o.disableScrollWheelZoom(),o.disableDoubleClickZoom(),o.disablePinchToZoom());var m=r.__mapStyle,f=r.get("mapStyle")||{},l=JSON.stringify(f);JSON.stringify(m)!==l&&(Object.keys(f).length&&o.setMapStyle(h(f)),r.__mapStyle=JSON.parse(l));var d=r.__mapStyle2,y=r.get("mapStyleV2")||{},u=JSON.stringify(y);JSON.stringify(d)!==u&&(Object.keys(y).length&&o.setMapStyleV2(h(y)),r.__mapStyle2=JSON.parse(u)),a=!1}}),o.registerCoordinateSystem("bmap",l),o.registerAction({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(t,e){e.eachComponent("bmap",function(t){var e=t.getBMap(),o=e.getCenter();t.setCenterAndZoom([o.lng,o.lat],e.getZoom())})});t.version="1.0.0"});
......@@ -20,6 +20,10 @@
var echarts = require("echarts");
var _util = require("zrender/lib/core/util");
var clone = _util.clone;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
......@@ -110,7 +114,7 @@ var _default = echarts.extendComponentView({
if (JSON.stringify(originalStyle) !== mapStyleStr) {
// FIXME May have blank tile when dragging if setMapStyle
if (Object.keys(newMapStyle).length) {
bmap.setMapStyle(newMapStyle);
bmap.setMapStyle(clone(newMapStyle));
}
bMapModel.__mapStyle = JSON.parse(mapStyleStr);
......@@ -126,7 +130,7 @@ var _default = echarts.extendComponentView({
if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
// FIXME May have blank tile when dragging if setMapStyle
if (Object.keys(newMapStyle2).length) {
bmap.setMapStyleV2(newMapStyle2);
bmap.setMapStyleV2(clone(newMapStyle2));
}
bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);
......
{
"name": "echarts",
"version": "4.7.0",
"version": "4.8.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -7265,9 +7265,9 @@
"dev": true
},
"zrender": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-4.3.0.tgz",
"integrity": "sha512-Dii6j2bDsPkxQayuVf2DXJeruIB/mKVxxcGRZQ9GExiBd4c3w7+oBuvo1O/JGHeFeA1nCmSDVDs/S7yKZG1nrA=="
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-4.3.1.tgz",
"integrity": "sha512-CeH2TpJeCdG0TAGYoPSAcFX2ogdug1K7LIn9UO/q9HWqQ54gWhrMAlDP9AwWYMUDhrPe4VeazQ4DW3msD96nUQ=="
}
}
}
{
"name": "echarts",
"version": "4.7.0",
"version": "4.8.0",
"description": "A powerful charting and visualization library for browser",
"license": "Apache-2.0",
"keywords": [
......@@ -27,7 +27,7 @@
"lint:dist": "echo 'It might take a while. Please wait ...' && ./node_modules/.bin/jshint --config .jshintrc-dist dist/echarts.js"
},
"dependencies": {
"zrender": "4.3.0"
"zrender": "4.3.1"
},
"devDependencies": {
"@babel/core": "7.3.4",
......
......@@ -51,10 +51,10 @@ var isFunction = zrUtil.isFunction;
var isObject = zrUtil.isObject;
var parseClassType = ComponentModel.parseClassType;
export var version = '4.7.0';
export var version = '4.8.0';
export var dependencies = {
zrender: '4.3.0'
zrender: '4.3.1'
};
var TEST_FRAME_REMAIN_TIME = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册