Google Maps polygon is not installed correctly

I'm trying to draw a semicircle on google maps using geodesic points between two latitudes and longitudes.

I found a place that was 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.

Im problem is that the semicircle is not drawn correctly and I cannot understand why.

This is what happens when a semicircle is drawn. enter image description here

But when I zoom out or I make the semicircle smaller, it looks good. enter image description here

I reproduced the problem in jsfiddle.

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

Any help would be greatly appreciated.

Thanks.

0
source share
1 answer

Remove this 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

+2
source

Source: https://habr.com/ru/post/972836/


All Articles