The code below was working, but now it is not. This isn't my actual production code, just my KML test document to make sure everything is working. I got this document as a working example from stack exchange. I saw it working earlier today and yesterday. There is a div at the bottom for the KML status and it even says: OK!. I hate it when things do not work, but there is not error returned.

    <!DOCTYPE html>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false">

    function initialize()
    var mapOptions = {
        center: new google.maps.LatLng(38,-79.5),
        mapTypeId: google.maps.MapTypeId.TERRAIN
    var map=new google.maps.Map(document.getElementById("googleMap"),mapOptions);
    var overlay = new google.maps.KmlLayer('https://www.dropbox.com/s/zq3st95fbb0kyo4/FireHydrant-small.kml?dl=1');

      document.getElementById('status').innerHTML = overlay.getStatus();
    google.maps.event.addDomListener(window,'load', initialize);
    <div id="googleMap" style="height:500px;width:600px;"></div>
    <div id="status"></div>

When the code is working, red fire hydrants should appear on the map.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.