当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
20 Star 47 Fork 14

干煸小黄鱼儿 / angular-BMap
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

angular-BMap

  1. angularjs简单封装百度地图;
  2. 在app.js中引用angularMap模块,如:angular.module('bMapApp', ['angularMap']);
  3. 所有方法均返回promise对象

##使用Bower安装 bower install angular-BMap --save或bower install douxc/angular-BMap --save ##默认中心点设置 angularBMapProvider.setDefaultPosition(lng,lat)

默认中心点为南京

##initMap 初始化地图操作 ##geoLocation 获取当前位置 ##geoLocationAndCenter 获取当前位置,并将地图中心点移到该位置 ##drawPoints 向地图添加兴趣点

  1. 兴趣点格式只支持array和object,且必须含有loc对象;
    如{loc: {lng: 121.496011, lat: 31.244085}}、
    {loc: '121.493065,31.244981'}、
    [{loc: {lng: 121.496011, lat: 31.244085}},{loc: '121.493065,31.244981'}]
    均可以添加
  1. 不支持的兴趣点格式不会添加到地图上,不影响正确的格式添加;
    如[{loc: {lng: 121.496011, lat: 31.244085}},
    {lod: '121.494215,31.243005'},
    {loc: '121.493065,31.244981'}]
    只有第1、3两个点会添加到地图上;
  2. 错误信息会通过defer.notify()返回;格式:第 ?个兴趣点loc对象不存在或格式错误,只支持object和string;
  3. 当前处理进度(第n个兴趣点)也会通过defer.notify()返回;需要自己处理

##drawMarkersAndSetOnclick 向地图添加兴趣点,同时添加点击事件

  1. 传入参数:
    1)markers 参考drawPoints;
    2)onClick - function 点击事件,在点击事件中可以通过this.obj获取当前markers对象
  1. 默认点击事件是将地图中心点移动到点击的位置

##默认的地图指令angularBmap 使用方式:<angular-bmap></angular-bmap>

The MIT License (MIT) Copyright (c) 2015 douxc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

angularjs封装百度地图指令 展开 收起
JavaScript 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/douxc/angular-BMap.git
git@gitee.com:douxc/angular-BMap.git
douxc
angular-BMap
angular-BMap
master

搜索帮助