Google Maps Polygon Incorrectly Rendered

2019-07-23 08:02发布

I am trying to draw a semi-circle in google maps using Geodesics Points between 2 latitude and longitudes.

I found a place that had exactly what I needed: http://maps.forum.nu/temp/gm_bearing.html

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

So I converted it.

The problem im having is that the semi-circle isnt being drawn correctly and i cant figure out why.

This is what happens when the semi-circle is drawn. enter image description here

But when I zoom out or I make the semi-circle smaller it looks fine. enter image description here

I have reproduced the issue in jsfiddle.

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

Any help would be greatly appreciated.

Thanks.

1条回答
疯言疯语
2楼-- · 2019-07-23 08:46

Remove these line in the drawCircle function:

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

查看更多
登录 后发表回答