阿峰
阿峰
  • 发布:2015-09-04 17:08
  • 更新:2016-01-29 17:09
  • 阅读:1486

BUG 反馈-关于地图获取视口区域的api 错误

分类:5+ SDK
map = new plus.maps.Map("map");  

        map.centerAndZoom(new plus.maps.Point(121.910914, 30.878571), zoomV, plus.maps.MapType.MAPTYPE_NORMAL, false, true);  

        map.onstatuschanged = function(e) {   
            var bounds= e.bounds;  
            plus.nativeUI.alert(JSON.stringify(bounds));    
        }  

        setTimeout(function(){  
            var bounds= map.getBounds();  
            plus.nativeUI.alert(JSON.stringify(bounds));   

        },1000);

下面那个获取的坐标方法(map.getBounds();) 反了··· 西南角 变成了 东北角。。。。

2015-09-04 17:08 负责人:无 分享
已邀请:
DCloud_Android_ST

DCloud_Android_ST

你好 我使用魅族M3 未发现你所表述的问题‘’西南角 变成了 东北角“

  • 阿峰 (作者)

    你在用ios 试试吧··这个绝对有问题的··


    我的测试机是 肾5s,谷歌五太子


    下面是我的代码·为了避免这个问题·我加了个系统判断·


    map.onstatuschanged = function(e) {

    setTimeout(function() {


                var bounds = e.bounds;  
    if (mui.os.ios) {
    createMarker(bounds.northease.longitude, bounds.northease.latitude, bounds.southwest.longitude, bounds.southwest.latitude);
    } else {
    createMarker(bounds.southwest.longitude, bounds.southwest.latitude, bounds.northease.longitude, bounds.northease.latitude);
    }
    }, 800);
    }

    setTimeout(function() {
    var bounds = map.getBounds();
    //plus.nativeUI.alert(JSON.stringify(bounds));
    //这个方法5+sdk 有BUG,暂时做反向处理
    //createMarker(bounds.northease.longitude, bounds.northease.latitude, bounds.southwest.longitude, bounds.southwest.latitude);
    createMarker(bounds.southwest.longitude, bounds.southwest.latitude, bounds.northease.longitude, bounds.northease.latitude);

    }, 500);

    2015-09-06 17:38

阿峰

阿峰 (作者)

你在用ios 试试吧··这个绝对有问题的··

我的测试机是 肾5s,谷歌五太子

下面是我的代码·为了避免这个问题·我加了个系统判断·

map.onstatuschanged = function(e) {
setTimeout(function() {

            var bounds = e.bounds;  
            if (mui.os.ios) {  
                createMarker(bounds.northease.longitude, bounds.northease.latitude, bounds.southwest.longitude, bounds.southwest.latitude);  
            } else {  
                createMarker(bounds.southwest.longitude, bounds.southwest.latitude, bounds.northease.longitude, bounds.northease.latitude);  
            }  
        }, 800);  
    }  

    setTimeout(function() {  
        var bounds = map.getBounds();  
        //plus.nativeUI.alert(JSON.stringify(bounds));   
        //这个方法5+sdk 有BUG,暂时做反向处理  
        //createMarker(bounds.northease.longitude, bounds.northease.latitude, bounds.southwest.longitude, bounds.southwest.latitude);  
        createMarker(bounds.southwest.longitude, bounds.southwest.latitude, bounds.northease.longitude, bounds.northease.latitude);  

    }, 500);
DCloud_IOS_XTY

DCloud_IOS_XTY

应该是onstatuschanged反了,下个版本修复感谢反馈

  • 阿峰 (作者)

    希望能够增加 覆盖物 点聚合 和 添加覆盖物动画 这个功能。现在地图上加覆盖物的效果, 太生硬了··

    2015-09-06 19:07

jingshou

jingshou

onStatusChanged 我怎么触发不了这个事件?

//创建地图
map = new plus.maps.Map("allmap");
map.onStatusChanged = function( e ){
console.log(444444);
console.log( "StatusChanged: "+JSON.stringify(e) );
}

该问题目前已经被锁定, 无法添加新回复