[OpenLayers-Users] OpenLayers.Layer.Vector shifted in IE9 compatibility mode

Ricardo Bayley ricardo.bayley at gmail.com
Wed Apr 25 12:58:42 EDT 2012


Hi everyone,

I am trying to load Panoramios pictures. It works great on every browser
but in IE6, 7, 8 and IE9 compatibility mode features are not place properly.
Location is shifted. If I select any feature and show the popup, then popup
is shown in the correct X,Y location.

This is the code I user to load panoramios json to the
OpenLayers.Layer.Vector class

* var lyr = app.panoramio.layer, photo, feature, GeoJSON =
{"type":"FeatureCollection","total":data.photos.length,"features":[]}; *
* for(i=0; i < data.photos.length; i++){*
* photo = data.photos[i];*
*
*
* if(lyr.getFeaturesByAttribute("photo_id",photo.photo_id).length===0){*
* feature =
{"type":"Feature","geometry":{"type":"Point","coordinates":[photo.longitude,
photo.latitude]},"properties":photo};*
* GeoJSON.features.push(feature);  *
* }*
* };*
*
*
* // Reproject*
* var format = new OpenLayers.Format.GeoJSON({*
*        'internalProjection': new OpenLayers.Projection('EPSG:900913'),*
*        'externalProjection': new OpenLayers.Projection('EPSG:4326')*
* }),*
* f = format.read(GeoJSON);*
* lyr.addFeatures(f);*
*
*
Any ideas why is this happening ? Is there a workaround ?
What I dont understand is I have other GeoJSON vector layers which load
correctly in every browser.
Could this have anything to do with styling ?


best regards,


Ricardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120425/80193db3/attachment.html


More information about the Users mailing list