blob: 07404b158cf7d19df47bcacb6cb4f6048befba21 [file] [log] [blame]
{"version":3,"file":"bmap.js","sources":["../../extension-src/bmap/BMapCoordSys.js","../../extension-src/bmap/BMapModel.js","../../extension-src/bmap/BMapView.js","../../extension-src/bmap/bmap.js"],"sourcesContent":["/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global BMap */\n\nimport {\n util as zrUtil,\n graphic,\n matrix\n} from 'echarts';\n\nfunction BMapCoordSys(bmap, api) {\n this._bmap = bmap;\n this.dimensions = ['lng', 'lat'];\n this._mapOffset = [0, 0];\n\n this._api = api;\n\n this._projection = new BMap.MercatorProjection();\n}\n\nBMapCoordSys.prototype.dimensions = ['lng', 'lat'];\n\nBMapCoordSys.prototype.setZoom = function (zoom) {\n this._zoom = zoom;\n};\n\nBMapCoordSys.prototype.setCenter = function (center) {\n this._center = this._projection.lngLatToPoint(new BMap.Point(center[0], center[1]));\n};\n\nBMapCoordSys.prototype.setMapOffset = function (mapOffset) {\n this._mapOffset = mapOffset;\n};\n\nBMapCoordSys.prototype.getBMap = function () {\n return this._bmap;\n};\n\nBMapCoordSys.prototype.dataToPoint = function (data) {\n var point = new BMap.Point(data[0], data[1]);\n // TODO mercator projection is toooooooo slow\n // var mercatorPoint = this._projection.lngLatToPoint(point);\n\n // var width = this._api.getZr().getWidth();\n // var height = this._api.getZr().getHeight();\n // var divider = Math.pow(2, 18 - 10);\n // return [\n // Math.round((mercatorPoint.x - this._center.x) / divider + width / 2),\n // Math.round((this._center.y - mercatorPoint.y) / divider + height / 2)\n // ];\n var px = this._bmap.pointToOverlayPixel(point);\n var mapOffset = this._mapOffset;\n return [px.x - mapOffset[0], px.y - mapOffset[1]];\n};\n\nBMapCoordSys.prototype.pointToData = function (pt) {\n var mapOffset = this._mapOffset;\n var pt = this._bmap.overlayPixelToPoint({\n x: pt[0] + mapOffset[0],\n y: pt[1] + mapOffset[1]\n });\n return [pt.lng, pt.lat];\n};\n\nBMapCoordSys.prototype.getViewRect = function () {\n var api = this._api;\n return new graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight());\n};\n\nBMapCoordSys.prototype.getRoamTransform = function () {\n return matrix.create();\n};\n\nBMapCoordSys.prototype.prepareCustoms = function (data) {\n var rect = this.getViewRect();\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'bmap',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: zrUtil.bind(this.dataToPoint, this),\n size: zrUtil.bind(dataToCoordSize, this)\n }\n };\n};\n\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map([0, 1], function (dimIdx) {\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var p1 = [];\n var p2 = [];\n p1[dimIdx] = val - halfSize;\n p2[dimIdx] = val + halfSize;\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\n }, this);\n}\n\nvar Overlay;\n\n// For deciding which dimensions to use when creating list data\nBMapCoordSys.dimensions = BMapCoordSys.prototype.dimensions;\n\nfunction createOverlayCtor() {\n function Overlay(root) {\n this._root = root;\n }\n\n Overlay.prototype = new BMap.Overlay();\n /**\n * 初始化\n *\n * @param {BMap.Map} map\n * @override\n */\n Overlay.prototype.initialize = function (map) {\n map.getPanes().labelPane.appendChild(this._root);\n return this._root;\n };\n /**\n * @override\n */\n Overlay.prototype.draw = function () {};\n\n return Overlay;\n}\n\nBMapCoordSys.create = function (ecModel, api) {\n var bmapCoordSys;\n var root = api.getDom();\n\n // TODO Dispose\n ecModel.eachComponent('bmap', function (bmapModel) {\n var painter = api.getZr().painter;\n var viewportRoot = painter.getViewportRoot();\n if (typeof BMap === 'undefined') {\n throw new Error('BMap api is not loaded');\n }\n Overlay = Overlay || createOverlayCtor();\n if (bmapCoordSys) {\n throw new Error('Only one bmap component can exist');\n }\n if (!bmapModel.__bmap) {\n // Not support IE8\n var bmapRoot = root.querySelector('.ec-extension-bmap');\n if (bmapRoot) {\n // Reset viewport left and top, which will be changed\n // in moving handler in BMapView\n viewportRoot.style.left = '0px';\n viewportRoot.style.top = '0px';\n root.removeChild(bmapRoot);\n }\n bmapRoot = document.createElement('div');\n bmapRoot.style.cssText = 'width:100%;height:100%';\n // Not support IE8\n bmapRoot.classList.add('ec-extension-bmap');\n root.appendChild(bmapRoot);\n\n // initialize bmap\n var mapOptions = bmapModel.get('mapOptions') || {};\n // Not support `mapType`, use `bmap.setMapType(MapType)` instead.\n delete mapOptions.mapType;\n var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot, mapOptions);\n\n var overlay = new Overlay(viewportRoot);\n bmap.addOverlay(overlay);\n\n // Override\n painter.getViewportRootOffset = function () {\n return {offsetLeft: 0, offsetTop: 0};\n };\n }\n var bmap = bmapModel.__bmap;\n\n // Set bmap options\n // centerAndZoom before layout and render\n var center = bmapModel.get('center');\n var zoom = bmapModel.get('zoom');\n if (center && zoom) {\n var bmapCenter = bmap.getCenter();\n var bmapZoom = bmap.getZoom();\n var centerOrZoomChanged = bmapModel.centerOrZoomChanged([bmapCenter.lng, bmapCenter.lat], bmapZoom);\n if (centerOrZoomChanged) {\n var pt = new BMap.Point(center[0], center[1]);\n bmap.centerAndZoom(pt, zoom);\n }\n }\n\n bmapCoordSys = new BMapCoordSys(bmap, api);\n bmapCoordSys.setMapOffset(bmapModel.__mapOffset || [0, 0]);\n bmapCoordSys.setZoom(zoom);\n bmapCoordSys.setCenter(center);\n\n bmapModel.coordinateSystem = bmapCoordSys;\n });\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'bmap') {\n seriesModel.coordinateSystem = bmapCoordSys;\n }\n });\n};\n\nexport default BMapCoordSys;\n","/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nimport * as echarts from 'echarts';\n\nfunction v2Equal(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}\n\nexport default echarts.extendComponentModel({\n type: 'bmap',\n\n getBMap: function () {\n // __bmap is injected when creating BMapCoordSys\n return this.__bmap;\n },\n\n setCenterAndZoom: function (center, zoom) {\n this.option.center = center;\n this.option.zoom = zoom;\n },\n\n centerOrZoomChanged: function (center, zoom) {\n var option = this.option;\n return !(v2Equal(center, option.center) && zoom === option.zoom);\n },\n\n defaultOption: {\n\n center: [104.114129, 37.550339],\n\n zoom: 5,\n\n // 2.0 http://lbsyun.baidu.com/custom/index.htm\n mapStyle: {},\n\n // 3.0 http://lbsyun.baidu.com/index.php?title=open/custom\n mapStyleV2: {},\n\n // See https://lbsyun.baidu.com/cms/jsapi/reference/jsapi_reference.html#a0b1\n mapOptions: {},\n\n roam: false\n }\n});\n","/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nimport * as echarts from 'echarts';\n\nfunction isEmptyObject(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n}\n\nexport default echarts.extendComponentView({\n type: 'bmap',\n\n render: function (bMapModel, ecModel, api) {\n var rendering = true;\n\n var bmap = bMapModel.getBMap();\n var viewportRoot = api.getZr().painter.getViewportRoot();\n var coordSys = bMapModel.coordinateSystem;\n var moveHandler = function (type, target) {\n if (rendering) {\n return;\n }\n var offsetEl = viewportRoot.parentNode.parentNode.parentNode;\n var mapOffset = [\n -parseInt(offsetEl.style.left, 10) || 0,\n -parseInt(offsetEl.style.top, 10) || 0\n ];\n viewportRoot.style.left = mapOffset[0] + 'px';\n viewportRoot.style.top = mapOffset[1] + 'px';\n\n coordSys.setMapOffset(mapOffset);\n bMapModel.__mapOffset = mapOffset;\n\n api.dispatchAction({\n type: 'bmapRoam'\n });\n };\n\n function zoomEndHandler() {\n if (rendering) {\n return;\n }\n api.dispatchAction({\n type: 'bmapRoam'\n });\n }\n\n bmap.removeEventListener('moving', this._oldMoveHandler);\n bmap.removeEventListener('moveend', this._oldMoveHandler);\n bmap.removeEventListener('zoomend', this._oldZoomEndHandler);\n bmap.addEventListener('moving', moveHandler);\n bmap.addEventListener('moveend', moveHandler);\n bmap.addEventListener('zoomend', zoomEndHandler);\n\n this._oldMoveHandler = moveHandler;\n this._oldZoomEndHandler = zoomEndHandler;\n\n var roam = bMapModel.get('roam');\n if (roam && roam !== 'scale') {\n bmap.enableDragging();\n }\n else {\n bmap.disableDragging();\n }\n if (roam && roam !== 'move') {\n bmap.enableScrollWheelZoom();\n bmap.enableDoubleClickZoom();\n bmap.enablePinchToZoom();\n }\n else {\n bmap.disableScrollWheelZoom();\n bmap.disableDoubleClickZoom();\n bmap.disablePinchToZoom();\n }\n\n /* map 2.0 */\n var originalStyle = bMapModel.__mapStyle;\n\n var newMapStyle = bMapModel.get('mapStyle') || {};\n // FIXME, Not use JSON methods\n var mapStyleStr = JSON.stringify(newMapStyle);\n if (JSON.stringify(originalStyle) !== mapStyleStr) {\n // FIXME May have blank tile when dragging if setMapStyle\n if (!isEmptyObject(newMapStyle2)) {\n bmap.setMapStyle(echarts.util.clone(newMapStyle));\n }\n bMapModel.__mapStyle = JSON.parse(mapStyleStr);\n }\n\n /* map 3.0 */\n var originalStyle2 = bMapModel.__mapStyle2;\n\n var newMapStyle2 = bMapModel.get('mapStyleV2') || {};\n // FIXME, Not use JSON methods\n var mapStyleStr2 = JSON.stringify(newMapStyle2);\n if (JSON.stringify(originalStyle2) !== mapStyleStr2) {\n // FIXME May have blank tile when dragging if setMapStyle\n if (!isEmptyObject(newMapStyle2)) {\n bmap.setMapStyleV2(echarts.util.clone(newMapStyle2));\n }\n bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);\n }\n\n rendering = false;\n }\n});\n","/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * BMap component extension\n */\n\nimport * as echarts from 'echarts';\nimport BMapCoordSys from './BMapCoordSys';\n\nimport './BMapModel';\nimport './BMapView';\n\necharts.registerCoordinateSystem('bmap', BMapCoordSys);\n\n// Action\necharts.registerAction({\n type: 'bmapRoam',\n event: 'bmapRoam',\n update: 'updateLayout'\n}, function (payload, ecModel) {\n ecModel.eachComponent('bmap', function (bMapModel) {\n var bmap = bMapModel.getBMap();\n var center = bmap.getCenter();\n bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());\n });\n});\n\nexport var version = '1.0.0';\n"],"names":["graphic","matrix","zrUtil","echarts.extendComponentModel","echarts.extendComponentView","echarts.util","echarts.registerCoordinateSystem","echarts.registerAction"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,AAMA,SAAS,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE;IAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IAClB,IAAI,CAAC,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;;IAEzB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;;IAEhB,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;CACpD;;AAED,YAAY,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;;AAEnD,YAAY,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,IAAI,EAAE;IAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;CACrB,CAAC;;AAEF,YAAY,CAAC,SAAS,CAAC,SAAS,GAAG,UAAU,MAAM,EAAE;IACjD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvF,CAAC;;AAEF,YAAY,CAAC,SAAS,CA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