2

I've spent hours and hours trying to figure out how to customise the Google Latitude Badge public feed. The problem with it is that it comes as a predefined KML file from google and there is no way to change it. What I came up with was to extract the coordinates using a bit of PHP and load them into my own KML file which is served from my own webserver (which I assume is public access).

This works but the latest problem I am facing is that the style changes I am making to the KML (Ballonstyle etc) are not being reflected when I reload the page. I am using the following Javascript to load the map and overlay:

var map;
var src = 'https://myip/kml/kmlfile.kml
    function initialize() {
      map = new google.maps.Map(document.getElementById('map-canvas'), {
        center: new google.maps.LatLng(-19.257753, 146.823688),
        zoom: 2,
        mapTypeId: google.maps.MapTypeId.TERRAIN
      });
      loadKmlLayer(src, map);
    }

    function loadKmlLayer(src, map) {
      var kmlLayer = new google.maps.KmlLayer(src, {
        suppressInfoWindows: true,
        preserveViewport: false,
        map: map
      });
    }

The KML file is the one that has been written by the PHP script which takes the latest set of coords from the latitude feed.

Now here is the really weird bit. To try and diagnose the problem i removed the kml file from my server....but the map still loads and appears to to be using an older style from many iterations ago. I'm thoroughly confused as to how the javascript can load the map when the kml file does not even exist in the 'src' location!?! Is this a cache issue?

I originally had the kml file on google sites but its not a writeable location so I moved it from there to my own webserver. In fact I have removed all old kml files from both google sites and my webserver yet the map and style continue to load as if by magic!

I'd be grateful for any KML experts that might be able to help me diagnose this strange problem.

Kara
  • 6,115
  • 16
  • 50
  • 57

0 Answers0