On Jan 22, 2:53 pm, dabernal <[email protected]> wrote:
> I am creating and refreshing a KML file every 30 seconds. It contains
> vehicle's reports over a Google map V3, with ASP.NET 2010. The first
> time I open the page it shows all the points on the map, including the
> ones just reported, about 70 in total. After 30 seconds a timer re-
> generates the KML file and reloads it with the following code:
>
> First the map is loaded :
>
> function init_map(map_canvas_id, lat, lng, zoomLevel) {
>       var myLatLng = new google.maps.LatLng(lat, lng);
>       var options =
>         {
>           zoom: 11,
>           center: myLatLng,
>           mapTypeId: google.maps.MapTypeId.ROADMAP,
>           mapTypeControl: true,
>           mapTypeControlOptions:
>           {
>             style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
>             position: google.maps.ControlPosition.TOP_LEFT
>           },
>           scaleControl: true,
>           scaleControlOptions: { position:
> google.maps.ControlPosition.LEFT_BOTTOM },
>           navigationControl: true,
>           navigationControlOptions:
>           {
>             style: google.maps.NavigationControlStyle.SMALL,   //
> ZOOM_PAN
>             position: google.maps.ControlPosition.LEFT_TOP
>           }
>         }
>       var map_canvas = document.getElementById(map_canvas_id);
>       map = new google.maps.Map(map_canvas, options);
>       ctaLayer = new google.maps.KmlLayer(kml_url); // Carga en 'map'
> el arc. KML
>       ctaLayer.setMap(map);
>
> }
>
> after that, and every 30 seconds i regenerate the KML file and refresh
> the map:
>
> function timer1()
>     { // every 30 seconds
>       grid2.Refresh();
>       cpanel.PerformCallback();
>       try {
>           ctaLayer.setMap(null);  // Borrar KML de memoria
>       }
>       catch (e) {
>       }
>       kml_url = "http://autorastreo.net/downloads/"; + g_fname;
>       try
>       {
>         ctaLayer = new google.maps.KmlLayer(kml_url,
> { preserveViewport: true });
>         ctaLayer.setMap(map);
>       }
>       catch (e)
>       {
>       }
>     }
>
> I have not found a way to make it show the current data, only the
> first file generated is shown, like if it was chached or buffered
> someway. It always shows the first one. I even tried deleting the
> files in the server side before executing:
> ctaLayer = new google.maps.KmlLayer(kml_url, { preserveViewport:
> true });
> ctaLayer.setMap(map);
> I also tried to find in the client side (windows XP IE 8) if the
> files where cached, I found it and deleted it but with no
> success...!
>
> Is there a cache function in Google Maps that I can desable?

The files are cached on googles servers:
http://groups.google.com/group/google-maps-js-api-v3/search?group=google-maps-js-api-v3&q=kml+cache&qt_g=Search+this+group

If you change the data, the general accepted way to bust the cache is
to append a parameter to the url that changes everytime you request it
(or at least everytime the data changes).  I usually use a function of
the Date(), some people use a random number.

  -- Larry

> I  tried with Firefox and the problem is the same...! Any help will
> be very appreciated. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to