Note that there are some explanatory texts on larger screens.

plurals
  1. POMy google map marker doesn't appear in the website
    primarykey
    data
    text
    <p>I have tried this code on my own appserv localhost. It works well (both the map and the marker). However, when I uploaded it into remote server, the marker doesn't show up. I have no idea what's wrong since I don't even modify the google example code. Any suggestions would be appreciated. <br><br> ps. phpsqlajax_genxml2.php works well on the server since I've test by calling it and it return the correct marker's xml format.<br><br> (Here's my code)</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt; &lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;sensor=true&amp;amp;key=ABQIAAAAw5y75j6U0CGDJO5dXVWsNBQJj0SM6Mv3a5iwK2VJb-LCBMoC8RRKLU5qU6F7IDJ5DMhWA8SbiexiZA" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ var iconBlue = new GIcon(); iconBlue.image = 'http://labs.google.com/ridefinder/images/mm_20_blue.png'; iconBlue.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'; iconBlue.iconSize = new GSize(12, 20); iconBlue.shadowSize = new GSize(22, 20); iconBlue.iconAnchor = new GPoint(6, 20); iconBlue.infoWindowAnchor = new GPoint(5, 1); var iconRed = new GIcon(); iconRed.image = 'http://labs.google.com/ridefinder/images/mm_20_red.png'; iconRed.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'; iconRed.iconSize = new GSize(12, 20); iconRed.shadowSize = new GSize(22, 20); iconRed.iconAnchor = new GPoint(6, 20); iconRed.infoWindowAnchor = new GPoint(5, 1); var customIcons = []; customIcons["restaurant"] = iconBlue; customIcons["bar"] = iconRed; function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); //map.addControl(new GSmallMapControl()); // map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(7.638179, 99.030762), 12); // Change this depending on the name of your PHP file GDownloadUrl("phpsqlajax_genxml2.php", function(data) { var xml = GXml.parse(data); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i &lt; markers.length; i++) { var name = markers[i].getAttribute("name"); var address = markers[i].getAttribute("address"); var type = markers[i].getAttribute("type"); var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var marker = createMarker(point, name, address, type); map.addOverlay(marker); } }); } } function createMarker(point, name, address, type) { var marker = new GMarker(point, customIcons[type]); var html = "&lt;b&gt;" + name + "&lt;/b&gt; &lt;br/&gt;" + address; GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); }); return marker; } //]]&gt; &lt;/script&gt; &lt;/head&gt; &lt;body onload="load()" onunload="GUnload()"&gt; &lt;div id="map" style="width: 170px; height: 250px"&gt;&lt;/div&gt; &lt;/body&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload