HELP! OL 2.13: Google v3 and other layers not zooming "together"

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

HELP! OL 2.13: Google v3 and other layers not zooming "together"

Jefferson Heard
I'm stuck. My code works with OSM, but I need it to work with Google as well.  The problem is simply that Google v3 and my other layers are not playing well together at all.  They don't zoom together.  

In the case of Google satellite, the layer doesn't zoom at all unless I pan the map.  In the case of the others (hybrid, terrain, roads), they zoom, but the google layer and the other layers on the map zoom up to half a second apart from each other, and the layer "drifts" between zoom levels somewhat.  

The code that reproduces this is simple and derived directly from the WMS and Google v3 examples, but they appear not to work together well:

$(function() {
var in_options = {
internalProjection: new OpenLayers.Projection('EPSG:900913'),
externalProjection: new OpenLayers.Projection("EPSG:4326")
};

var wkt = new OpenLayers.Format.WKT(in_options);
var feature = wkt.read("POLYGON ((-78.9950752916525687 35.5198238058974169, -78.9950752916525687 36.0750238562958074, -78.2565296570171398 36.0750238562958074, -78.2565296570171398 35.5198238058974169, -78.9950752916525687 35.5198238058974169))");
var bounds = feature.geometry.getBounds();

var wms = new OpenLayers.Layer.WMS('Zoning', "/ga_resources/wms/", {

styles: "styles/new-style",
layers: "catalog/states/nc/counties/wake/zoning",
transparent: true
});

var map = new OpenLayers.Map({ div:'map', projection: new OpenLayers.Projection("EPSG:900913")});

var layers = [
new OpenLayers.Layer.Google(
"Google Physical",
{type: google.maps.MapTypeId.TERRAIN}
),
new OpenLayers.Layer.Google(
"Google Streets", // the default
{numZoomLevels: 20}
),
new OpenLayers.Layer.Google(
"Google Hybrid",
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
),
new OpenLayers.Layer.Google(
"Google Satellite",
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
),
wms
];

map.addLayers(layers);
//map.addLayers([wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToExtent(bounds);

});

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

Andreas Hocevar-2
Google Maps is integrated using the GMaps API, and there we cannot control zoom animation. Your best bet is to turn off zoom animation for the map by configuring your map with

    zoomMethod: null

Then you can also activate the OpenLayers hack to remove the GMaps animation by turning the layer off during zooming. To do so, configure your Google layer with

    animationEnabled: false

Andreas.


On Mon, Jun 17, 2013 at 6:54 PM, Jeff Heard <[hidden email]> wrote:
I'm stuck. My code works with OSM, but I need it to work with Google as well.  The problem is simply that Google v3 and my other layers are not playing well together at all.  They don't zoom together.  

In the case of Google satellite, the layer doesn't zoom at all unless I pan the map.  In the case of the others (hybrid, terrain, roads), they zoom, but the google layer and the other layers on the map zoom up to half a second apart from each other, and the layer "drifts" between zoom levels somewhat.  

The code that reproduces this is simple and derived directly from the WMS and Google v3 examples, but they appear not to work together well:

$(function() {
var in_options = {
internalProjection: new OpenLayers.Projection('EPSG:900913'),
externalProjection: new OpenLayers.Projection("EPSG:4326")
};

var wkt = new OpenLayers.Format.WKT(in_options);
var feature = wkt.read("POLYGON ((-78.9950752916525687 35.5198238058974169, -78.9950752916525687 36.0750238562958074, -78.2565296570171398 36.0750238562958074, -78.2565296570171398 35.5198238058974169, -78.9950752916525687 35.5198238058974169))");
var bounds = feature.geometry.getBounds();

var wms = new OpenLayers.Layer.WMS('Zoning', "/ga_resources/wms/", {

styles: "styles/new-style",
layers: "catalog/states/nc/counties/wake/zoning",
transparent: true
});

var map = new OpenLayers.Map({ div:'map', projection: new OpenLayers.Projection("EPSG:900913")});

var layers = [
new OpenLayers.Layer.Google(
"Google Physical",
{type: google.maps.MapTypeId.TERRAIN}
),
new OpenLayers.Layer.Google(
"Google Streets", // the default
{numZoomLevels: 20}
),
new OpenLayers.Layer.Google(
"Google Hybrid",
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
),
new OpenLayers.Layer.Google(
"Google Satellite",
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
),
wms
];

map.addLayers(layers);
//map.addLayers([wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToExtent(bounds);

});

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users




--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

Jefferson Heard
Andreas, thanks for that, will do.  That doesn't fix the other issue, though, which is that zooming in and out causes the layers to "drift" physically.  An object that is on the west side of the street at one zoom level will overlap the street at the next zoom level in or out, and so forth.  The rendering only appears to be accurate at the initial zoom level.  I haven't tested this extensively for WMS layers, but the problem is consistent with vector layers.

This is a recent change - I've been using OpenLayers for three years now, and I saw this problem back in 2.11 for a time and the fix was to add a maxExtent to the map.  That fix no longer works now, and I'm at a loss as to what to fix.  


On Tue, Jun 18, 2013 at 5:25 AM, Andreas Hocevar <[hidden email]> wrote:
Google Maps is integrated using the GMaps API, and there we cannot control zoom animation. Your best bet is to turn off zoom animation for the map by configuring your map with

    zoomMethod: null

Then you can also activate the OpenLayers hack to remove the GMaps animation by turning the layer off during zooming. To do so, configure your Google layer with

    animationEnabled: false

Andreas.


On Mon, Jun 17, 2013 at 6:54 PM, Jeff Heard <[hidden email]> wrote:
I'm stuck. My code works with OSM, but I need it to work with Google as well.  The problem is simply that Google v3 and my other layers are not playing well together at all.  They don't zoom together.  

In the case of Google satellite, the layer doesn't zoom at all unless I pan the map.  In the case of the others (hybrid, terrain, roads), they zoom, but the google layer and the other layers on the map zoom up to half a second apart from each other, and the layer "drifts" between zoom levels somewhat.  

The code that reproduces this is simple and derived directly from the WMS and Google v3 examples, but they appear not to work together well:

$(function() {
var in_options = {
internalProjection: new OpenLayers.Projection('EPSG:900913'),
externalProjection: new OpenLayers.Projection("EPSG:4326")
};

var wkt = new OpenLayers.Format.WKT(in_options);
var feature = wkt.read("POLYGON ((-78.9950752916525687 35.5198238058974169, -78.9950752916525687 36.0750238562958074, -78.2565296570171398 36.0750238562958074, -78.2565296570171398 35.5198238058974169, -78.9950752916525687 35.5198238058974169))");
var bounds = feature.geometry.getBounds();

var wms = new OpenLayers.Layer.WMS('Zoning', "/ga_resources/wms/", {

styles: "styles/new-style",
layers: "catalog/states/nc/counties/wake/zoning",
transparent: true
});

var map = new OpenLayers.Map({ div:'map', projection: new OpenLayers.Projection("EPSG:900913")});

var layers = [
new OpenLayers.Layer.Google(
"Google Physical",
{type: google.maps.MapTypeId.TERRAIN}
),
new OpenLayers.Layer.Google(
"Google Streets", // the default
{numZoomLevels: 20}
),
new OpenLayers.Layer.Google(
"Google Hybrid",
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
),
new OpenLayers.Layer.Google(
"Google Satellite",
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
),
wms
];

map.addLayers(layers);
//map.addLayers([wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToExtent(bounds);

});

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users




--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

Andreas Hocevar-2
To fix the other issue, remove any maxResolution, maxExtent and units setting form the map configuration. Only make sure that projection is set to 'EPSG:3857' or 'EPSG:900913'. Then everything should be fine.

Andreas.


On Tue, Jun 18, 2013 at 4:34 PM, Jeff Heard <[hidden email]> wrote:
Andreas, thanks for that, will do.  That doesn't fix the other issue, though, which is that zooming in and out causes the layers to "drift" physically.  An object that is on the west side of the street at one zoom level will overlap the street at the next zoom level in or out, and so forth.  The rendering only appears to be accurate at the initial zoom level.  I haven't tested this extensively for WMS layers, but the problem is consistent with vector layers.

This is a recent change - I've been using OpenLayers for three years now, and I saw this problem back in 2.11 for a time and the fix was to add a maxExtent to the map.  That fix no longer works now, and I'm at a loss as to what to fix.  


On Tue, Jun 18, 2013 at 5:25 AM, Andreas Hocevar <[hidden email]> wrote:
Google Maps is integrated using the GMaps API, and there we cannot control zoom animation. Your best bet is to turn off zoom animation for the map by configuring your map with

    zoomMethod: null

Then you can also activate the OpenLayers hack to remove the GMaps animation by turning the layer off during zooming. To do so, configure your Google layer with

    animationEnabled: false

Andreas.


On Mon, Jun 17, 2013 at 6:54 PM, Jeff Heard <[hidden email]> wrote:
I'm stuck. My code works with OSM, but I need it to work with Google as well.  The problem is simply that Google v3 and my other layers are not playing well together at all.  They don't zoom together.  

In the case of Google satellite, the layer doesn't zoom at all unless I pan the map.  In the case of the others (hybrid, terrain, roads), they zoom, but the google layer and the other layers on the map zoom up to half a second apart from each other, and the layer "drifts" between zoom levels somewhat.  

The code that reproduces this is simple and derived directly from the WMS and Google v3 examples, but they appear not to work together well:

$(function() {
var in_options = {
internalProjection: new OpenLayers.Projection('EPSG:900913'),
externalProjection: new OpenLayers.Projection("EPSG:4326")
};

var wkt = new OpenLayers.Format.WKT(in_options);
var feature = wkt.read("POLYGON ((-78.9950752916525687 35.5198238058974169, -78.9950752916525687 36.0750238562958074, -78.2565296570171398 36.0750238562958074, -78.2565296570171398 35.5198238058974169, -78.9950752916525687 35.5198238058974169))");
var bounds = feature.geometry.getBounds();

var wms = new OpenLayers.Layer.WMS('Zoning', "/ga_resources/wms/", {

styles: "styles/new-style",
layers: "catalog/states/nc/counties/wake/zoning",
transparent: true
});

var map = new OpenLayers.Map({ div:'map', projection: new OpenLayers.Projection("EPSG:900913")});

var layers = [
new OpenLayers.Layer.Google(
"Google Physical",
{type: google.maps.MapTypeId.TERRAIN}
),
new OpenLayers.Layer.Google(
"Google Streets", // the default
{numZoomLevels: 20}
),
new OpenLayers.Layer.Google(
"Google Hybrid",
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
),
new OpenLayers.Layer.Google(
"Google Satellite",
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
),
wms
];

map.addLayers(layers);
//map.addLayers([wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToExtent(bounds);

});

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users




--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users




--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

marco.borsoi
This post was updated on .
Hello,

I am facing the same issue. I follow Andrea's instructions but the wms layer and the google v3 layer don't zoom together.

It seems a problem with the map transformation, where the wms layer is transformed and the google layer not. I fixed this problem in 2.12 version overriding the pinchZoomControl.applyTransform method, but in 2.13 this method is inside the Map class...

In web browsers, we can see the transformation been applying just for the overlay during a ZoomIn or ZoomOut, but that's ok because the effect is quick.

The problem becomes critical when we use a smartphone or a tablet, because when we perform a PinchZoom, only the overlay is transformed.

It's hard to explain in words, even in images because the problem occurs during the animation process, but I expect you can figure it out throught these screenshots:

Before start the pinch zoom:
Before start the pinch zoom

During the pinch zoom:
During the pinch zoom

I also tested for OSM and Bing and everything works perfectly.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

marco.borsoi
Hello,

Here is how I "solved" the problem:

1. I created a new pinchZoom control to not apply the transformation to the other layers and avoid the strange effect. I just commented the line: this.map.applyTransform(dx, dy, scale); inside the PinchMove method.
2. I extended the Navigation control to modify the draw method to recognize the custom pinchZoom instead the default.
3. Remove all the controls before initialize the map and add the custom control.

-----------------------------------------
(!) IMPORTANT: I am new to OpenLayers and I really don't know if this is the best solution, but the fact is that this solved my problem.
-----------------------------------------

-----------------------------------------
(!) IMPORTANT: I add this custom control only if the map contains a GoogleMaps layer.
-----------------------------------------

The javascripts:
1. PinchZoomControl.js

/**
 * Class: YourApp.Control.PinchZoom
 *
 * Inherits:
 *  - <OpenLayers.Control>
 */
YourApp.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {

    /**
     * Property: type
     * {OpenLayers.Control.TYPES}
     */
    type: OpenLayers.Control.TYPE_TOOL,

    /**
     * Property: pinchOrigin
     * {Object} Cached object representing the pinch start (in pixels).
     */
    pinchOrigin: null,    
   
    /**
     * Property: currentCenter
     * {Object} Cached object representing the latest pinch center (in pixels).
     */
    currentCenter: null,    

    /**
     * APIProperty: autoActivate
     * {Boolean} Activate the control when it is added to a map.  Default is
     *     true.
     */
    autoActivate: true,

    /**
     * APIProperty: preserveCenter
     * {Boolean} Set this to true if you don't want the map center to change
     *     while pinching. For example you may want to set preserveCenter to
     *     true when the user location is being watched and you want to preserve
     *     the user location at the center of the map even if he zooms in or
     *     out using pinch. This property's value can be changed any time on an
     *     existing instance. Default is false.
     */
    preserveCenter: false,
   
    /**
     * APIProperty: handlerOptions
     * {Object} Used to set non-default properties on the pinch handler
     */

    /**
     * Constructor: OpenLayers.Control.PinchZoom
     * Create a control for zooming with pinch gestures.  This works on devices
     *     with multi-touch support.
     *
     * Parameters:
     * options - {Object} An optional object whose properties will be set on
     *                    the control
     */
    initialize: function(options) {
        OpenLayers.Control.prototype.initialize.apply(this, arguments);
        this.handler = new OpenLayers.Handler.Pinch(this, {
            start: this.pinchStart,
            move: this.pinchMove,
            done: this.pinchDone
        }, this.handlerOptions);
    },
   
    /**
     * Method: pinchStart
     *
     * Parameters:
     * evt - {Event}
     * pinchData - {Object} pinch data object related to the current touchmove
     *     of the pinch gesture. This give us the current scale of the pinch.
     */
    pinchStart: function(evt, pinchData) {
        var xy = (this.preserveCenter) ?
            this.map.getPixelFromLonLat(this.map.getCenter()) : evt.xy;
        this.pinchOrigin = xy;
        this.currentCenter = xy;
    },
   
    /**
     * Method: pinchMove
     *
     * Parameters:
     * evt - {Event}
     * pinchData - {Object} pinch data object related to the current touchmove
     *     of the pinch gesture. This give us the current scale of the pinch.
     */
    pinchMove: function(evt, pinchData) {
        var scale = pinchData.scale;
        var containerOrigin = this.map.layerContainerOriginPx;
        var pinchOrigin = this.pinchOrigin;
        var current = (this.preserveCenter) ?
            this.map.getPixelFromLonLat(this.map.getCenter()) : evt.xy;

        var dx = Math.round((containerOrigin.x + current.x - pinchOrigin.x) + (scale - 1) * (containerOrigin.x - pinchOrigin.x));
        var dy = Math.round((containerOrigin.y + current.y - pinchOrigin.y) + (scale - 1) * (containerOrigin.y - pinchOrigin.y));

        /*
         * Remove the transformation
         */
        //this.map.applyTransform(dx, dy, scale);


        this.currentCenter = current;
    },

    /**
     * Method: pinchDone
     *
     * Parameters:
     * evt - {Event}
     * start - {Object} pinch data object related to the touchstart event that
     *     started the pinch gesture.
     * last - {Object} pinch data object related to the last touchmove event
     *     of the pinch gesture. This give us the final scale of the pinch.
     */
    pinchDone: function(evt, start, last) {
        this.map.applyTransform();
        var zoom = this.map.getZoomForResolution(this.map.getResolution() / last.scale, true);
        if (zoom !== this.map.getZoom() || !this.currentCenter.equals(this.pinchOrigin)) {
            var resolution = this.map.getResolutionForZoom(zoom);

            var location = this.map.getLonLatFromPixel(this.pinchOrigin);
            var zoomPixel = this.currentCenter;        
            var size = this.map.getSize();

            location.lon += resolution * ((size.w / 2) - zoomPixel.x);
            location.lat -= resolution * ((size.h / 2) - zoomPixel.y);

            // Force a reflow before calling setCenter. This is to work
            // around an issue occuring in iOS.
            //
            // See https://github.com/openlayers/openlayers/pull/351.
            //
            // Without a reflow setting the layer container div's top left
            // style properties to "0px" - as done in Map.moveTo when zoom
            // is changed - won't actually correctly reposition the layer
            // container div.
            //
            // Also, we need to use a statement that the Google Closure
            // compiler won't optimize away.
            this.map.div.clientWidth = this.map.div.clientWidth;

            this.map.setCenter(location, zoom);
        }
    },

    CLASS_NAME: "YourApp.Control.PinchZoom"

});

2. Extended Navigation control and modify the draw method:
var customNavigationControl = new OpenLayers.Control.Navigation();
      OpenLayers.Util.extend(customNavigationControl, {
        draw: function() {
          if (this.handleRightClicks) {
              this.map.viewPortDiv.oncontextmenu = OpenLayers.Function.False;
          }
 
          var clickCallbacks = {
              'click': this.defaultClick,
              'dblclick': this.defaultDblClick,
              'dblrightclick': this.defaultDblRightClick
          };
          var clickOptions = {
              'double': true,
              'stopDouble': true
          };
          this.handlers.click = new OpenLayers.Handler.Click(
              this, clickCallbacks, clickOptions
          );
          this.dragPan = new OpenLayers.Control.DragPan(
              OpenLayers.Util.extend({
                  map: this.map,
                  documentDrag: this.documentDrag
              }, this.dragPanOptions)
          );
          this.zoomBox = new OpenLayers.Control.ZoomBox(
                      {map: this.map, keyMask: this.zoomBoxKeyMask});
          this.dragPan.draw();
          this.zoomBox.draw();
          var wheelOptions = this.map.fractionalZoom ? {} : {
              cumulative: false,
              interval: 50,
              maxDelta: 6
          };
          this.handlers.wheel = new OpenLayers.Handler.MouseWheel(
              this, {up : this.wheelUp, down: this.wheelDown},
              OpenLayers.Util.extend(wheelOptions, this.mouseWheelOptions)
          );
          if (OpenLayers.Control.PinchZoom) {
              /*
               * Change the default OpenLayers.Control.PinchZoom by your custom control.
               */
              this.pinchZoom = new YourApp.Control.PinchZoom(
                  OpenLayers.Util.extend(
                      {map: this.map}, this.pinchZoomOptions));
          }
        }
      });

3. Add the control to your map:

map.addControl(customNavigationControl);

Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

eflow
I'm having the same issue. I have a Google basemap and when I zoom and pan the layers do not pan with the Google basemap. If you wait, eventually the layers will reload but this comes with a severe hit to the user experience. Like Andreas said, the functionality works fine with non-Google basemaps. I first noticed this when I tried to upgrade to 2.13, it has worked stellarly in the versions prior to 2.13. I may use Marco's suggestion, but wanted to check to see if this issue will be addressed by the OL team first.
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

Andreas Hocevar-2
We advise people to turn animated zooming off for both Google and the other layers when working with Google base layers. It is unlikely that any of the OpenLayers core developers is going to fix this in their spare time. Having said that, a code contribution would be just as welcome as contracting one of the companies that support OpenLayers to improve animated Google zooming.

Andreas.


On Wed, Aug 7, 2013 at 1:50 PM, eflow <[hidden email]> wrote:
I'm having the same issue. I have a Google basemap and when I zoom and pan
the layers do not pan with the Google basemap. If you wait, eventually the
layers will reload but this comes with a severe hit to the user experience.
Like Andreas said, the functionality works fine with non-Google basemaps. I
first noticed this when I tried to upgrade to 2.13, it has worked stellarly
in the versions prior to 2.13. I may use Marco's suggestion, but wanted to
check to see if this issue will be addressed by the OL team first.



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/HELP-OL-2-13-Google-v3-and-other-layers-not-zooming-together-tp5060658p5071283.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

eflow
Andreas,

When you turn the animated zooming off, like you suggested in reply #2 to this thread. It causes a flicker (blank white screen for ~300ms) on the map when you zoom in and out, and doesn't fix the layer not zooming together problem either. I was hoping there was a minor change from 2.12 to 2.13+ that could remedy this behavior, though it may be more complicated than that.
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

Andreas Hocevar-2
What did you do to turn off zoom animation? On the map, you should use the following option:

    zoomMethod: null

And on the Google layer, you should use

    animationEnabled: false

Andreas.


On Wed, Aug 7, 2013 at 2:13 PM, eflow <[hidden email]> wrote:
Andreas,

When you turn the animated zooming off, like you suggested in reply #2 to
this thread. It causes a flicker (blank white screen for ~300ms) on the map
when you zoom in and out, and doesn't fix the layer not zooming together
problem either. I was hoping there was a minor change from 2.12 to 2.13+
that could remedy this behavior, though it may be more complicated than
that.



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/HELP-OL-2-13-Google-v3-and-other-layers-not-zooming-together-tp5060658p5071287.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

eflow
I use those like this:

var map = new OpenLayers.Map('map', {
      controls : [new OpenLayers.Control.Navigation( {
             zoomMethod : null
      }), graticuleCtl1],
      projection : new OpenLayers.Projection("EPSG:900913"),
      displayProjection : new OpenLayers.Projection("EPSG:4326"),
      numZoomLevels : 20
});

var googleTerrain = new OpenLayers.Layer.Google("Terrain Map",
      {
        type : google.maps.MapTypeId.TERRAIN,
        'sphericalMercator' : true,
        animationEnabled: false
      });

Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

Andreas Hocevar-2
Ok, faster to create a pull request that brings Google animation in sync with OpenLayers animation than to explain that the zoomMethod option belongs to the map and not to the Navigation control. See https://github.com/openlayers/openlayers/pull/1074.

Andreas.


On Wed, Aug 7, 2013 at 2:30 PM, eflow <[hidden email]> wrote:
I use those like this:

var map = new OpenLayers.Map('map', {
      controls : [new OpenLayers.Control.Navigation( {
             zoomMethod : null
      }), graticuleCtl1],
      projection : new OpenLayers.Projection("EPSG:900913"),
      displayProjection : new OpenLayers.Projection("EPSG:4326"),
      numZoomLevels : 20
});

var googleTerrain = new OpenLayers.Layer.Google("Terrain Map",
      {
        type : google.maps.MapTypeId.TERRAIN,
        'sphericalMercator' : true,
        animationEnabled: false
      });





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/HELP-OL-2-13-Google-v3-and-other-layers-not-zooming-together-tp5060658p5071290.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

marco.borsoi
Hello,

I tried the zoomMethod option (in the map, how it must be) before my approach of overwrite the PinchZoomControl, but it didin't change the behaviour.

As I said before, I'm not a OpenLayers expert... so I don't know if it was the best solution, the fact is that it worked for me.

Thank you for pulling the request.
Reply | Threaded
Open this post in threaded view
|

Re: HELP! OL 2.13: Google v3 and other layers not zooming "together"

Andreas Hocevar-2
It is worth noting that my pull request won't help with pinch zooming, because when a pinch is started the final zoom and center are unknown. But for all other zoom interactions it will definitely improve things.

Andreas.


On Wed, Aug 7, 2013 at 4:08 PM, marco.borsoi <[hidden email]> wrote:
Hello,

I tried the zoomMethod option (in the map, how it must be) before my
approach of overwrite the PinchZoomControl, but it didin't change the
behaviour.

As I said before, I'm not a OpenLayers expert... so I don't know if it was
the best solution, the fact is that it worked for me.

Thank you for pulling the request.



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/HELP-OL-2-13-Google-v3-and-other-layers-not-zooming-together-tp5060658p5071308.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users