【问题标题】:how to add flyto leaflet function to Custom Svg Map如何将 flyto 传单功能添加到自定义 Svg 地图
【发布时间】:2022-01-15 23:37:55
【问题描述】:

我添加了一个自定义地图 svg 传单 Use svg as map using leaflet.js

并将 id 赋予路径 (svg),现在我想向其添加 flyto(传单功能)。任何想法如何做到这一点。我正在尝试使用传单动画飞到另一条路径

var map = L.map('map', {
  center: [40.75, -74.2],
  zoom: 13
});
  imageBounds = [
    [40.712216, -74.22655],
    [40.773941, -74.12544]
  ];

L.imageOverlay(imageUrl, imageBounds).addTo(map); 

#map {
 height: 400px;
}

谢谢

【问题讨论】:

    标签: javascript html svg leaflet


    【解决方案1】:

    对于带有动画的flyto,您应该使用此代码。

    map.panTo(new L.LatLng(40.712216,-74.22655));

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-17
      • 1970-01-01
      • 1970-01-01
      • 2017-07-19
      相关资源
      最近更新 更多