限制最大距离,默认为2,设为3可以拉的更远,设为1可以限制的更近
viewer.navigation.setZoomOutLimitFactor(3)
限制最小距离,默认为200,只针对2d
viewer.navigation.setZoomInLimitFactor(300)

获得最大距离

function getMaxDis() {
    var maxFactor = viewer.navigation.getZoomOutLimitFactor();
 if(viewer.toolController.getActiveTool().getName() == "orbit"){
    var computeOverviewDistance = viewer.navigation.computeOverviewDistance(viewer.toolController.getActiveTool().getFitBounds());
 var maxDis = maxFactor * computeOverviewDistance;
 return maxDis
    }
    return ;
}

weijie
164 声望7 粉丝