Google maps 如何在谷歌地图上500米处放置两个标记

Google maps 如何在谷歌地图上500米处放置两个标记,google-maps,google-maps-api-3,google-maps-markers,Google Maps,Google Maps Api 3,Google Maps Markers,可能重复: 我想知道是否有人知道我们如何在500米的距离上放置两个标记,比如说我在伦敦放置第一个标记(50,0),在离伦敦500米的某个位置放置第二个标记(50,0)。这将如何发生。我一直在找,但找不到答案。 如有任何建议,将不胜感激 θ is the bearing (in radians, clockwise from north); d/R is the angular distance (in radians), where d is the distance travelled an

可能重复:

我想知道是否有人知道我们如何在500米的距离上放置两个标记,比如说我在伦敦放置第一个标记(50,0),在离伦敦500米的某个位置放置第二个标记(50,0)。这将如何发生。我一直在找,但找不到答案。 如有任何建议,将不胜感激

θ 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:

备选方案:


我在OpenLayers中的方法是将坐标重新投影到epsg:900913,也就是米,进行计算,然后转换回原始投影。这可以通过pro4.j库实现:

谢谢,我想创建一个45分钟的圆形路径(起点和终点位置相同),这样当我在中单击地图上的一个点时,可以从地图上的该点创建三个随机点,从a到a的距离为45分钟,例如a-b-c-d-a。当b,c,d是地图上的三个随机点。你知道怎么计算方位吗,也可以是randon说的任何东西,比如45度、90度或……所有角度加起来都应该是360度,只要把500米分成4部分,作为线段长度。
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));