【问题标题】:Restore bounds or decrease bounds恢复界限或减少界限
【发布时间】:2015-06-13 09:19:04
【问题描述】:

在 angularJS/ angular Google 地图项目中,我在地图上添加标记。当我添加标记时,我可以扩展地图的边界,但是当我从地图中删除标记时,我想减小边界。

据我所知,库中没有像减少边界函数这样的东西,所以我试图创建一个新的边界对象,但没有成功。

var restoreBounds = new google.maps.LatLngBounds();

任何想法或解决方案将不胜感激。

【问题讨论】:

    标签: angularjs google-maps-api-3 angularjs-scope angular-google-maps


    【解决方案1】:

    我真傻。我需要休息一下。

    $timeout(function() {
        $scope.mapInstance = $scope.map.control.getGMap();
        $scope.mapInstance.fitBounds(newMapBoundsRestore);
    }, 100);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-03
      • 1970-01-01
      • 2019-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多