Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaScript Parsing Outside XML/KML - Geoxml3
    text
    copied!<p>I have implemented a script that parses KML into a Google map, as <a href="http://www.prowebx.net/make-kml-and-markerclusterer-work-togeter-locally/" rel="nofollow">described here.</a> There's also a <a href="http://demos.prowebx.net/kmz/ws.html" rel="nofollow">working sample here.</a></p> <p>This works great in Safari and IE, but nothing happens in Firefox or Chrome on my installation (still local) and on the demo site. The only thing in the log is this:</p> <p><code>--[13:07:38.076] "Unable to retrieve station.kml"</code></p> <p>Could someone take a look at this and shed some light? I'm not proficient enough in JavaScript to figure out what's going on.</p> <p>Thanks!</p> <p><strong>UPDATE: Here's my actual code.</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html class="no-js" lang="en"&gt; &lt;!--&lt;![endif]--&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&gt; &lt;title&gt;Where Are Our Alumni?&lt;/title&gt; &lt;meta name="description" content=""&gt; &lt;meta name="viewport" content="width=device-width"&gt; &lt;style type="text/css"&gt; body, html { height: 100%; width: 100%; margin: 0; padding: 0; } div#map-canvas { width: 100%; height: 100%; } &lt;/style&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="geoxml3.js"&gt;&lt;/script&gt; &lt;script src="markerclusterer.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; $(document).ready(function(){ var myOptions = { center: new google.maps.LatLng(41.8813571,-87.6294174), zoom: 3, mapTypeId: google.maps.MapTypeId.ROADMAP }; var mcOptions = {gridSize: 50, maxZoom: 15}; var weather_url = "http://api.wunderground.com/api/6d9cb153ba3be6c0/conditions/forecast/q/"; var count = 0; markers = []; var map = new google.maps.Map(document.getElementById("map-canvas"), myOptions); markerclusterer = new MarkerClusterer(map, [], mcOptions); var infoWindow = new google.maps.InfoWindow({maxWidth:800}); var myParser = new geoXML3.parser({ map: map, singleInfoWindow:true, createMarker:function(placemark){ if (placemark.point.lat != '0') { var point = new google.maps.LatLng(placemark.point.lat, placemark.point.lng); var marker = new google.maps.Marker({position:point}); markers.push(marker); google.maps.event.addListener(marker, "click", function(){ var marker_lat = marker.getPosition().lat(); var marker_lng = marker.getPosition().lng(); var request_url = weather_url + (marker_lat + "," + marker_lng); infoWindow.close(); infoWindow.setOptions({maxWidth:800}); content = ("&lt;div&gt;&lt;strong&gt;" + placemark.name + "&lt;/strong&gt;&lt;br&gt;"); content += (placemark.description + "&lt;/div&gt;"); infoWindow.setContent(content); infoWindow.open(map, marker); }); markerclusterer.addMarker(marker); } } }); myParser.parse('alumni.kml'); }); function clickMarker(i){ google.maps.event.trigger(markers[i], "click"); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="map-canvas"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The geoxml3.js script is what's causing the error, <a href="http://code.google.com/p/geoxml3/" rel="nofollow">available from here.</a></p>
 

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