1.index.wxml
<!--index.wxml-->
<view class="container">
<map id="map" longitude="116.39" latitude="39.90" scale="14" style="width:100%;height:400px" markers="{{markers}}"></map>
</view>
2.index.js
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
markers: [{
iconPath: 'http://webapi.amap.com/theme/v1.3/markers/b/mark_bs.png',
id: 0,
latitude: 39.89,
longitude: 116.38,
width: 19,
height: 33
}]
},
})