Мне нужно в InfoWindow show match.offer.text. Каждый маркер имеет другой match.offer.text.Google maps marker - infowindow
Это мой код:
var markerImageURL, lat, lng;
if (myoffer) {
markerImageURL = 'assets/img/markers/marker_my.png';
lat = match.lat;
lng = match.lng;
} else {
markerImageURL = 'assets/img/markers/marker_' + match.strength + '.png';
lat = match.offer.lat;
lng = match.offer.lng;
}
var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat, lng),
map: window.googleMap,
icon: {
size: new google.maps.Size(54,56),
url: markerImageURL
},
draggable: false,
visible: true
});
var infowindow = new google.maps.InfoWindow({
content: match.offer.text,
maxWidth: 300
});
window.googleMapMarkers.push(marker);
if(!myoffer) {
window.MVC.Events.GoogleMap.prototype.showInfoWindow(marker, infowindow, match);
}
Событие срабатывает после нажатия на маркер:
marker.addListener('click', function() {
infowindow.open(window.googleMap, marker);
}
Пожалуйста, помогите мне.
У вас возникли ошибки в консоли разработчика? что делает ваш код в настоящее время? –
Просьба предоставить [Минимальный, завершенный, проверенный и читаемый пример] (http://stackoverflow.com/help/mcve), который демонстрирует вашу проблему. – geocodezip
Возможный дубликат [Google JS API v3 - простой пример множественного маркера] (http://stackoverflow.com/questions/3059044/google-maps-js-api-v3-simple-multiple-marker-example) – geocodezip