Meteor google 地图最大缩放、最小缩放和缩放级别

Meteor google map maxZoom, minZoom and zoom level

我正在使用流星 google map package and I would like to restraint the map zoom level (because I am doing a Geospatial Queries)。 通常它应该在我的 mapOptions 中完成。 我的代码如下所示: 在我的模板上有我的地图

<template name="mypage">
    <div class="map-container">
      {{> googleMap name="map" options=mapOptions}}
    </div>
</template>

然后在我的 Javascript 助手上,我应该有这样的地图选项:

Template.mypage.helpers({
  mapOptions: function(){
    if(GoogleMaps.loaded()){
      return {
        center: new google.maps.LatLng(48.8520442,2.3346246),
        zoom: 13,
        maxZoom: 15
      }
    }
  }
})

不幸的是,maxZoom 似乎不起作用... 他们还有其他限制缩放的可能性吗?

好的,我找到了解决方案, 必须在其他中声明 maxZoom 和 minZoom 才能进行缩放级别控制。 因此,可能的解决方案如下所示:

Template.mypage.helpers({
  mapOptions: function(){
    if(GoogleMaps.loaded()){
      return {
        center: new google.maps.LatLng(48.8520442,2.3346246),
        zoom: 13,
        maxZoom: 20,
        minZoom: 13
      }
    }
  }
})