Google Maps V3 API disables smooth scaling

I am making an application for Samsung Smart TV 2012 and its mostly HTML5 and JavaScript. Google Maps V3 works very well, but one thing. It seems that the TV does not have enough processing power, so the smooth effects look awful. the biggest problem is setZoom (), which is smooth. So my question is: is there a method, or perhaps a parameter for disabling smooth scaling? or perhaps turn off all smooth effects for the entire map? Thank!!

+5
source share
2 answers

Yes, you can turn off smooth scaling! But with some ... changes. In V2, you can simply "disableContinuousZoom ()" and solve the problem, but in this new version, the Google guys did not implement it.

This is the first opportunity (and worst in my opinion ..):

 * {
  -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;
}

(this solution is from: 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 )

Another solution, and I think the best that was implemented in 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
    });
},

This is rather strange because you use a Container map with styles, but depending on your case, maybe the best solution is this!

+10
source

although this is not on gmaps docs , this works for me:

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

All Articles