<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"><<a href="mailto:donald.kerr@dkerr.co.uk" target="_blank">donald.kerr@dkerr.co.uk</a>></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'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'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's browser.<br>
If you're developing for the wider community the you'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 <<a href="mailto:ricardo.bayley@gmail.com">ricardo.bayley@gmail.com</a>><br>
wrote:<br>
> Ok, but it also happens with IE6. Yet to try IE7 and 8.<br>
><br>
><br>
> 2012/4/25 Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>><br>
>><br>
>> Probably not the answer you want to hear, but don't use compatibility<br>
>> mode. In standards mode, everything will work fine using the SVG<br>
>> renderer.<br>
>><br>
>> Andreas.<br>
>><br>
>> On Apr 25, 2012 1:07 PM, "Ricardo Bayley" <<a href="mailto:ricardo.bayley@gmail.com">ricardo.bayley@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> I checked if styling has anything to do with it.<br>
>>> If I dont set any styling, leave default style, then features get<br>
>>> rendered properly.<br>
>>><br>
>>> this is the styl I use<br>
>>><br>
>>> var style = function(){<br>
>>> var defaultStyle = new OpenLayers.Style({<br>
>>> cursor:"pointer",<br>
>>> graphicHeight: "14" ,<br>
>>> graphicWidth : "14",<br>
>>> externalGraphic: "imgs/panoramio-marker.png",<br>
>>> graphicZIndex: 999<br>
>>> }),<br>
>>> selectStyle = new OpenLayers.Style({<br>
>>> graphicZIndex: 1001,<br>
>>> graphicHeight: "22",<br>
>>> graphicWidth : "22"<br>
>>> }),<br>
>>> myStyle = new OpenLayers.StyleMap({<br>
>>> 'default': defaultStyle,<br>
>>> 'select': selectStyle<br>
>>> });<br>
>>> return myStyle;<br>
>>> };<br>
>>><br>
>>> app.panoramio.layer.styleMap = style();<br>
>>><br>
>>> FYI: panoramio-marker.png is a 18px X 18px png file.<br>
>>><br>
>>><br>
>>> Any ideas ?<br>
>>><br>
>>><br>
>>> ricardo<br>
>>><br>
>>><br>
>>><br>
>>> 2012/4/25 Ricardo Bayley <<a href="mailto:ricardo.bayley@gmail.com">ricardo.bayley@gmail.com</a>><br>
>>>><br>
>>>> Hi everyone,<br>
>>>><br>
>>>> I am trying to load Panoramios pictures. It works great on every<br>
>>>> browser but in IE6, 7, 8 and IE9 compatibility mode features are<br>
>>>> not place properly. Location is shifted. If I select any feature<br>
>>>> and show the popup, then popup is shown in the correct X,Y<br>
>>>> location.<br>
>>>><br>
>>>> This is the code I user to load panoramios json to the<br>
>>>> OpenLayers.Layer.Vector class<br>
>>>><br>
>>>> var lyr = app.panoramio.layer, photo, feature, GeoJSON =<br>
>>>> {"type":"FeatureCollection","total":data.photos.length,"features":[<br>
>>>> ]};<br>
>>>> for(i=0; i < data.photos.length; i++){<br>
>>>> photo = data.photos[i];<br>
>>>><br>
>>>> if(lyr.getFeaturesByAttribute("photo_id",photo.photo_id).length===0<br>
>>>> ){<br>
>>>> feature =<br>
>>>><br>
{"type":"Feature","geometry":{"type":"Point","coordinates":[photo.longitude,<br>
>>>> photo.latitude]},"properties":photo};<br>
>>>> GeoJSON.features.push(feature);<br>
>>>> }<br>
>>>> };<br>
>>>><br>
>>>> // Reproject<br>
>>>> var format = new OpenLayers.Format.GeoJSON({<br>
>>>> 'internalProjection': new<br>
>>>> OpenLayers.Projection('EPSG:900913'),<br>
>>>> 'externalProjection': new OpenLayers.Projection('EPSG:4326')<br>
>>>> }),<br>
>>>> f = format.read(GeoJSON);<br>
>>>> lyr.addFeatures(f);<br>
>>>><br>
>>>> Any ideas why is this happening ? Is there a workaround ? What I<br>
>>>> dont understand is I have other GeoJSON vector layers which load<br>
>>>> correctly in every browser. Could this have anything to do with<br>
>>>> styling ?<br>
>>>><br>
>>>><br>
>>>> best regards,<br>
>>>><br>
>>>><br>
>>>> Ricardo<br>
>>><br>
>>><br>
>>><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>
><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>