微信小程序中使用自带的地图组件
作者:互联网
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
}]
},
})
标签:index,微信,app,markers,js,组件,自带,height,id 来源: https://blog.csdn.net/weixin_43837268/article/details/98788017