sydneyausguy


How come when i plot a polygon on the map using the VEShape class in version five the colors arn't coming out correctly. For example when i use these colors R=14,G=28,B=79 it looks red, but it should be blue





Re: Problem when plotting polygon with certain color values. eg R=14,G=28,B=79

Derek Chan


From what I can tell so far is that it seems like a VEColors aren't directly translating to the normal RGB value. For example, R=13 G=28 B=0 gives you red on a VEMap but it should be dark green (I used http://www.perlscriptsjavascripts.com/js/cp_outer.html to test).

According to color picker for IE Toolbar the result for R=14 G=28 B=79 became R=235 G=134 B=155. Even more odd is R=1 G=1 B=0 the resulting shape on the map became R=131 G=128 B=115.







Re: Problem when plotting polygon with certain color values. eg R=14,G=28,B=79

sydneyausguy

Ok good, at least i'm not the only one finding a problem with it, anyone else







Re: Problem when plotting polygon with certain color values. eg R=14,G=28,B=79

sydneyausguy

Does anyone have an answer






Re: Problem when plotting polygon with certain color values. eg R=14,G=28,B=79

SoulSolutions

It is defn a bug, I can confirm it. The colour is not being set properly at all.

here is an example, the two alert mesages should match and they don't!

Code Snippet

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx v=5"></script>
<script type="text/javascript">
var map = null;

function GetMap()
{
map = new VEMap('myMap');
map.onLoadMap = onloaded;
map.LoadMap();
}

function onloaded() {

///initialisation
var points = new Array(new VELatLong(34.0422941083708,-118.25608491897584),
new VELatLong(34.04437438430468,-118.25921773910522),
new VELatLong(34.045850104667764,-118.25793027877809),
new VELatLong(34.04729024074364,-118.26011896133424),
new VELatLong(34.050188218219056,-118.25747966766359),
new VELatLong(34.0487481313635,-118.25529098510745),
new VELatLong(34.050205996916276,-118.25387477874757),
new VELatLong(34.04798363087166,-118.25052738189698),
new VELatLong(34.0422941083708,-118.25608491897584));
///Method
var shape = new VEShape(VEShapeType.Polygon, points)
var testcolor = new VEColor(14,28,79,1.0);
shape.SetFillColor(testcolor);
shape.SetLineColor(new VEColor(1,1,0,1.0));
shape.SetLineWidth(4);
map.AddShape(shape);
//setmapview
map.SetMapView(points);
alert(testcolor.R);
alert(shape.GetFillColor().R);

}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
</body>
</html>

John.