【问题标题】:Add pan feature to Overview Map in OpenLayers 3在 OpenLayers 3 中向概览图添加平移功能
【发布时间】:2016-08-14 05:15:34
【问题描述】:

如何在 openlayers 3 中用概览图平移底图?

此功能在 openlayers 2 中运行良好。

【问题讨论】:

  • 还没有。我打算为此功能创建一个插件。

标签: gis openlayers openlayers-3 pan


【解决方案1】:

您可以创建另一个 html 元素来托管概览地图,将其放置在您想要的任何位置,然后创建一个新地图,该地图将具有相同中心但不同缩放级别的视图。

然后您将在第一张地图上监听事件 moveend 并更改其后第二张地图的视图:

yourFirstMap.on('moveend', function(evt){
    yourSecondMap.getView().setCenter(yourFirstMap.getView().getCenter());
});

【讨论】:

    猜你喜欢
    • 2016-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多