Ticket #819 (closed bug: duplicate)

Opened 6 years ago

Last modified 6 years ago

Linestring draws filled in IE

Reported by: euzuro Owned by: crschmidt
Priority: minor Milestone: 2.6 Release
Component: Renderer.VML Version: 2.4
Keywords: Cc:
State: Review

Description

As reported by Benoit M to the user's list:

I'm experiencing a strange behavior with OpenLayers' Vector layer
based upon OpenLayers Feature. Dunno if I'm any understandable but
anyway, here is what I do:

 var points = [];
 points.push(new OpenLayers.Geometry.Point(1, 2));
 // ...
 var target = new OpenLayers.Layer.Vector("My layer");
 map.addLayer(target);
 target.addFeatures([new OpenLayers.Feature.Vector(
          new OpenLayers.Geometry.LineString(points))]);

And I end up with a nice line in Firefox and IE7 but with a
white-filled polygon in IE6 [1]. Strangely, the white-fill
disappears once I zoom in [2] and does *not*
reappear when I zoom out.

[1] http://88.191.48.4/feature_1.jpeg
[2] http://88.191.48.4/feature_2.jpeg

Attachments

vml_fill.patch Download (1.6 KB) - added by bphilippot 6 years ago.

Change History

  Changed 6 years ago by euzuro

from cr5:

when I looked into it, I found that
the same VML ended up behaving differently when the page first loaded
than from later, and I never figured out why.

  Changed 6 years ago by euzuro

more from benoit:

For people looking for a workaround, I use the following code:

 window.setTimeout(function() {
     myLayer.setVisibility(false);
     myLayer.setVisibility(true);
   }, 1000);

  Changed 6 years ago by crschmidt

  • summary changed from Linestring behavior in IE6 to Linestring draws filled in IE

  Changed 6 years ago by crschmidt

  • milestone changed from 2.5 Release to 2.6 Release

  Changed 6 years ago by crschmidt

  • status changed from new to closed
  • resolution set to wontfix

It appears that VML implements lines as filled polys, with the fill being equivilant to the background color of the poly at the time it was drawn. (this is 'fake' transparency.) Because the background color is white when the feature is drawn, it stays white even after the image loads in.

This happens in other VML demos on the web too, so I'm willing to call this a "wontfix", unless others have better ideas.

  Changed 6 years ago by bphilippot

  • status changed from closed to reopened
  • resolution wontfix deleted
  • component changed from Layer.Vector to Renderer.VML

This patch corrects the bug replacing in VML.js :
- fillcolor:none with filled="false" if options.isFilled is false
- strokecolor:none with stroked="false" if options.isStroked is false

Changed 6 years ago by bphilippot

follow-up: ↓ 8   Changed 6 years ago by pgiraud

  • keywords review added

in reply to: ↑ 7   Changed 6 years ago by elemoine

Replying to pgiraud:

I'm in favour of this patch as long as it doesn't break things on IE 7.

Also, I was going to suggest to write some test for this bug, when I realized there is currently no test for the SVG and VML renderers. It'd probably be worse implementing some. FWIW, Layer/test_Vector.js already has some SVG/VML tests that one may want to look at beforehands.

  Changed 6 years ago by tschaub

  • status changed from reopened to closed
  • resolution set to duplicate

I'm incorporating this in to the patch for #1042, as the problem is highlighted when that issue is addressed.

Note: See TracTickets for help on using tickets.