Google Maps Polygon Incorrectly Rendered

耗尽温柔 提交于 2019-12-24 17:43:37

问题


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.

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

I have reproduced the issue in jsfiddle.

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

Any help would be greatly appreciated.

Thanks.


回答1:


Remove these line in the drawCircle function:

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

来源:https://stackoverflow.com/questions/13993938/google-maps-polygon-incorrectly-rendered

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!