var moveVessels = function() { var R = 6371000; // km for (var v = 0; v < annotations.length; v++) { var annotation = annotations[v]; if (annotation.is_moored) continue; var lat1 = annotation.latitude; var lon1 = annotation.longitude; var d = parseFloat(annotation.speedoverground) * 0.44 / R; var brng = parseFloat(annotation.orientation); var lat2 = Math.asin(Math.sin(lat1) * Math.cos(d) + Math.cos(lat1) * Math.sin(d) * Math.cos(brng)); var lon2 = lon1 + Math.atan2(Math.sin(brng) * Math.sin(d) * Math.cos(lat1), Math.cos(d) - Math.sin(lat1) * Math.sin(lat2)); Ti.API.log(lat2 + ',' + lon2); // annotation.setLatitude(lat2); annotation.setLongitude(lon2); annotation.longitude = lon2; } };On console I see changing longitudes. but the annotations are fixed.
Is it a bug?
Rainer
1 Answer
Rainer -- you have another thread about this already.
I gave you a suggestion, and you didn't even acknowledge whether you tried it. There was no need to start an entire thread, and it's a bit discourteous to just ignore the suggestions that I've taken time to write.
Your Answer
Think you can help? Login to answer this question!