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

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

 OpenLayers根据输入坐标居中定位显示功能

 

 

 

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

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

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

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-05-26
  • 2021-11-30
  • 2021-06-13
猜你喜欢
  • 2022-12-23
  • 2021-08-14
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案