回答
的問題,當在所述路徑的連續的2個點的經度之間的差出現> = 180
第一2點的經度爲-97和93,所以這是在這種情況下,問題(差爲190)
我可以迄今建議的唯一事情是分裂路徑的該部分:
new google.maps.LatLng(81, -97),
//additional point
new google.maps.LatLng(80.5, -12),
new google.maps.LatLng(80, 93),
new google.maps.LatLng(56, 78),
new google.maps.LatLng(60, -94)
有一次,我也需要它,幸運的是離散事件已提供有研究,所以我共享隨着你
//Taking Example of Bermuda Triangle
function initialize() {
var mapOptions = {
zoom: 5,
center: new google.maps.LatLng(24.886436490787712, -70.2685546875),
mapTypeId: google.maps.MapTypeId.TERRAIN
};
var bermudaTriangle;
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
// Define the LatLng coordinates for the polygon's path.
var triangleCoords = [
new google.maps.LatLng(25.774252, -80.190262),
new google.maps.LatLng(18.466465, -66.118292),
new google.maps.LatLng(32.321384, -64.75737),
new google.maps.LatLng(25.774252, -80.190262)
];
// Construct the polygon.
bermudaTriangle = new google.maps.Polygon({
paths: triangleCoords,
strokeColor: '#FF0000',
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: '#FF0000',
fillOpacity: 0.35
});
bermudaTriangle.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
瞭解更多參考
https://developers.google.com/maps/documentation/javascript/examples/polygon-simple
這對於座標'(81,-97)(80,93)(56,78)(60,94)' –
爲什麼就像例子引用改變方法Latlng的位置來改變多邊形路徑的座標 –
用這些座標試着看看結果。 –
- 1. Google Maps API V3 - 多邊形SMOOTHED邊緣
- 2. 多邊形中心Google Maps JavaScript API v3
- 3. Google maps API 3,關閉多邊形(與「Google地圖多邊形」相同)
- 4. CodeIgniter + Google Maps API V3 +關閉InfoWindow()
- 5. InfoWindow不想關閉Google Maps Api V3
- 6. Google Maps API V3關閉信息框
- 7. Google Maps V3多邊形繪圖
- 8. Google Maps V3:多邊形頂點
- 9. Google Maps API V3 - 通過採用InfoBox標籤Fusion Tables多邊形
- 10. Google Maps V3 API如何管理多邊形的Z-Index?
- 11. 從Google Maps JavaScript API V2遷移到V3,編碼的多邊形?
- 12. Google Maps API v3&融合圖層:多邊形不透明
- 13. Google Maps API 3 Javascript添加多邊形
- 14. 使用Google Maps API合併多邊形
- 15. 帶有多邊形的Google Maps API
- 16. CartoDb + Google Maps多邊形
- 17. Google Map API V3多邊形DragEnd事件
- 18. Google Maps API多邊形與Trulia.com多邊形對比
- 19. Google Maps API v2 vs Google Maps API v3?
- 20. google-maps-api-v3 getProjection
- 21. Google Maps API V3:fromContainerPixelToLatLng
- 22. Google Maps API v3 - maxZoomService
- 23. Google Maps API v3 BrowserIsCompatible
- 24. 使用Google Maps v3拖動(移動)多邊形
- 25. Google Maps API v3:繪製幾何圖形
- 26. 如何在Google Maps v3上添加和刪除多邊形?
- 27. 從XML文件在Google Maps API V3上繪製多個多邊形
- 28. Google Maps JavaScript API v3可編輯多邊形,防止複雜多邊形(相交多義線)
- 29. Google maps v3 API標記在關閉InfoWindow時消失(InfoBubble)
- 30. Google Maps API v3 infowindow關閉事件/回調?
你能告訴我們你正在使用的多邊形座標嗎? –
您可以很容易地重現該問題,例如:http://the-di-lab.com/polygon但是,您可以: – Laurent
(81,-97)(80,93)(56,78)(60, -94) – Laurent