I have something that appears to be working. The steps are as
follows:
Create map
Add one time listener for tilesloaded
in tilesAreLoaded() {
create kmlLayer
add one time Listener for defaultviewportChanges
start window timeout
}
in kmlViewportChanged() {
stop the windows timer
enable rest of kmllayer
}
in window timer function {
delete timed-out kml layer
reload kml layer
}
You can see this code in action at
http://www.jtphillips.com/cgi-bin/AtcInspectionForm.cgi
but you need to complete the steps select a State, select Segment,
select line, and then
apply before the page includes the java scrip.
On Oct 4, 10:21 am, Chad Killingsworth
<[email protected]> wrote:
> Ahh sorry. Since KML layer rendering is an asynchronous process, you
> would need to wait for an event of some type. You could specify a
> timeout and if the event hasn't occurred by then, retry. The problem
> comes down to what event you should listen for?
>
> You could test to see if tilesloaded gets fired on the map.
>
> Chad Killingsworth
>
> On Oct 4, 8:25 am, John M Phillips <[email protected]>
> wrote:
>
> > Let me be clearer, this needs to be an in-line error check, something
> > like
>
> > <pseudo-code>
> > var myLayer = new google.maps.KmlLayer(kmlUrl, kmlOptions);
>
> > if (myLayer.getError() != 0) { # Such method may not
> > exist
> > delete myLayer; # try again
> > var myLayer = new google.maps.KmlLayer(kmlUrl, kmlOptions);
> > }
> > </pseudo-code>
>
> > On Oct 4, 8:58 am, Chad Killingsworth
>
> > <[email protected]> wrote:
> > >http://www.kmlvalidator.com/home.htm
>
> > > Chad Killingsworth
>
> > > On Oct 4, 7:32 am, John M Phillips <[email protected]>
> > > wrote:
>
> > > > My application overlays a kmlLayer of boundary markers on a google
> > > > map. Randomly, the kmlLayer does not appear. I believe this is
> > > > because the kml file is being generated from a mysql database, and the
> > > > renderer may be timing out. My question: is there a method to check
> > > > for errors on the creation of the kmlLayer? How do you check in the
> > > > code for an error?
>
> > > > The project is at
> > > > http://www.jtphillips.com/cgi-bin/AtcInspectionForm.cgi
--
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.