[OpenLayers-Users] Small shift between google and wms

Eric Lemoine eric.lemoine at camptocamp.com
Sat May 23 17:13:35 EDT 2009


On Friday, May 22, 2009, Simo D <simone.dalmasso at gmail.com> wrote:
>
> Thanks a lot for your help. I follow your suggestions and if is't fixed by
> this way I build a simpler webapp.

Christopher is right, OpenLayers may not be guilty. And I think
OpenLayers isn't guilty, the MapComponent of MapFish probably is. If
you use MapFish trunk you may want to try GeoExt's MapPanel (MapFish
trunk comes with GeoExt trunk, and the next MapFish release will come
with GeoExt 0.1, the first release of MapFish). Feel free to ask for
further assistance on the MapFish or GeoExt mailing list).

>
> Simone
>
> Christopher Schmidt-2 wrote:
>>
>> On Fri, May 22, 2009 at 08:19:49AM -0700, Simo D wrote:
>>>
>>> Yes, for sure.  http://130.192.92.159/mapfish/prove/sdi_layout.html
>>> Ithaca
>>> sdi
>>> Thanks
>>
>> That's a relatively complex example. For example, it uses MapFish, which
>> introduces a number of potential issues. From what I can see, it appears
>> that resizing the page has the effect of fixing the problem -- with that
>> in mind, you might call map.updateSize() in a layerchanged listener to
>> work around your problem. To narrow down the problem more, I'd recommend
>> you create an example that is as simple as possible: see
>> http://openlayers.org/pipermail/users/2009-May/011865.html for some tips
>> on this process.
>>
>> -- Chris
>>
>>> Christopher Schmidt-2 wrote:
>>> >
>>> > On Fri, May 22, 2009 at 08:07:03AM -0700, Simo D wrote:
>>> >>
>>> >> I'm using a trunk version of the 2.8 checked out about three days ago.
>>> >> Shall I checkout a newer version?
>>> >
>>> > No, i think any potential fix would be included in that. Do you have a
>>> > URL that people can see this at?
>>> >
>>> >>
>>> >> Christopher Schmidt-2 wrote:
>>> >> >
>>> >> > On Fri, May 22, 2009 at 07:57:02AM -0700, Simo D wrote:
>>> >> >>
>>> >> >> Hi, I created an application which retireves a WMS layer from
>>> >> geoserver
>>> >> >> (chached in epsg:900913), the layers from google and a layer from
>>> >> virtual
>>> >> >> earth plus some georss(GML+GeoRSS format). The issue is that when I
>>> >> >> switch
>>> >> >> from wms to google, there is a small shift of the map, so the
>>> georss
>>> >> are
>>> >> >> displayed in a wrong place. This shift disappears when zooming and
>>> is
>>> >> not
>>> >> >> present with virtual earth.
>>> >> >
>>> >> > Are you using OL 2.8? A fix was checked into RC2 to fix this, I
>>> >> believe.
>>> >> >
>>> >> >> All the layers have the sphericalMercator set to true. Here follows
>>> a
>>> >> >> piece
>>> >> >> of my code:
>>> >> >> var options = {
>>> >> >>                projection: new OpenLayers.Projection("EPSG:900913"),
>>> >> >>                displayProjection: new OpenLayers.Projection("EPSG:900913"),
>>> >> >>                units: "m",
>>> >> >>                maxResolution: 156543.0339/4,
>>> >> >>                maxExtent: new OpenLayers.Bounds(-20037508.34,
>>> >> >> -20037508.34,20037508.34,
>>> >> >> 20037508.34),
>>> >> >>                restrictedExtent:  new OpenLayers.Bounds(-20037508.34,
>>> >> >> -20037508.34,20037508.34, 20037508.34),
>>> >> >>                numZoomLevels: 10,
>>> >> >>                zoom: 1,
>>> >> >>                controls: []
>>> >> >>                };
>>> >> >> var world = new
>>> >> >>
>>> >>
>>> OpenLayers.Layer.WMS("WFP-SDI",geoweb,{layers:'ithaca_world',"sphericalMercator":
>>> >> >> true,format: 'image/png'});
>>> >> >>        var gmap = new OpenLayers.Layer.Google("Google
>>> >> >> Streets",{'sphericalMercator': true,minZoomLevel: 2});
>>> >> >>        var gphy = new OpenLayers.Layer.Google("Google Physical",{type:
> View this message in context: http://n2.nabble.com/Small-shift-between-google-and-wms-tp2957923p2958239.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list