- 紧急:iphone6s上点击地图Marker没响应bindmarkertap事件
使用6s运行小程序官网自带的地图程序,点击Marker时不响应事件,求解决。 版本信息如下图: [图片] 代码如下: [代码]<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>[代码][代码]// map.jsPage({ data: { markers: [{ iconPath: "/resources/others.png", id: 0, latitude: 23.099994, longitude: 113.324520, width: 50, height: 50 }], polyline: [{ points: [{ longitude: 113.3245211, latitude: 23.10229 }, { longitude: 113.324520, latitude: 23.21229 }], color:"#FF0000DD", width: 2, dottedLine: true }], controls: [{ id: 1, iconPath: '/resources/location.png', position: { left: 0, top: 300 - 50, width: 50, height: 50 }, clickable: true }] }, regionchange(e) { console.log(e.type) }, markertap(e) { console.log(e.markerId) }, controltap(e) { console.log(e.controlId) } })[代码]
2017-10-25 - 微信小程序地图组件加载大量覆盖物时操作很卡顿
加载大概2000个左右的覆盖物时操作地图很卡顿,请问有什么办法可以解决?地图是否支持聚合功能?谢谢
2017-10-24 - 在华为honor note8手机上点击地图上Marker时没有响应
在华为荣耀note8手机上点击地图上Marker时没有任何事件响应,其他手机上都可以,使用新建一个和手机宽(411)、高(695)、DPR(3.5)一样的模拟器,也没有响应,求解决
2017-10-22 - 请问地图组件什么时候能支持卫星模式显示啊
android地图上有卫星图、2D平面、3D俯视等,请问小程序什么时候能支持多种模式,特别的卫星图模式的显示啊?谢谢
2017-10-17 - 关于picker使用求助
想实现点击一个cover-image时弹出日期选择对话框,但由于picker不能在cover-view中嵌套,因此采取了点击时进入另外一个页面,在另外一个页面进入日期对话框,但这就导致多了一个操作步骤,进入新页面后还需要再次点击一下才能弹出日期框,想请教下怎么能让如下页面加载时默认就弹出日期选择框,而不用再点一次? <view class="section_container"> <picker mode="date" value="{{date}}" start="2017-05-01" end="2027-09-01" bindchange="bindDateChange"> <view class="picker"> 请选择日期: {{date}} </view> </picker> </view>
2017-10-15 - map marker的label属性在真机上不起作用
Android真机上最新的微信版本和SDK版本,marker的label属性不起作用,但在模拟器下显示效果很好,什么原因? 设置label属性的代码 label: { color: '#475575', fontSize: 32, content:‘101’, x:-25, y:-60}
2017-08-02 - 不升级微信版本如何升级SDK版本?
目前微信最新版本是6.5.10,小程序SDK版本是1.4.3,发现很多人的微信版本还是6.5.8,如何在不升级微信版本的情况下只升级SDK版本到1.4.3呢
2017-08-02 - cover-view里面不能放button组件?在模拟器上显示正确,真机上不行
map里面有个cover-view,cover-view包含了一个Button,模拟器上显示完美,真机上确没有显示出来,什么原因? <view class="map_container"> <map class="map" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location="true" markers="{{markers}}" bindmarkertap="makertap" polyline="{{polyline}}" bindtap="maptap"> <cover-view class="car_info" hidden="{{carInfohidden}}"> <cover-view class="otherInfo"> <cover-view class="basicOtherInfo"> <cover-view style="display: flex;"><cover-view class="carTextFlagCss">领航员:</cover-view><cover-view class="carTextCss">{{placeData.pilotName}}</cover-view> </cover-view> <cover-view style="display: flex;"><cover-view class="carTextFlagCss">俱乐部:</cover-view><cover-view class="carTextCss">{{placeData.clubName}}</cover-view> </cover-view> <cover-view style="display: flex;"><cover-view class="carTextFlagCss">组别:</cover-view><cover-view class="carTextCss">{{placeData.groupName}}</cover-view> </cover-view> </cover-view> <button type="warn" size="50rpx" style="width:400rpx;margin-top:20rpx" bindtap="showHistoryTrace">告警列表</button> </cover-view> </cover-view> </map> </view> <audio src="{{src}}" id="myAudio" ></audio>
2017-08-02 - 地图上设置Marker经纬度时使用的是哪种坐标系
从远程服务器获取到了原始真实坐标,使用算法将wgs84坐标转换成gcj02坐标,再地图上显示时与实际位置误差很大,但同样的真实坐标转换成百度BD-09坐标系在android下百度地图显示就非常准确,请问微信小程序设置Marker经纬度时使用的什么坐标系?谢谢。 以下是转换方法: class GPSTransformWX { constructor(param) { // this.ak = param["ak"]; } transform (wgLat, wgLon) { var a = 6378245.0; var ee = 0.00669342162296594323; if (this.outOfChina(wgLat, wgLon)) { return [wgLat, wgLon]; } var dLat = this.transformLat(wgLon - 105.0, wgLat - 35.0); var dLon = this.transformLon(wgLon - 105.0, wgLat - 35.0); var radLat = wgLat / 180.0 * Math.PI; var magic = Math.sin(radLat); var magic = 1 - ee * magic * magic; var sqrtMagic = Math.sqrt(magic); dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * Math.PI); dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * Math.PI); var mgLat = Number(wgLat) + Number(dLat); var mgLon = Number(wgLon) + Number(dLon); console.log("纬度"+dLat + "**" + wgLat + " ****" + mgLat); console.log("经度"+dLon + "**" + wgLon + " ****" + mgLon); return [mgLat, mgLon]; } outOfChina (lat, lon) { if (lon < 72.004 || lon > 137.8347) return true; if (lat < 0.8293 || lat > 55.8271) return true; return false; } transformLat (x, y) { console.log("x="+x+" y="+y); var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x)); ret += (20.0 * Math.sin(6.0 * x * Math.PI) + 20.0 * Math.sin(2.0 * x * Math.PI)) * 2.0 / 3.0; ret += (20.0 * Math.sin(y * Math.PI) + 40.0 * Math.sin(y / 3.0 * Math.PI)) * 2.0 / 3.0; ret += (160.0 * Math.sin(y / 12.0 * Math.PI) + 320 * Math.sin(y * Math.PI / 30.0)) * 2.0 / 3.0; return ret; }; transformLon (x, y) { var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x)); ret += (20.0 * Math.sin(6.0 * x * Math.PI) + 20.0 * Math.sin(2.0 * x * Math.PI)) * 2.0 / 3.0; ret += (20.0 * Math.sin(x * Math.PI) + 40.0 * Math.sin(x / 3.0 * Math.PI)) * 2.0 / 3.0; ret += (150.0 * Math.sin(x / 12.0 * Math.PI) + 300.0 * Math.sin(x / 30.0 * Math.PI)) * 2.0 / 3.0; return ret; }; } module.exports.GPSTransformWX = GPSTransformWX;
2017-07-31 - cover-view显示速度有点慢,而且有时会显示不出来
SDK1.4.2 微信版本6.5.10 系统android map在真机上运行,点击marker时弹出cover-view,显示速度有点慢,而且有时会显示不出来 上代码: .wxml <view class="map_container"> <map class="map" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location="true" markers="{{markers}}" bindmarkertap="makertap" polyline="{{polyline}}" bindtap="maptap"> <cover-view class="car_info" hidden="{{carInfohidden}}"> <cover-view class="basicInfo"> <cover-view style=" flex-direction:column;"> <cover-view class="driverNameCss">{{placeData.driverName}}</cover-view> <cover-view class="carNumberCss">{{placeData.carNumber}}</cover-view> <cover-view class="brandNameCss">{{placeData.brandName}}</cover-view> </cover-view> <cover-image class="carImgCss" src="../../img/vehicle_detail.png"> </cover-image> <cover-image class="closeImageCss" src="../../img/new_close_gray.png" bindtap="closeCarInfo"> </cover-image> </cover-view> <cover-view class="stateInfo"> <cover-view class="waringInfo"> <cover-view class="carState" style="display: flex;"> <cover-view class="carTextFlagCss">当前状态: </cover-view><cover-view class="carTextCss">{{placeData.state}}</cover-view> </cover-view> <cover-view class="carStateTime" style="display: flex;"><cover-view class="carTextFlagCss">上报时间: </cover-view><cover-view class="carTextCss">{{placeData.sTime}}</cover-view> </cover-view> </cover-view> <cover-image class="lineImage" src="../../img/vertical_line.png"> </cover-image> <cover-image class="lineImage2" src="../../img/vertical_line.png"> </cover-image> <cover-view class="GPSInfo"> <cover-view class = "subGPSInfo"> <cover-view class = "itemCss"> <cover-view class="carTextFlagCss">纬度</cover-view> <cover-view class="carTextCss">{{placeData.latitude}}</cover-view> </cover-view> <cover-view class = "itemCss"> <cover-view class="carTextFlagCss">经度</cover-view> <cover-view class="carTextCss">{{placeData.longitude}}</cover-view> </cover-view> <cover-view class = "itemCss"> <cover-view class="carTextFlagCss">速度</cover-view> <cover-view class="carTextCss">{{placeData.speed}} </cover-view> </cover-view> </cover-view> <cover-view class = "subGPSInfo"> <cover-view class = "itemCss"> <cover-view class="carTextFlagCss">方向</cover-view> <cover-view class="carTextCss">{{placeData.heading}}</cover-view> </cover-view> <cover-view class = "itemCss"> <cover-view class="carTextFlagCss">海拔</cover-view> <cover-view class="carTextCss">{{placeData.altitude}}</cover-view> </cover-view> <cover-view class = "itemCss"> <cover-view class="carTextFlagCss">GPS时间</cover-view> <cover-view class="carTextCss">{{placeData.pTime}}</cover-view> </cover-view> </cover-view> </cover-view> </cover-view> <cover-view class="otherInfo"> <cover-view class="basicOtherInfo"> <cover-view style="display: flex;"><cover-view class="carTextFlagCss">领航员 </cover-view><cover-view class="carTextCss">{{placeData.pilotName}}</cover-view> </cover-view> <cover-view style="display: flex;"><cover-view class="carTextFlagCss">俱乐部 </cover-view><cover-view class="carTextCss">{{placeData.clubName}}</cover-view> </cover-view> <cover-view style="display: flex;"><cover-view class="carTextFlagCss">组别 </cover-view><cover-view class="carTextCss">{{placeData.groupName}}</cover-view> </cover-view> </cover-view> <cover-image class="historyTraceCss" src="../../img/history_btn.png" bindtap="showHistoryTrace"> </cover-image> </cover-view> </cover-view> </map> </view> <audio src="{{src}}" id="myAudio" ></audio> .wxss .map_container{ height: 100vh; width: 100%; } .map { height: 100%; width: 100%; } .car_info { flex-direction: column; align-items: center; } .basicInfo{ width: 100%; height: 175rpx; background-color:#EBF0EB; font-size:30rpx; font-family:"楷体"; display: flex; flex-direction:row; } .driverNameCss{ margin-top: 35rpx; margin-left: 40rpx; color: green; } .carNumberCss{ margin-left: 40rpx; } .brandNameCss{ margin-left: 40rpx; } .carImgCss{ margin-top: 70rpx; margin-left: 220rpx; width: 100rpx; height: 100rpx; } .closeImageCss{ margin-top: 35rpx; margin-left: 220rpx; width: 50rpx; height: 50rpx; } .stateInfo{ width: 100%; height: 300rpx; background-color:#5A6A8A; font-size:30rpx; font-family:"楷体"; flex-direction:column; } .waringInfo{ margin-top: 30rpx; margin-left: 270rpx; width: 100%; height: 100rpx; float: center; flex-direction:column; } .GPSInfo{ top: 120rpx; margin-left: 40rpx; width: 100%; height: 200rpx; float: center; flex-direction:column; } .subGPSInfo{ width:100%; height: 80rpx; display: flex; } .carTextFlagCss{ color: #aaaabe; } .carTextCss{ color: #ffffff; } .lineImage{ top: 102rpx; margin-left: 20rpx; width: 700rpx; height: 3rpx; float: left; } .lineImage2{ top: 195rpx; margin-left: 20rpx; width: 700rpx; height: 3rpx; float: left; } .itemCss{ width: 295rpx; flex-direction:column; } .otherInfo{ width: 100%; height: 280rpx; background-color:#475575; font-family:"楷体"; margin-left: 1rpx; } .basicOtherInfo{ margin-top: 20rpx; margin-left: 300rpx; width: 100%; height: 100%; float: center; flex-direction:row; font-size:25rpx; } .historyTraceCss{ margin-top: 10rpx; margin-left: 150rpx; width: 60%; height: 80rpx; float: center; }
2017-07-21