我的github

想实现根据输入x,y坐标,居中显示效果

map.getView().animate({ // 只设置需要的属性即可
    center: [经度,纬度 ], // 中心点
    zoom: 15, // 缩放级别
    rotation: undefined, // 缩放完成view视图旋转弧度
    duration: 1000 // 缩放持续时间,默认不需要设置
})

 

 

 

 

点击Position按钮(button),就会以该坐标为center居中显示,设置zoom为18,可以更准确地定位。

>>openlayers3教程:https://www.cnblogs.com/benmumu/p/8081068.html

参考:https://ask.csdn.net/questions/222910?sort=votes_count

posted on 2020-12-04 17:40  XiaoNiuFeiTian  阅读(1571)  评论(0)    收藏  举报