Hello
I have two point array.
They have same values. But they are generated differently.
One of them <polyPoints> is generated by a loop as:
for (i=0; i< data.length; i++) {
polyPoints[i] = [ new GLatLng(data[i].list_gmaplat,
data[i].list_gmaplong ),];
//document.write(i,' -> ',polyPoints[i],'<br>');
}
the is by direct input as:
var points =
[
new GLatLng(41.60185025984469, 32.89375028265787),
new GLatLng(41.60126676699043, 32.89411421981953),
new GLatLng(41.600547212851545, 32.89465986006966),
new GLatLng(41.60027511551691, 32.895049203798),
new GLatLng(41.59992550266191, 32.89580164190858),
new GLatLng(41.59926467306786, 32.89673605329852),
new GLatLng(41.598739761860585, 32.89733319115517),
new GLatLng(41.598136542237555, 32.89741192483877),
new GLatLng(41.59770814676285, 32.897127420299114),
new GLatLng(41.59745499201998, 32.89694634295496),
new GLatLng(41.5974352284889, 32.89660934142698),
new GLatLng(41.597473916934064, 32.896350023398796),
new GLatLng(41.59780423728021, 32.89577912816391),
new GLatLng(41.59817361831712, 32.89536371936832),
new GLatLng(41.59856231651795, 32.894792718123426),
new GLatLng(41.59877579185913, 32.89414421769579),
new GLatLng(41.5991053059797, 32.89271773378713),
new GLatLng(41.59922173230021, 32.8923545723861),
new GLatLng(41.59922131878892, 32.891913825511004),
new GLatLng(41.60116806757117, 32.89261060898543),
new GLatLng(41.60185025984469, 32.89375028265787),
];
I compared that they have same output in:
document.write(i,' -> ',points[i],'<br>');
document.write(i,' -> ',polyPoints,'<br>');
But, the polygon created from <points> works. the polygon created from
<polyPoints> doesn't work.
var polygon = new GPolygon(polyPoints, "#f33f00", 5, 1, "#ff0000",
0.2); // OK !
alert(polygon.getArea()); // gives a value
----
var polygon = new GPolygon(polyPoints, "#f33f00", 5, 1, "#ff0000",
0.2); //
problamatic
alert(polygon.getArea()); // gives NaN
Although they have same input values , one of them doesn't work.
What might be the reason ?
kind regards
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.