-1
私はMySQLテーブルに基づいてマーカーを使用してマップを作成しました。 位置はテーブルにあります。 今、私はInfoWindowのHTMLを地図上のInfoWindowに表示しないので、InfoWindowにHTMLを書きたいと思います。GoogleマップHTML InfoWindowを使用したMySQLマップ
downloadUrl('inc/map_bridge.php', function(data) {
var xml = data.responseXML;
var markers = xml.documentElement.getElementsByTagName('marker');
Array.prototype.forEach.call(markers, function(markerElem) {
var name = markerElem.getAttribute('name');
var ide = markerElem.getAttribute('id');
var desc = markerElem.getAttribute('beschreibung');
var type = markerElem.getAttribute('art');
var link = '<p>Klicke für weitere infos: <a href="http://link.de">Hier</a>';
var point = new google.maps.LatLng(
parseFloat(markerElem.getAttribute('lat')),
parseFloat(markerElem.getAttribute('lng')));
var infowincontent = document.createElement('div');
var strong = document.createElement('strong');
strong.textContent = 'ID' + ide + ': ' + name
infowincontent.appendChild(strong);
infowincontent.appendChild(document.createElement('br'));
var text = document.createElement('text');
text.textContent = desc + link
infowincontent.appendChild(text);
var icon = customLabel[type] || {};
var marker = new google.maps.Marker({
map: map,
position: point,
label: icon.label
});
marker.addListener('click', function() {
infoWindow.setContent(infowincontent);
infoWindow.open(map, marker);
});
});
});
}
それだけなので示しています ショーの例の絵
は 'beschreibung' は、SELECTの結果であった場合、私は、MySQL-表に
first line<br>second line