[OpenLayers-Users] Feature.Vector images sometime get blurry

Janis Elmeris janis.elmeris at intelligentsystems.lv
Mon May 16 12:00:27 EDT 2011


Hello!

Sometimes I get blurry icons that I've added as 
OpenLayers.Feature.Vector overlays (with the "image" property). I'm not 
sure about the conditions, but I've got it a few times with FF3, but 
cannot reproduce at the moment with IE7, although I know that on another 
computer the same problem was observed also in IE.

I've discovered that when the image is blurry, the feature is rendered 
within a SVG element <g> which has a "transform" attribute containing 
"translate" to non-integer values. If I round them to integers in 
Firebug, the blur disappears. (And after I move the map a bit, the 
"translate" values change, and again to non-integer ones (with each move 
the fractional part becomes very different from the previous one), and 
the images get blurry again. In another case when the images are sharp, 
the translate properties were integer values and kept being integer 
values after each map move.)

In the SVG renderer's translate method, the x and y parameters usually 
seems to always be non-integer but almost-integer values like 
66.99999999932061 (which appears completely integer values in the 
resulting svg object in Firebug, for some reason), however after panning 
to some position, it may become also less-integer, which might be when 
the trouble might start. That's only my guess.

I would try just rounding the x and y values within the renderer's 
translate method, but I don't know how it works all together and if that 
is correct or the best way to go about it. Also, I still haven't tracked 
down what exactly is causing the blur in IE, as it would use the VML 
renderer instead.

Janis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110516/1add1757/attachment.html


More information about the Users mailing list