初めまして。最近GoogleMapsAPIを始めた者です。
Google Maps API V3を使って下記のようなものを作っているのですが、ポリゴンをドーナツ状に中抜きするところがうまくいきません。
IE9ではちゃんと中抜きで表示されたのですが、Chrome、FireFox6.0ではポリゴンの中にポリゴンを表示する感じになり中抜きできていま
せん。
少し調べたところwebkitを使うブラウザが関係しているらしいのですが、あまり詳しくないので対処法がよくわかりません。
なんとかしてIE以外のブラウザでも中抜きで表示できる方法はないのでしょうか?
以下htmlファイル内容
<html>
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="
http://maps.google.com/maps/
api/js?sensor=false"></script>
<script type="text/javascript">
function initialize(){
var latlng = new google.maps.LatLng(34.9828443,134.8152930);
var myOptions = {
zoom: 11,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map=new
google.maps.Map(document.getElementById("map_canvas"), myOptions);
var points = new google.maps.MVCArray();
points = [[
//内側左
new google.maps.LatLng(35.0105297,134.7804922),
new google.maps.LatLng(34.9828443,134.8152930),
new google.maps.LatLng(34.9880356,134.8415094),
new google.maps.LatLng(35.0140464,134.8298960)
],[
//内側右
new google.maps.LatLng(35.0223434,134.9409881),
new google.maps.LatLng(35.0152870,134.8930235),
new google.maps.LatLng(34.9896701,134.8879720),
new google.maps.LatLng(34.9853469,134.9377695),
new google.maps.LatLng(35.0059232,134.9603780)
],[
//外側
new google.maps.LatLng(35.0436558,134.9558949),
new google.maps.LatLng(35.0456312,134.7534714),
new google.maps.LatLng(34.9624730,134.7571150),
new google.maps.LatLng(34.9591221,134.9682897)
]];
var polyopts = {
paths: points,
strokeWeight: 3,
strokeColor: "#aa1232",
strokeOpacity: 0.6,
fillColor: "#aaa0ff",
fillOpacity: 0.4
};
var polygon = new google.maps.Polygon(polyopts);
polygon.setMap(map);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width: 600px; height: 400px"></div>
</body>
</html>