<font>Hi Donald,</font><div><font><br></font></div><div><font>Thanks for such a thorough reply.</font></div><div><font><br></font></div><div><font>I am not labeling the features, I am just using a external graphics.</font></div>
<div><font>As said before, if I dont, and use only the default style, then it renders fine.</font></div><div><font>I dont know if the external graphics has the same behaviour you mention with labels. </font></div><div><font>Is this so ?</font></div>
<div><font><br></font></div><div><font>Best regards, and again, thanks for your explanation.</font></div><div><font><br></font></div><div><font><br></font></div><div><font>Ricardo</font></div><div><font><br></font><br><div class="gmail_quote">
2012/4/26 Donald Kerr <span dir="ltr">&lt;<a href="mailto:donald.kerr@dkerr.co.uk" target="_blank">donald.kerr@dkerr.co.uk</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Having done a good bit of research into labeling in Internet Explorer,<br>
principly with trying to get label outlines working, I can confirm that<br>
there are quite significant differences between the VML rendered in Internet<br>
Explorer when compared to Canvas or SVG in both Chrome and Firefox;<br>
certainly more than one pixel. I&#39;m assuming that the issues you have are<br>
related to VML and Internet Explorer and are therefore similar to the issues<br>
I have experienced.<br>
<br>
An example that allows various label alignments is available here:<br>
<a href="https://github.com/openlayers/openlayers/issues/366#issuecomment-4824401" target="_blank">https://github.com/openlayers/openlayers/issues/366#issuecomment-4824401</a><br>
<br>
By changing the querystring, different renderers can be tested in various<br>
browsers showing the position differences.<br>
<br>
VML in Internet Explorer is not only different in terms of label positioning<br>
(not that critical for me), but it&#39;s so slow that renderening any more than<br>
a few tens of features can result in a map page becoming quite unusable from<br>
a user experience point of view.<br>
<br>
I have to admit that I have not tried IE9 and its SVG engine though I have<br>
spoken to people who say that it is also quite slow. As for positioning, it<br>
has to be better than IE8 and VML.<br>
<br>
Microsoft will support IE8 and XP up to 2020 which means that there will be<br>
no rush for corporations to change to IE9 which cannot be installed in XP.<br>
Their VML flavour is deprecated and there will be no further development.<br>
This leaves me, and others, with serious problems when developing vector<br>
layers and labeling.<br>
<br>
If you are in a position to install and use Google Chrome Frame (GCF), this<br>
effectively takes over the rendering of the page and has a fast javascript<br>
engine with rendering in SVG. I have some very good results using this<br>
within an internal intranet where there is control over the user&#39;s browser.<br>
If you&#39;re developing for the wider community the you&#39;ll simply have to<br>
compromise and ensure that your code makes adjustments based on which<br>
renderer is being used in the various browsers. I certainly cannot find<br>
another way around it.<br>
<br>
I hope this helps.<br>
<br>
Regards,<br>
<br>
Donald<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:openlayers-users-bounces@lists.osgeo.org">openlayers-users-bounces@lists.osgeo.org</a><br>
[mailto:<a href="mailto:openlayers-users-bounces@lists.osgeo.org">openlayers-users-bounces@lists.osgeo.org</a>] On Behalf Of Andreas<br>
Hocevar<br>
Sent: 26 April 2012 17:36<br>
To: Ricardo Bayley<br>
Cc: <a href="mailto:openlayers-users@lists.osgeo.org">openlayers-users@lists.osgeo.org</a><br>
Subject: Re: [OpenLayers-Users] Re: OpenLayers.Layer.Vector shifted in<br>
IE9compatibility mode<br>
<br>
<br>
Is the shift about 1 pixel or more?<br>
<br>
Andreas.<br>
<br>
On Thu, Apr 26, 2012 at 10:35 AM, Ricardo Bayley &lt;<a href="mailto:ricardo.bayley@gmail.com">ricardo.bayley@gmail.com</a>&gt;<br>
wrote:<br>
&gt; Ok, but it also happens with IE6. Yet to try IE7 and 8.<br>
&gt;<br>
&gt;<br>
&gt; 2012/4/25 Andreas Hocevar &lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Probably not the answer you want to hear, but don&#39;t use compatibility<br>
&gt;&gt; mode. In standards mode, everything will work fine using the SVG<br>
&gt;&gt; renderer.<br>
&gt;&gt;<br>
&gt;&gt; Andreas.<br>
&gt;&gt;<br>
&gt;&gt; On Apr 25, 2012 1:07 PM, &quot;Ricardo Bayley&quot; &lt;<a href="mailto:ricardo.bayley@gmail.com">ricardo.bayley@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I checked if styling has anything to do with it.<br>
&gt;&gt;&gt; If I dont set any styling, leave default style, then features get<br>
&gt;&gt;&gt; rendered properly.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; this is the styl I use<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; var style = function(){<br>
&gt;&gt;&gt; var defaultStyle = new OpenLayers.Style({<br>
&gt;&gt;&gt; cursor:&quot;pointer&quot;,<br>
&gt;&gt;&gt; graphicHeight: &quot;14&quot; ,<br>
&gt;&gt;&gt; graphicWidth : &quot;14&quot;,<br>
&gt;&gt;&gt;         externalGraphic: &quot;imgs/panoramio-marker.png&quot;,<br>
&gt;&gt;&gt;         graphicZIndex: 999<br>
&gt;&gt;&gt; }),<br>
&gt;&gt;&gt; selectStyle = new OpenLayers.Style({<br>
&gt;&gt;&gt; graphicZIndex: 1001,<br>
&gt;&gt;&gt; graphicHeight: &quot;22&quot;,<br>
&gt;&gt;&gt; graphicWidth : &quot;22&quot;<br>
&gt;&gt;&gt; }),<br>
&gt;&gt;&gt; myStyle = new OpenLayers.StyleMap({<br>
&gt;&gt;&gt; &#39;default&#39;: defaultStyle,<br>
&gt;&gt;&gt; &#39;select&#39;: selectStyle<br>
&gt;&gt;&gt; });<br>
&gt;&gt;&gt;    return myStyle;<br>
&gt;&gt;&gt; };<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; app.panoramio.layer.styleMap = style();<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; FYI:  panoramio-marker.png is a 18px X 18px png file.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Any ideas ?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ricardo<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2012/4/25 Ricardo Bayley &lt;<a href="mailto:ricardo.bayley@gmail.com">ricardo.bayley@gmail.com</a>&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hi everyone,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I am trying to load Panoramios pictures. It works great on every<br>
&gt;&gt;&gt;&gt; browser but in IE6, 7, 8 and IE9 compatibility mode features are<br>
&gt;&gt;&gt;&gt; not place properly. Location is shifted. If I select any feature<br>
&gt;&gt;&gt;&gt; and show the popup, then popup is shown in the correct X,Y<br>
&gt;&gt;&gt;&gt; location.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; This is the code I user to load panoramios json to the<br>
&gt;&gt;&gt;&gt; OpenLayers.Layer.Vector class<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; var lyr = app.panoramio.layer, photo, feature, GeoJSON =<br>
&gt;&gt;&gt;&gt; {&quot;type&quot;:&quot;FeatureCollection&quot;,&quot;total&quot;:data.photos.length,&quot;features&quot;:[<br>
&gt;&gt;&gt;&gt; ]};<br>
&gt;&gt;&gt;&gt; for(i=0; i &lt; data.photos.length; i++){<br>
&gt;&gt;&gt;&gt; photo = data.photos[i];<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; if(lyr.getFeaturesByAttribute(&quot;photo_id&quot;,photo.photo_id).length===0<br>
&gt;&gt;&gt;&gt; ){<br>
&gt;&gt;&gt;&gt; feature =<br>
&gt;&gt;&gt;&gt;<br>
{&quot;type&quot;:&quot;Feature&quot;,&quot;geometry&quot;:{&quot;type&quot;:&quot;Point&quot;,&quot;coordinates&quot;:[photo.longitude,<br>
&gt;&gt;&gt;&gt; photo.latitude]},&quot;properties&quot;:photo};<br>
&gt;&gt;&gt;&gt; GeoJSON.features.push(feature);<br>
&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt; };<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; // Reproject<br>
&gt;&gt;&gt;&gt; var format = new OpenLayers.Format.GeoJSON({<br>
&gt;&gt;&gt;&gt;        &#39;internalProjection&#39;: new<br>
&gt;&gt;&gt;&gt; OpenLayers.Projection(&#39;EPSG:900913&#39;),<br>
&gt;&gt;&gt;&gt;        &#39;externalProjection&#39;: new OpenLayers.Projection(&#39;EPSG:4326&#39;)<br>
&gt;&gt;&gt;&gt; }),<br>
&gt;&gt;&gt;&gt; f = format.read(GeoJSON);<br>
&gt;&gt;&gt;&gt; lyr.addFeatures(f);<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Any ideas why is this happening ? Is there a workaround ? What I<br>
&gt;&gt;&gt;&gt; dont understand is I have other GeoJSON vector layers which load<br>
&gt;&gt;&gt;&gt; correctly in every browser. Could this have anything to do with<br>
&gt;&gt;&gt;&gt; styling ?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; best regards,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Ricardo<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; Users mailing list<br>
&gt;&gt;&gt; <a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
&gt;&gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
&gt;&gt;&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br>
</div></div></blockquote></div><br></div>