XHTMLforum

XHTMLforum (http://xhtmlforum.de/index.php)
-   Javascript & Ajax (http://xhtmlforum.de/forumdisplay.php?f=83)
-   -   Google Maps API (http://xhtmlforum.de/showthread.php?t=44531)

Leviathan 16.02.2007 15:18

Google Maps API
 
Hallo zusammen,

als absoluter Javascript N00b möchte ich das Infofenster für eine Google Map bearbeiten. Leider bisher ohne Erfolg. Der Code für die Map sieht wie folgt aus.
Code:

<div id="map" style="width: 606px; height: 400px"></div>
<script type="text/javascript">
//<![CDATA[
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.setCenter(new GLatLng(54.11362215456899, 12.080326080322266), 15, G_NORMAL_MAP);
map.openInfoWindow(map.getCenter(), document.createTextNode("Zeile 1"));
//]]>
</script>

Nun möchte ich aber neben der Zeile 1 im Textfeld noch weitere formatierte Zeilen ausgeben lassen. Einen Zeilenumbruch via <br /> oder \n lässt das Script nicht zu. Könnt Ihr mir helfen, dass sie Ausgabe im Fenster so aussieht?
Zeile 1
Zeile 2
Zeile 3
Link

Maxefix 16.02.2007 16:17

Ich habs so gelöst:
PHP-Code:

map.addOverlay(marker);
marker.openInfoWindowHtml('beliebiger HTML-Code'); 

Es wird also ein Marker erstellt und der bekommt nen Info-Fenster das mit HTML befüllt werden kann. :)

MFG Max

Leviathan 16.02.2007 16:38

Super...hat perfekt geklappt. Dankeschön.


Alle Zeitangaben in WEZ +2. Es ist jetzt 09:38 Uhr.

Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

© Dirk H. 2003 - 2023