gmaps4rails可以返回类似图像的地图吗?

时间:2012-10-22 06:54:22

标签: javascript css ruby-on-rails coffeescript gmaps4rails

我目前正在使用gmaps4ails并返回了一个交互式地图。有没有办法获得更像静态的图像呢?

我已尝试修改以下代码但由于某些原因在手机上捏合和缩放无法正常工作

if MODETECT.device.phone
      @map_options =
        disableDefaultUI:       true #false has the street view capability
        disableDoubleClickZoom: false
        type:                   "ROADMAP" # HYBRID, ROADMAP, SATELLITE, TERRAIN
        draggable:              false # don't allow to drag map
        scrollwheel:            true
        zoomControl:            true

    else
      @map_options =
        disableDefaultUI:       true #false has the street view capability
        disableDoubleClickZoom: false
        type:                   "ROADMAP" # HYBRID, ROADMAP, SATELLITE, TERRAIN
        draggable:              true # don't allow to drag map
        scrollwheel:            false #can't use the scroll whell to zoom
        zoomControl:            true #widget that allows control zoom without pinch

...

createMap : ->
    defaultOptions =
      maxZoom:                @map_options.maxZoom
      minZoom:                @map_options.minZoom
      zoom:                   @map_options.zoom
      center:                 @createLatLng(@map_options.center_latitude, @map_options.center_longitude)
      mapTypeId:              google.maps.MapTypeId[@map_options.type]
      mapTypeControl:         @map_options.mapTypeControl
      disableDefaultUI:       @map_options.disableDefaultUI
      disableDoubleClickZoom: @map_options.disableDoubleClickZoom
      draggable:              @map_options.draggable
      scrollwheel:            @map_options.scrollwheel
      zoomControl:            @map_options.zoomControl

它似乎在可拖动的意义上起作用,但手机上的scrollwheel和zoomControl无效。

0 个答案:

没有答案