【问题标题】:how to call fitBounds on leaflet angular如何在传单角度上调用 fitBounds
【发布时间】:2015-05-01 18:48:09
【问题描述】:

如何在带有角度传单的地图上调用 fitbounds?我看到一个帖子是为了寻找地图绑定事件,但找不到任何示例代码。

【问题讨论】:

    标签: leaflet angular-leaflet-directive


    【解决方案1】:

    尝试使用

    angular.module('myModule').controller('MapController', ['$scope', 'leafletData',
        function($scope, leafletData) {
                leafletData.getMap().then(function(map) {
                    map.fitBounds(bounds);
                });
        }
    ]);
    

    然后退房 Dynamically changing Leaflet map bounds in Angular?

    【讨论】:

      猜你喜欢
      • 2016-05-05
      • 2017-10-09
      • 1970-01-01
      • 2014-09-15
      • 2015-06-26
      • 2020-02-01
      • 2020-06-29
      • 1970-01-01
      • 2014-09-13
      相关资源
      最近更新 更多