Googleマップの15種類のチームマーカーに画像を関連付けようとしていますが、これをやろうとしていますが、地図上で正しく機能していないため、 。私の考えはアソシエイトです:if(location.nombreequipo == AST1){icon:imagen}しかし、私はこのアイディアについて多くの疑念を持っています。Googleマップの色マーカーが異なる
function displayLocation(location){
var content = '<strong><p>Equipo: ' +location.nombreequipo + '</strong>'
+'</strong></p><strong><p>Hora móvil: ' + location.fecha_movil
+ '</strong></p><strong><p>Longitud: ' +location.longitud +'</strong></p>'
+ '</strong></p><strong><p>Latitud: ' +location.latitud +'</strong></p>';
var latLng = new google.maps.LatLng(parseFloat(location.latitud), parseFloat(location.longitud));
var imagen ='img/blue_MarkerA.png';
var marker = new google.maps.Marker({
position: latLng,
draggable: false,
map: map,
draggable: true,
visible: true,
title: location.nombreequipo
});
arrayMarcadores.push(marker);
google.maps.event.addListener(marker, 'click', function(){
infowindow.setContent(content);
infowindow.open(map, marker);
});
return marker;
}
ありがとうございます。
ああ、そのミスについて申し訳ありません、ついに私は別の方法で解決しました。しかしあなたの考えは本当に良いです。 – lfergon