Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to parse xml coordinates onto google map
    primarykey
    data
    text
    <p>What i have done so far is parsing data out of a JSON file using the instructions provided <a href="https://developers.google.com/maps/tutorials/data/importing_data" rel="nofollow">By google documentation</a>. My question is what do i need to change for my codes so that i can parse data out of a xml file instead ?</p> <p>Also i would like to add content to the info-window. Am i on the right track ?</p> <p>My current code.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; html, body, #map_canvas { margin: 0; padding: 0; height: 100%; } &lt;/style&gt; &lt;script src="https://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=visualization"&gt; &lt;/script&gt; &lt;script&gt; var map; function initialize() { var mapOptions = { zoom: 5, center: new google.maps.LatLng(-27.48939, 153.012772), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); var script = document.createElement('script'); script.src = 'http://earthquake.usgs.gov/earthquakes/feed/geojsonp/2.5/week'; document.getElementsByTagName('head')[0].appendChild(script); } window.eqfeed_callback = function(results) { for (var i = 0; i &lt; results.features.length; i++) { var earthquake = results.features[i]; var coords = earthquake.geometry.coordinates; var latLng = new google.maps.LatLng(coords[1],coords[0]); var marker = new google.maps.Marker({ position: latLng, map: map, }); var infowindow = new google.maps.InfoWindow({ content: "&lt;div&gt;Hello! World&lt;/div&gt;", maxWidth:100 }); google.maps.event.addListener(marker, "mouseover", function() { infowindow.open(this, marker); }); } } &lt;/script&gt; &lt;/head&gt; &lt;body onload="initialize()"&gt; &lt;div id="map_canvas"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&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.
 

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