精华内容
下载资源
问答
  • echart-bmap 项目设置 npm install 编译和热重装以进行开发 npm run serve 编译并最小化生产 npm run build 整理和修复文件 npm run lint 自定义配置 请参阅。 echarts与bmap结合使用,同时使用了bmap的集群标记和...
  • 本文实例为大家分享了vue用BMap百度地图实现即时搜索功能的具体代码,供大家参考,具体内容如下 功能如下: 搜索框搜索—自动下拉—点击数据—数据显示在搜索框里—点击新增–数据显示在下方–点击删除–删除当前 ...
  • 百度地图资源bmap.js

    2020-03-20 21:51:03
    百度bmap.js,实测可用,欢迎下载。 是echarts和百度地图结合时需要导入的百度地图的js文件
  • 使用百度地图和Echarts制作的地图页面,页面可以显示震级,预留后台接口,代码清晰易懂,打开即可使用。(注:开发所使用的百度地图的授权码是我个人的授权码,诸位下载之后还请换成自己的授权码...)文件包含bmap.js。
  • <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak="></script><!--百度申请开发码--> ...<script type="text/javascript" src="/js/echarts/js/bmap.min.js"></script>
  • BMap离线地图资源包

    2019-10-10 17:07:51
    很多项目需要在内网环境中运行,因此少不了离线地图,在此将自己辛苦总结的东西贡献给同行以供参考使用。
  • @ umi-material / @ yjtec / bmap yjtec bmap 用法 umi block https://github.com/https://github.com/yjtec/js-bmap.git/tree/master/@yjtec/bmap 属性mapprops 表示Map构造函数的可选参数,通过对象字面量形式...
  • 百度地图bmap.js

    2018-09-05 09:24:50
    是echarts和百度地图结合时需要导入的百度地图的js文件
  • bmap-wx.js

    2020-01-15 23:42:34
    微信小程序开发,基于百度地图API的天气预报小程序,可根据接口获取各个城市的天气信息,并通过界面很好的展示在用户面前,该小程序也具有很好的交互性,使用起来很方便。
  • 百度地图扩展包bmap.js

    2019-06-19 15:22:31
    百度地图扩展包,可用于Echarts使用百度地图作为底图。ECharts是一个使用 JavaScript 实现的开源可视化库。
  • 使用以百度地图为底图的形式,结合echarts,在地图上显示echarts的scatter、effectScatter、custom元素
  • bmap.min.js

    2018-05-10 09:32:21
    是echarts和百度地图结合时需要导入的百度地图的js文件
  • Vue集成Bmap离线地图-打dist包问题解决,详见:https://blog.csdn.net/yc199505/article/details/89448659
  • 百度离线地图与Vue的结合,api我改好了,上传上去了,使用方法见:https://blog.csdn.net/yc199505/article/details/88846596
  • Bmap-offline的api.js资源

    2019-03-26 10:46:39
    Bmap-offline的api.js支持3.0版本的地图api调用方式,希望不要吝啬积分,保证可以满意
  • 本人亲测可用,echarts官网实例中展示了与百度地图结合,其中需要bmap.js等,直接放入将压缩包中的js放入项目中引用即可使用。
  • bmap_offline_api_min.js

    2020-03-06 16:09:31
    离线地图开发,百度地图工具包JS。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
  • bmap全国省市地图包

    2020-05-19 14:45:39
    百度地图全国地图包,js和json两种,在使用bmap时候引入使用,开发数据可视化页面有时会引入使用地方的地图包,此资源就是全国省份地图包
  • / *标题:bMap说明:bMap * / 来自于:APICloud官方 基础类 室内地图 标明,气泡类 覆盖物类 搜索类 离线地图类 论坛示例 为帮助用户更好的变频器的使用模块,论坛维护了一个,示例中包含示例代码,知识...
  • ECharts 之前提供下载的矢量地图数据来自第三方,由于部分数据不符合国家《测绘法》规定,目前...建议大家使用以百度地图为底图的形式,需要引入扩展插件bmap.min.js,扩展主要提供了跟 geo 一样的坐标系和底图的绘制
  • bmap工具-源码

    2021-02-24 04:14:44
    bmap工具
  • 世界地图bmap.js

    2017-05-25 14:44:34
    世界地图bmap.js
  • 用于前端开发的bmap格式文件,主要针对百度离线地图的开发
  • npm install rc-bmap 当前通过npm或yarn直接安装为最新版,若想指定安装0.2.4版本时可通过: npm install rc-bmap@0.2.4 协议 本地开发 与demo结合的最佳实践: 将demo工程clone至本地。 git clone ...
  • BMap.swc库文件

    2018-12-21 16:09:00
    一定要在flash cs5的菜单栏依次打开: 编辑-》首选参数-》actionscript-》actionscript 3.0设置-》库路径-》浏览到 ...swc文件,然后选择那个BMap.swc 另外,在“发布设置”的flash选项里,也要勾选“发布swc”
  • bmap.js

    2021-08-25 10:30:39
    } echarts.extendComponentModel({ type: 'bmap', getBMap: function () { // __bmap is injected when creating BMapCoordSys return this.__bmap; }, setCenterAndZoom: function (center, zoom) { this.option....
    
    /*
    * Licensed to the Apache Software Foundation (ASF) under one
    * or more contributor license agreements.  See the NOTICE file
    * distributed with this work for additional information
    * regarding copyright ownership.  The ASF licenses this file
    * to you under the Apache License, Version 2.0 (the
    * "License"); you may not use this file except in compliance
    * with the License.  You may obtain a copy of the License at
    *
    *   http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing,
    * software distributed under the License is distributed on an
    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    * KIND, either express or implied.  See the License for the
    * specific language governing permissions and limitations
    * under the License.
    */
    
    (function (global, factory) {
      typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('echarts')) :
      typeof define === 'function' && define.amd ? define(['exports', 'echarts'], factory) :
      (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bmap = {}, global.echarts));
    }(this, (function (exports, echarts) { 'use strict';
    
      function BMapCoordSys(bmap, api) {
        this._bmap = bmap;
        this.dimensions = ['lng', 'lat'];
        this._mapOffset = [0, 0];
        this._api = api;
        this._projection = new BMap.MercatorProjection();
      }
    
      BMapCoordSys.prototype.dimensions = ['lng', 'lat'];
    
      BMapCoordSys.prototype.setZoom = function (zoom) {
        this._zoom = zoom;
      };
    
      BMapCoordSys.prototype.setCenter = function (center) {
        this._center = this._projection.lngLatToPoint(new BMap.Point(center[0], center[1]));
      };
    
      BMapCoordSys.prototype.setMapOffset = function (mapOffset) {
        this._mapOffset = mapOffset;
      };
    
      BMapCoordSys.prototype.getBMap = function () {
        return this._bmap;
      };
    
      BMapCoordSys.prototype.dataToPoint = function (data) {
        var point = new BMap.Point(data[0], data[1]); // TODO mercator projection is toooooooo slow
        // let mercatorPoint = this._projection.lngLatToPoint(point);
        // let width = this._api.getZr().getWidth();
        // let height = this._api.getZr().getHeight();
        // let divider = Math.pow(2, 18 - 10);
        // return [
        //     Math.round((mercatorPoint.x - this._center.x) / divider + width / 2),
        //     Math.round((this._center.y - mercatorPoint.y) / divider + height / 2)
        // ];
    
        var px = this._bmap.pointToOverlayPixel(point);
    
        var mapOffset = this._mapOffset;
        return [px.x - mapOffset[0], px.y - mapOffset[1]];
      };
    
      BMapCoordSys.prototype.pointToData = function (pt) {
        var mapOffset = this._mapOffset;
        pt = this._bmap.overlayPixelToPoint({
          x: pt[0] + mapOffset[0],
          y: pt[1] + mapOffset[1]
        });
        return [pt.lng, pt.lat];
      };
    
      BMapCoordSys.prototype.getViewRect = function () {
        var api = this._api;
        return new echarts.graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight());
      };
    
      BMapCoordSys.prototype.getRoamTransform = function () {
        return echarts.matrix.create();
      };
    
      BMapCoordSys.prototype.prepareCustoms = function () {
        var rect = this.getViewRect();
        return {
          coordSys: {
            // The name exposed to user is always 'cartesian2d' but not 'grid'.
            type: 'bmap',
            x: rect.x,
            y: rect.y,
            width: rect.width,
            height: rect.height
          },
          api: {
            coord: echarts.util.bind(this.dataToPoint, this),
            size: echarts.util.bind(dataToCoordSize, this)
          }
        };
      };
    
      function dataToCoordSize(dataSize, dataItem) {
        dataItem = dataItem || [0, 0];
        return echarts.util.map([0, 1], function (dimIdx) {
          var val = dataItem[dimIdx];
          var halfSize = dataSize[dimIdx] / 2;
          var p1 = [];
          var p2 = [];
          p1[dimIdx] = val - halfSize;
          p2[dimIdx] = val + halfSize;
          p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
          return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
        }, this);
      }
    
      var Overlay; // For deciding which dimensions to use when creating list data
    
      BMapCoordSys.dimensions = BMapCoordSys.prototype.dimensions;
    
      function createOverlayCtor() {
        function Overlay(root) {
          this._root = root;
        }
    
        Overlay.prototype = new BMap.Overlay();
        /**
         * 初始化
         *
         * @param {BMap.Map} map
         * @override
         */
    
        Overlay.prototype.initialize = function (map) {
          map.getPanes().labelPane.appendChild(this._root);
          return this._root;
        };
        /**
         * @override
         */
    
    
        Overlay.prototype.draw = function () {};
    
        return Overlay;
      }
    
      BMapCoordSys.create = function (ecModel, api) {
        var bmapCoordSys;
        var root = api.getDom(); // TODO Dispose
    
        ecModel.eachComponent('bmap', function (bmapModel) {
          var painter = api.getZr().painter;
          var viewportRoot = painter.getViewportRoot();
    
          if (typeof BMap === 'undefined') {
            throw new Error('BMap api is not loaded');
          }
    
          Overlay = Overlay || createOverlayCtor();
    
          if (bmapCoordSys) {
            throw new Error('Only one bmap component can exist');
          }
    
          var bmap;
    
          if (!bmapModel.__bmap) {
            // Not support IE8
            var bmapRoot = root.querySelector('.ec-extension-bmap');
    
            if (bmapRoot) {
              // Reset viewport left and top, which will be changed
              // in moving handler in BMapView
              viewportRoot.style.left = '0px';
              viewportRoot.style.top = '0px';
              root.removeChild(bmapRoot);
            }
    
            bmapRoot = document.createElement('div');
            bmapRoot.className = 'ec-extension-bmap'; // fix #13424
    
            bmapRoot.style.cssText = 'position:absolute;width:100%;height:100%';
            root.appendChild(bmapRoot); // initializes bmap
    
            var mapOptions = bmapModel.get('mapOptions');
    
            if (mapOptions) {
              mapOptions = echarts.util.clone(mapOptions); // Not support `mapType`, use `bmap.setMapType(MapType)` instead.
    
              delete mapOptions.mapType;
            }
    
            bmap = bmapModel.__bmap = new BMap.Map(bmapRoot, mapOptions);
            var overlay = new Overlay(viewportRoot);
            bmap.addOverlay(overlay); // Override
    
            painter.getViewportRootOffset = function () {
              return {
                offsetLeft: 0,
                offsetTop: 0
              };
            };
          }
    
          bmap = bmapModel.__bmap; // Set bmap options
          // centerAndZoom before layout and render
    
          var center = bmapModel.get('center');
          var zoom = bmapModel.get('zoom');
    
          if (center && zoom) {
            var bmapCenter = bmap.getCenter();
            var bmapZoom = bmap.getZoom();
            var centerOrZoomChanged = bmapModel.centerOrZoomChanged([bmapCenter.lng, bmapCenter.lat], bmapZoom);
    
            if (centerOrZoomChanged) {
              var pt = new BMap.Point(center[0], center[1]);
              bmap.centerAndZoom(pt, zoom);
            }
          }
    
          bmapCoordSys = new BMapCoordSys(bmap, api);
          bmapCoordSys.setMapOffset(bmapModel.__mapOffset || [0, 0]);
          bmapCoordSys.setZoom(zoom);
          bmapCoordSys.setCenter(center);
          bmapModel.coordinateSystem = bmapCoordSys;
        });
        ecModel.eachSeries(function (seriesModel) {
          if (seriesModel.get('coordinateSystem') === 'bmap') {
            seriesModel.coordinateSystem = bmapCoordSys;
          }
        });
      };
    
      function v2Equal(a, b) {
        return a && b && a[0] === b[0] && a[1] === b[1];
      }
    
      echarts.extendComponentModel({
        type: 'bmap',
        getBMap: function () {
          // __bmap is injected when creating BMapCoordSys
          return this.__bmap;
        },
        setCenterAndZoom: function (center, zoom) {
          this.option.center = center;
          this.option.zoom = zoom;
        },
        centerOrZoomChanged: function (center, zoom) {
          var option = this.option;
          return !(v2Equal(center, option.center) && zoom === option.zoom);
        },
        defaultOption: {
          center: [104.114129, 37.550339],
          zoom: 5,
          // 2.0 http://lbsyun.baidu.com/custom/index.htm
          mapStyle: {},
          // 3.0 http://lbsyun.baidu.com/index.php?title=open/custom
          mapStyleV2: {},
          // See https://lbsyun.baidu.com/cms/jsapi/reference/jsapi_reference.html#a0b1
          mapOptions: {},
          roam: false
        }
      });
    
      function isEmptyObject(obj) {
        for (var key in obj) {
          if (obj.hasOwnProperty(key)) {
            return false;
          }
        }
    
        return true;
      }
    
      echarts.extendComponentView({
        type: 'bmap',
        render: function (bMapModel, ecModel, api) {
          var rendering = true;
          var bmap = bMapModel.getBMap();
          var viewportRoot = api.getZr().painter.getViewportRoot();
          var coordSys = bMapModel.coordinateSystem;
    
          var moveHandler = function (type, target) {
            if (rendering) {
              return;
            }
    
            var offsetEl = viewportRoot.parentNode.parentNode.parentNode;
            var mapOffset = [-parseInt(offsetEl.style.left, 10) || 0, -parseInt(offsetEl.style.top, 10) || 0]; // only update style when map offset changed
    
            var viewportRootStyle = viewportRoot.style;
            var offsetLeft = mapOffset[0] + 'px';
            var offsetTop = mapOffset[1] + 'px';
    
            if (viewportRootStyle.left !== offsetLeft) {
              viewportRootStyle.left = offsetLeft;
            }
    
            if (viewportRootStyle.top !== offsetTop) {
              viewportRootStyle.top = offsetTop;
            }
    
            coordSys.setMapOffset(mapOffset);
            bMapModel.__mapOffset = mapOffset;
            api.dispatchAction({
              type: 'bmapRoam',
              animation: {
                duration: 0
              }
            });
          };
    
          function zoomEndHandler() {
            if (rendering) {
              return;
            }
    
            api.dispatchAction({
              type: 'bmapRoam',
              animation: {
                duration: 0
              }
            });
          }
    
          bmap.removeEventListener('moving', this._oldMoveHandler);
          bmap.removeEventListener('moveend', this._oldMoveHandler);
          bmap.removeEventListener('zoomend', this._oldZoomEndHandler);
          bmap.addEventListener('moving', moveHandler);
          bmap.addEventListener('moveend', moveHandler);
          bmap.addEventListener('zoomend', zoomEndHandler);
          this._oldMoveHandler = moveHandler;
          this._oldZoomEndHandler = zoomEndHandler;
          var roam = bMapModel.get('roam');
    
          if (roam && roam !== 'scale') {
            bmap.enableDragging();
          } else {
            bmap.disableDragging();
          }
    
          if (roam && roam !== 'move') {
            bmap.enableScrollWheelZoom();
            bmap.enableDoubleClickZoom();
            bmap.enablePinchToZoom();
          } else {
            bmap.disableScrollWheelZoom();
            bmap.disableDoubleClickZoom();
            bmap.disablePinchToZoom();
          }
          /* map 2.0 */
    
    
          var originalStyle = bMapModel.__mapStyle;
          var newMapStyle = bMapModel.get('mapStyle') || {}; // FIXME, Not use JSON methods
    
          var mapStyleStr = JSON.stringify(newMapStyle);
    
          if (JSON.stringify(originalStyle) !== mapStyleStr) {
            // FIXME May have blank tile when dragging if setMapStyle
            if (!isEmptyObject(newMapStyle)) {
              bmap.setMapStyle(echarts.util.clone(newMapStyle));
            }
    
            bMapModel.__mapStyle = JSON.parse(mapStyleStr);
          }
          /* map 3.0 */
    
    
          var originalStyle2 = bMapModel.__mapStyle2;
          var newMapStyle2 = bMapModel.get('mapStyleV2') || {}; // FIXME, Not use JSON methods
    
          var mapStyleStr2 = JSON.stringify(newMapStyle2);
    
          if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
            // FIXME May have blank tile when dragging if setMapStyle
            if (!isEmptyObject(newMapStyle2)) {
              bmap.setMapStyleV2(echarts.util.clone(newMapStyle2));
            }
    
            bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);
          }
    
          rendering = false;
        }
      });
    
      echarts.registerCoordinateSystem('bmap', BMapCoordSys); // Action
    
      echarts.registerAction({
        type: 'bmapRoam',
        event: 'bmapRoam',
        update: 'updateLayout'
      }, function (payload, ecModel) {
        ecModel.eachComponent('bmap', function (bMapModel) {
          var bmap = bMapModel.getBMap();
          var center = bmap.getCenter();
          bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());
        });
      });
      var version = '1.0.0';
    
      exports.version = version;
    
      Object.defineProperty(exports, '__esModule', { value: true });
    
    })));
    //# sourceMappingURL=bmap.js.map
    
    
    展开全文

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 16,730
精华内容 6,692
关键字:

bmap