jquery - Google map 多边形渲染不正确

标签 jquery html google-maps google-maps-api-3 maps

我正在尝试使用 2 个纬度和经度之间的测地线点在谷歌地图中绘制一个半圆。

我找到了一个完全有我需要的地方:http://maps.forum.nu/temp/gm_bearing.html

It was using the API V2 and I need the V3.

所以我转换了它。

我遇到的问题是半圆没有正确绘制,我不明白为什么。

这就是绘制半圆时发生的情况。 enter image description here

但是当我缩小或缩小半圆时,它看起来不错。 enter image description here

我已在 jsfiddle 中重现了该问题。

http://jsfiddle.net/Morlock0821/4dRB2/1/

任何帮助将不胜感激。

谢谢。

最佳答案

删除drawCircle函数中的这些行:

var basePoints = calculateGeodesicPoints(circlePoints[circlePoints.length - 1], circlePoints[0]);
while (basePoints.length) {
  circlePoints.push(basePoints.shift());
}

enter image description here http://googlemaps.googlermania.com/google_maps_api_v3/en/draw-semi-circle.html

关于jquery - Google map 多边形渲染不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13993938/

相关文章:

jquery - Bootstrap 轮播控件在单击后保持可见(应该获得不透明度 0)

jQuery equal.Heights 插件 - "$.browser.msie is null or not an object"?

javascript - jQuery ajax 不会加载代码

php - 添加许多标记会破坏我的谷歌地图 - 我该怎么做?

javascript - 如何使用jquery读取url中的单词?

html - 编写带有垂直标题的 HTML 表格的最常见方式?

html - 汉堡应该在列表中吗?

php - 在java脚本中解析HTML标签的最佳方法

node.js - 使用jade在node.js中渲染html+js页面时,将html作为渲染的文本而不是html

c# - Visual Studio Visual Studio MVC asp.NET 谷歌地图