Google地图多边形渲染错误 [英] Google Maps Polygon Incorrectly Rendered

查看:119
本文介绍了Google地图多边形渲染错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在2个纬度和经度之间使用Geodesics Points在Google地图上绘制一个半圆。



我找到了一个恰好满足我需要的地方:



任何帮助将不胜感激。



谢谢。

解决方案

在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

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.

解决方案

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

这篇关于Google地图多边形渲染错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆