[代码]onMarkerClick: [代码][代码]function[代码][代码](e) {[代码][代码] [代码][代码]var[代码] [代码]markerId = e.markerId[代码][代码] [代码][代码]var[代码] [代码]ids = markerId.split([代码][代码]"-"[代码][代码])[代码][代码] [代码][代码]if[代码] [代码](flagMarkerC == ids[0]) { [代码][代码]//点击了城市的Marker[代码][代码] [代码][代码]var[代码] [代码]markerInfo = JSON.parse(ids[1])[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]latitude: markerInfo.citylat,[代码][代码] [代码][代码]longitude: markerInfo.citylng,[代码][代码] [代码][代码]})[代码][代码] [代码][代码]this[代码][代码].mapCtx.moveToLocation()[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]scale: zoomShowAreaJuHeValue - 1[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码](flagMarkerP == ids[0]) { [代码][代码]//点击了区域的Marker[代码][代码] [代码][代码]var[代码] [代码]markerInfo = JSON.parse(ids[1])[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]latitude: markerInfo.lat,[代码][代码] [代码][代码]longitude: markerInfo.lng,[代码][代码] [代码][代码]})[代码][代码] [代码][代码]this[代码][代码].mapCtx.moveToLocation()[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]scale: [代码][代码]this[代码][代码].initscaleSize[代码][代码] [代码][代码]}, (result) => {[代码][代码] [代码][代码]console.log(result)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]mapChange: [代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码] [代码] [代码][代码]this[代码][代码].mapCtx.getScale({ [代码][代码]//获取地图缩放级别[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]var[代码] [代码]scale = res.scale[代码][代码] [代码][代码]console.log([代码][代码]"scale---》》》"[代码] [代码]+ scale) //这里不准确[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码]
获取地图缩放级别不准确- 当前 Bug 的表现(可附上截图) 获取的缩放级别和自己预先设置的缩放级别不一致 - 预期表现 通过getScale获取自己预先设置的缩放级别 - 复现路径 缩放地图,点击地图的一个maker,放大地图到指定缩放级别,无法正确放大 - 提供一个最简复现 Demo 无
2018-08-28