2012-07-13 7 views
5

私はSamsung Smart TV 2012と基本的にHTML5とJavaScript用のアプリを製作しています。 GoogleマップV3は非常にうまく動作しますが、その1つです。 テレビには十分な処理能力がないため、スムーズなエフェクトがひどく見えます。 最大の問題は、スムーズなsetZoom()です。 私の質問:方法や多分滑らかなズームを無効にするパラメータですか? 、またはマップ全体のすべてのスムーズエフェクトを無効にすることができますか? ありがとうございます!Google Maps API V3はスムーズにズームを無効にします

答えて

10

はい、スムーズズームを無効にすることができます。しかし、いくつかの変化があります。 V2では、disableContinuousZoom()だけで問題を解決できますが、この新しいバージョンでは、Googleのユーザーはそれを実装していませんでした。

これが最初の可能性である(と私の意見で最悪...):

* { 
    -webkit-transition-property: none!important; 
    transition-property: none!important; 
    /* These doesn't affect anything, but, just in case. */ 
    -webkit-animation: none!important; 
    animation: none!important; 
} 

(このソリューションの引用元:http://code.google.com/p/gmaps-api-issues/issues/detail?id=3033&q=continuous%20zoom&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Stars%20ApiType%20Internal)他のソリューション

、と私は考えて、最高の、 OpenLayersを実装したものです。

/** 
* APIMethod: setMapObjectCenter 
* Set the mapObject to the specified center and zoom 
* 
* Parameters: 
* center - {Object} MapObject LonLat format 
* zoom - {int} MapObject zoom format 
*/ 
setMapObjectCenter: function(center, zoom) { 
    if (this.animationEnabled === false && zoom != this.mapObject.zoom) { 
     var mapContainer = this.getMapContainer(); 
     google.maps.event.addListenerOnce(
      this.mapObject, 
      "idle", 
      function() { 
       mapContainer.style.visibility = ""; 
      } 
     ); 
     mapContainer.style.visibility = "hidden"; 
    } 
    this.mapObject.setOptions({ 
     center: center, 
     zoom: zoom 
    }); 
}, 

これはあなたのスタイルでマップコンテナを使用しているため、かなり奇妙ですが、あなたのケースで異なり、おそらく最良の解決策はTHIでありますs!

+1

大きな感謝は私のためにかなり良い仕事を!申し訳ありませんが投票に十分な評判を持っていません.. – codeTemplar

+0

問題なしcodeTemplar! :p – ferran87

0

それはgmaps docsではないのですが、これは私の作品:!!、CSSを使用したものferran87

map = new google.maps.Map(el, {animatedZoom: false}); 
+0

2011年4月17日のように、この文書化されていない設定はまだ私のために働いていました。 – MattGerg

関連する問題