how to put two marker at a distance of 500m in google map [duplicate]
Possible Duplicate:
how to put two marker at a distance of 500m in google map
I was wondering if anyone know how we can put two markers at a distance of 500 meter, lets say I put first marker at london(50,0) and second marker at some lo开发者_运维问答cation 500 meter away from london(50,0). how would it happen. I have been looking a lot for it but couldnt find any answer. Any suggestion would be appreciated
θ is the bearing (in radians, clockwise from north);
d/R is the angular distance (in radians), where d is the distance travelled and R is the earth’s radius
src: http://www.movable-type.co.uk/scripts/latlong.html
var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) +
Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) );
var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),
Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));
Alternative:
The way I do it in OpenLayers is reproject my coordinate to epsg:900913 which is meters, do my calculations, and then convert back to the original projection. This can be accomplished with the pro4.j library: http://trac.osgeo.org/proj/
精彩评论