Code Monkey home page Code Monkey logo

hh-map's Introduction

vue-map

npm版本1.0.3

1.配置

在index.html中引入

<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.7&key=你的开发key(详细请看官网https://lbs.amap.com/)"></script>

使用步行路线图时还需引入

<link rel="stylesheet" href="https://cache.amap.com/lbs/static/AMap.WalkingRender1120.css"/>
<script type="text/javascript" src="https://cache.amap.com/lbs/static/WalkingRender1230.js"></script>

在webpack.base.conf.js中加入

externals: {
  'AMap': 'AMap'
}

然后执行

# install dependencies
npm install hh-map@版本号

# serve with hot reload at localhost:8080
npm run dev

页面路由 http://localhost:8080/#/

2.使用API

1.属性

属性名 说明 类型 默认
center 地图初始化中心点,如果有标点传入优先使用标点 array null
positionLngLat 地图初始化标点 array []
position 地图地理位置(如:杭州市余杭区,杭州市黄龙) string ''
startPoint 步行路线起点地址 string ''
endPoint 步行路线终点地址 string ''
showPanel 使用步行路线时使用 boolean false
moreMarker 是否开始多标点模式 boolean false
getLngAndLat 获取当前地址的经纬度 function(x, y)

2.方法

方法名 说明 回调参数
cityChange 点击地图进行标点 点击地图后返回对应标点的信息(如:省,市,区,街道等等)
position 点击地图进行标点 点击地图后返回对应标点的经纬度

hh-map's People

Stargazers

 avatar

Watchers

 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.