【问题标题】:Google Maps Polygon Incorrectly Rendered谷歌地图多边形渲染不正确
【发布时间】:2012-12-09 06:11:32
【问题描述】:

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

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

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

所以我把它转换了。

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

这是绘制半圆时发生的情况。

但是当我缩小或缩小半圆时,它看起来很好。

我已经在 jsfiddle 中重现了这个问题。

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

任何帮助将不胜感激。

谢谢。

【问题讨论】:

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


    【解决方案1】:

    在 drawCircle 函数中删除这些行:

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

    http://googlemaps.googlermania.com/google_maps_api_v3/en/draw-semi-circle.html

    【讨论】:

    • 我不敢相信我以前没有找到这个。非常感谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-07-01
    • 1970-01-01
    • 2014-09-19
    • 2011-12-03
    • 2012-06-15
    • 1970-01-01
    相关资源
    最近更新 更多