API 3.10 以降の Google マップでは、クローズアップでリモート画像を含むマーカーが表示されません。ズームインすると、画像が表示されないことを意味します。ズームアウトすると、画像の一部または完全にズームアウトすると画像全体が表示されます。
ただし、マーカー画像がローカルファイルの場合は毎回表示されます。
サンプルを見る:
マップは phonegap アプリケーションから起動します。
ローカルとリモートの両方の画像マーカーのコードはほとんど同じです:
var image = new google.maps.MarkerImage(location.image,
new google.maps.Size(120, 120),
new google.maps.Point(0,0),
new google.maps.Point(iconSize*14/32, iconSize*40/32),
new google.maps.Size(iconSize*1, iconSize*1)
); //REMOTE IMAGE
var shadow = new google.maps.MarkerImage('images/marker-big-'+location.status+'.png',
//LOCAL IMAGE
new google.maps.Size(96, 111),
new google.maps.Point(0,0),
new google.maps.Point(iconSize*16/32-1, iconSize*42/32),
new google.maps.Size(iconSize*36/32, iconSize*42/32));
localMarker = new google.maps.Marker({
position: new google.maps.LatLng(location.latitude,location.longitude),
title:location.text,
map: map,
icon: shadow,
zIndex: index*2
});
remoteMarker = new google.maps.Marker({
position: new google.maps.LatLng(location.latitude,location.longitude),
title:location.text,
map: map,
icon: image,
zIndex: index*2+1
});
古い API 3.9 は正常に動作します