[OpenLayers-Users] Overlay Aligment changing on Pan

czieler carole.zieler at gmail.com
Wed Jun 25 00:39:59 EDT 2008


I wanted to post a link to a sample of this problem:
http://webgirlunleashed.com/openlayers/test/test.html

If you click and drag the map, or just pan, you'll notice that the 'car'
feature is moved a few pixels each time you drag the map or pan.

If anyone can give me any insight on what might be causing the
problem...that would be great.  I'm using Firefox 2.0, but I've checked it
on several versions as well as Firefox 3.0 and it occurs on all of them. 

czieler wrote:
> 
> Has anyone had any issues where Overlay Alignment is slightly changed when
> you pan the map?
> 
> I have a Google Hybrid map as my base layer, and I then have a WFS layer
> on top of this, as well as a Vector layer.  I'm zoomed in to level 19 (
> although this happens at other zoom levels ), and when I pan the map, my
> WFS and Vector layers seem to become slightly offset each time I pan ( so
> it becomes progressively worse ).
> 
> Edit:
> I just thought to include sample code, as I thought that would be the
> first question people would respond with:
> 
> var options = {
> 	projection: new OpenLayers.Projection("EPSG:900913"),
> 	displayProjection: new OpenLayers.Projection("EPSG:4326"),
> 	units: "m",
> 	maxResolution: 156543.0339,
> 	maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
> 					 20037508, 20037508.34)
> };
> map = new OpenLayers.Map( 'map',{controls: [new
> OpenLayers.Control.Navigation(), new OpenLayers.Control.PanZoomBar()],
> numZoomLevels:30},options);
> 
> 
> var google = new OpenLayers.Layer.Google( "Google", {"sphericalMercator":
> true});
> var google_hy = new OpenLayers.Layer.Google( "Google Hybrid" , {type:
> G_HYBRID_MAP}, {"sphericalMercator": true});
> var yahoo_hy = new OpenLayers.Layer.Yahoo( "Yahoo
> Hybrid",{type:YAHOO_MAP_HYB}, {"sphericalMercator": true});
> map.setCenter(new OpenLayers.LonLat(lat,lon), 19); // lat lon are passed
> into this function
> 
> wfs = new OpenLayers.Layer.WFS("MyWFSLayer", url, {maxfeatures: "200"},
> {extractAttributes: true, displayInLayerSwitcher:
> true,sphericalMercator:true}); // url is passed into this function
> wfs.markers = new OpenLayers.Layer.Markers(""); // if I don't put this
> here, I get a js error
> wfs.setOpacity(0.9);
> map.addLayer(wfs);
> 

-- 
View this message in context: http://www.nabble.com/Overlay-Aligment-changing-on-Pan-tp18099824p18104866.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list