I think you could achieve this using a combination of the ID and NetworkLinkControl and Update attributes in Kml.
MyFlyToRequest.kml contains NetworkLink, which downloads a data file that contains your data, it has a flyToView element set to true. Please note that the network link also has a request identifier
MyFlyToRequest.kml
<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <NetworkLink id="request"> <name>My Fly To Request</name> <Link> <href>http://www.yourserver.com/MyFlyTo.kmz</href> <refreshMode>onInterval</refreshMode> <refreshInterval>2</refreshInterval> </Link> <flyToView>1</flyToView> </NetworkLink> </kml>
The second file MyFlyTo.kmz is the one that is downloaded. It has your current data as it is. However, it also has an additional NetworkLink, which downloads a new third file.
MyFlyTo.kmz - Edited
<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document id="data"> <visibility>1</visibility> <NetworkLink> <name>Update MyFlyToRequest</name> <Link> <href>http://www.yourserver.com/TurnOffFlyTo.kml</href> </Link> </NetworkLink> <Placemark> <name>This is flown to once (hopefully)</name> <Point> <coordinates>52,0,0</coordinates> </Point> </Placemark> </Document> </kml>
The new third TurnOffFlyTo.kml file is part of the configuration key; it contains NetworkLinkControl , which targets the NetworkLink request in the first MyFlyToRequest.kml file. It simply sets the flyToView element to 0.
TurnOffFlyTo.kml
<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <NetworkLinkControl> <Update> <targetHref>http://www.yourserver.com/MyFlyToRequest.kml#request</targetHref> <Change> <NetworkLink id="request"> <flyToView>0</flyToView> </NetworkLink> </Change> </Update> </NetworkLinkControl> </kml>
The final TurnOnFlyTo.kml file redirects flyto behavior again.
TurnOnFlyTo.kml
<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <NetworkLinkControl> <Update> <targetHref>http://www.yourserver.com/MyFlyToRequest.kml#request</targetHref> <Change> <NetworkLink id="request"> <flyToView>1</flyToView> </NetworkLink> </Change> </Update> </NetworkLinkControl> </kml>
The logic is this.
- MyFlyToRequest.kml loads MyFlyTo.kml
flyto on, so the view moves the first first label, etc. in MyFlyTo.kml- The link in MyFlyTo.kml loads TurnOffFlyTo.kml.
Update in TurnOffFlyTo.kml three disables flyto in MyFlyToRequest.kml.- File one, updated, file two loaded ...
If you need to enable flyto again, you just upload file four. If the data in MyFlyTo.kmz is generated by you, this will be a simple case of loading TurnOnFlyTo.kml, where TurnOffFlyTo.kml is called.
All that was said is not verified and, as such, may not work as it is, although in principle I do not understand why this is not so.
If this sounds like something you can try here, these are some resources that should help.
NetworkLinkControl Reference
http://code.google.com/apis/kml/documentation/kmlreference.html#networklinkcontrol
Using Updates
http://code.google.com/apis/kml/documentation/updates.html