最近公司要求做一个地图显示全国各地的房源,规则:
省级>市级>片区>小区>房源
做的过程中遇到很多很多兼容性问题,不过到最后都解决,也大部分都是自己的代码问题,不过这次我是严格按照微信开发者文档进行编写的,出现了模拟器正常,安卓正常,ios异常位置偏移的问题
ios地图

安卓地图

然后官方要我模拟出这个bug,生成代码链接,给他们进行修复
如下:
wxml
<view class="intro">
<map id="map" longitude="113.324520" latitude="23.099994" scale="14" controls="{{controls}}" bindcontroltap="controltap" markers="{{markers}}" bindmarkertap="markertap" polyline="{{polyline}}" bindregionchange="regionchange" show-location style="width: 100%; height: 300px;"></map>
</view>
wxss
.intro {
margin: 30px;
text-align: center;
}
js
// map.js
Page({
data: {
markers: [{
iconPath: "https://ekeae-oss.oss-cn-shenzhen.aliyuncs.com/beta/ekeImg/2019/09/02/3dc271a8391b4de4a1b5ced53810b6d3.png",
id: 0,
latitude: 23.099994,
longitude: 113.324520,
width: 90,
height: 90,
clickable: true,
zIndex: 99,
label:{
color: '#ff611b',
textAlign: 'center',
// color:'#fff',
fontSize: 20,
padding: 20,
// bgColor: '#f6f6f699',
borderRadius: 9999,
clickable: true,
content:'龙华区',
anchorX :0,
anchorY : -80
}
}],
},
})
如有下载微信开发者工具的可直接打开
https://developers.weixin.qq.com/s/Z1vVDhmw7ukw
网友评论