[OpenLayers-Users] Small shift between google and wms

Simo D simone.dalmasso at gmail.com
Mon May 25 05:55:18 EDT 2009


Hi, I tried to use both solutions. Adding a :
map.events.register("changelayer", this, function(evt) {
		  map.updateSize();
		});
makes no changes and nor using the most recent trunk of mapfish passing a
'gx_mappanel' in the xtype field of the ext layout.
I also tried to insert a button in the page having an onclik listener which
triggers the updateSize but I get no changes nor errors.

But the important thing is that if I use the GeoRSS class instead of GML for
the markers the issue disappears and all works fine.
Can it be a conflict between the GML class and ext? Sounds strange.


Eric Lemoine-2-2 wrote:
> 
> 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
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Small-shift-between-google-and-wms-tp2957923p2968843.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list