Dear All;
I have a little complicated issue :
I have 2 arrays :
1-x,y Array
2-Timearray
the x,yarray is the cooridnates of the track.
the time array is the time defference between to consecutive
coordinates
for example :
[x1,y1,x2,y2,x3,y3,x4,y4]
timearray is :
[t1,t2,t3]
where t1 is the time defference of x1,y1, and x2,y2
what I am trying to do is to draw a poly line if the time is less then
100s so I am storing the coordinates in pointsarray and if the time is
greater then 100sec then I will draw the poly line and then start
storing again from the reached index the new points array to draw it
again ....
I am sorry for posting my complicated code : but kindly take a look :
function test(list1,list2) {
var latlngs=new String();
latlngs=list1;
var time=new String();
time=list2;
var points = [];
var bounds = new GLatLngBounds();
//var j=0;
for (var i = j; i < latlngs.length-2; i += 2) {
if(time[i/2]<100){
if (typeof latlngs[i + 1] == 'number' && typeof
latlngs[i] == 'number') {
points[i] = new GLatLng(latlngs[i + 1] /
1000000,
latlngs[i] / 1000000);
bounds.extend(points[i]);
}
}
else {
j=i+2;
//color="#"+genHex();
//confirm("Press"+time[i/2]+"now"+j+"it");
//alret(time);
points[i] = new GLatLng(latlngs[i + 1] / 1000000, latlngs[i] /
1000000);
bounds.extend(points[i]);
drawPolyline(points,bounds);
//bounds = new GLatLngBounds();
}
}
drawPolyline(points,bounds);
}
Kindly help me to find the right logic ...
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.