Paolo Losi


Hi all,

We are experimenting problems with alpha setting for thick polylines.
With Firefox alpha parameter is ignored and the line is solid.
We've already seen a report on this on the forum.
Is this a known issue
Is there a plan for a fix

Thanks!
Paolo



Re: Polylines opacity with Firefox

Derek Chan


the "color" parameter when you construct a VEPolyLine takes an object of VEColor.  You can set your alpha level in the VEColor to what you need.  Try inserting this line

var x = new VEPolyline(12, new VELatLong(46.21758,-69.08529), new VEColor(255,0,0,1), 1);

Hope that helps






Re: Polylines opacity with Firefox

Paolo Losi

Derek,

thanks for yor reply.
the syntax that you are suggesting is exactly the one I'm using.
The problem is that, while with IE the alpha setting works as
expected, with FF line is solid.

Thanks again
Paolo





Re: Polylines opacity with Firefox

Derek Chan

Have you tried using the Firefox fix http://viavirtualearth.com/wiki/Firefox2.ashx

Are you using FF 1.5 or 2.0




Re: Polylines opacity with Firefox

Paolo Losi

yep. I've applied the fix. Without the fix the polyline doesn't appear
at all. And yes... the problem affects both FF 1.5 and FF 2.0

Thanks again
Paolo




Re: Polylines opacity with Firefox

Derek Chan

Seems to be a bug in firefox.  I've duplicated it using this code:

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js"></script>
<script>
var map = null;

function GetMap()
{
var ffv = 0;
var ffn = "Firefox/"
var ffp = navigator.userAgent.indexOf(ffn);
if (ffp != -1) ffv = parseFloat(navigator.userAgent.substring(ffp + ffn.length));
// If we're using Firefox 1.5 or above override the Virtual Earth drawing functions to use SVG
if (ffv >= 1.5) {
  Msn.Drawing.Graphic.CreateGraphic=function(f,b) { return new Msn.Drawing.SVGGraphic(f,b) }
}
map = new VEMap('myMap');
map.LoadMap();
}

function DrawPoly(id,points,width,color)
{
poly = new VEPolyline(id,points);
poly.SetWidth(width);
poly.SetColor(color);
map.AddPolyline(poly);
map.SetMapView(points);
}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
<INPUT id="draw" type="button"
value="Draw a Polygon" name="drawPoly"
onclick="DrawPoly(
'1',
[new VELatLong(46.21758,-69.08529),
new VELatLong(46.21531,-69.00402),
new VELatLong(46.21596,-68.82146),
new VELatLong(45.85619,-68.82360),
new VELatLong(45.82631,-68.82453),
new VELatLong(45.82633,-68.85976),
new VELatLong(45.81160,-68.85743),
new VELatLong(45.81326,-68.89499),
new VELatLong(45.83453,-68.94900),
new VELatLong(45.85566,-68.95039),
new VELatLong(45.85316,-69.07216),
new VELatLong(45.93761,-69.07287),
new VELatLong(45.93807,-69.08599),
new VELatLong(46.01658,-69.08624),
new VELatLong(46.01651,-69.06572),
new VELatLong(46.03624,-69.06471),
new VELatLong(46.03668,-69.08646),
new VELatLong(46.21758,-69.08529)],
2,
new VEColor(250,250,50,1.0)
);">
<INPUT id="drawline1" type="button"
value="Draw a thin blue line" name="drawLine"
onclick="DrawPoly(
'2',
[new VELatLong(45.01188,-111.06687),
new VELatLong(45.01534,-104.06324),
new VELatLong(41.01929,-104.06),
new VELatLong(41.003,-111.05878),
new VELatLong(45.01188,-111.06687)],
1,
new VEColor(0,0,255,1));">
<INPUT id="drawline2" type="button"
value="Draw a thick red line" name="drawLine2"
onclick="DrawPoly(
'3',
[new VELatLong(45.01188,-111.06687),
new VELatLong(45.01534,-104.06324),
new VELatLong(41.01929,-104.06),
new VELatLong(41.003,-111.05878),
new VELatLong(45.01188,-111.06687)],
7,
new VEColor(255,0,0,0.3));">
</body>
</html>

You'll notice it displays a semi transparent red line when you click the "draw a thick red line" button in IE but it come out as a thick red line in Firefox.

It seems as though Firefox has a different method of handling Opacity.  Infact, Firefox uses a different tag for opacity than IE. 

Links of interest:
http://www.dynamicdrive.com/forums/showthread.php t=16613

http://www.domedia.org/oveklykken/css-transparency.php






Re: Polylines opacity with Firefox

Paolo Losi

Derek,

thank you very much for your time.

In this case the different handling of css opacity doesn't seem
relevant.
To draw the polyline a svg polyline object is used both in FF and IE.
svg polylines have their own method (read: xml attribute) to define
opacity.

Has anyone any ideas on where's the bug

Thanks again
Paolo