Giter VIP home page Giter VIP logo

baidumap-ui's Introduction

ui-map.js源码大部分转载至https://github.com/anypossiblew/ui-map-baidu
在原ui-map.js的基础上,根据项目需要,新增了toolbar控制,来更好的选择需要展示的地图控件   去掉了uiMapInfoWindow directive,通过自定义来展示信息窗口

使用示例  

package.json/bower.json

{
  "dependencies": {
    "baidumap-ui": "JSer-yj/baidumap-ui#1.0.0"
  }
}

执行 npm/bower install    

html页面:

<div ui-map-async-load>
  <div id="map_canvas"
    ui-map="serveMap"
    ui-event="{'map-click': 'addMarker($event, $params)', 'map-zoomend': 'setZoomMessage(serveMap.getZoom())' }"
    ui-options="mapOptions"
    class="bdmap-size" ></div>
</div>

angular component:

$scope.mapOptions = {
  ngCenter: {         //中心坐标
    lng: 116.404,
    lat: 39.915
  },
  toolbar:{
    mapTypes:[],      //地图类型
    scale:true,       //比例尺
    navigation:true,  //缩放平移
    cityList: true    //省市列表
  },
  ngZoom: 12,         //缩放比例
  overview: true,     //缩略地图
};

angular module注入ui.map依赖:

angular.module('myAppModule', ['ui.map']);

module config中加入加载地图链接所需要的参数:

myAppModule.config(['uiMapLoadParamsProvider', function (uiMapLoadParamsProvider) {
    uiMapLoadParamsProvider.setParams({
        v: '2.0', // 版本号
        ak:'xxxx' // 密钥
    });
}]);

baidumap-ui's People

Contributors

jser-yj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.