hendriksaragih / kml-samples

Automatically exported from code.google.com/p/kml-samples
0 stars 0 forks source link

flyToView without an AbstractView still flies to view #214

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Which products are affected?
Google Earth

What steps will reproduce the problem?
1. Create a KML file with a placemark, with no <AbstractView> element.
2. Load it with a NetworkLink that has <flyToView> enabled.
3. GE will fly to the placemark.

What is the expected output or behavior? What do you see instead?
"If the <kml> element does not have a LookAt or Camera specified, the view
is unchanged." -
http://code.google.com/apis/kml/documentation/kmlreference.html#flytoview

What application versions (if any) are you using?
All versions

Which operating systems and browsers are affected?
All operating systems

Please provide any additional information (code snippets/links) below.
The file I load with a NetworkLink:

<kml>
    <Placemark>
        <name>AbstractViewBug</name>
        <Point>
            <coordinates>-122.084026,37.421844</coordinates>
        </Point>
    </Placemark>
</kml>

From :
http://code.google.com/apis/kml/documentation/kmlreference.html#flytoview

<flyToView>
    Boolean value. A value of 1 causes Google Earth to fly to the view of
the LookAt or Camera in the NetworkLinkControl (if it exists). If the
NetworkLinkControl does not contain an AbstractView element, Google Earth
flies to the LookAt or Camera element in the Feature child within the <kml>
element in the refreshed file. If the <kml> element does not have a LookAt
or Camera specified, the view is unchanged. For example, Google Earth would
fly to the <LookAt> view of the parent Document, not the <LookAt> of the
Placemarks contained within the Document.

Original issue reported on code.google.com by rajni...@gmail.com on 22 Dec 2008 at 9:07

GoogleCodeExporter commented 9 years ago
I believe this is by design and the documentation is incorrect.

Original comment by api.roman.public@gmail.com on 12 Jan 2009 at 10:03

GoogleCodeExporter commented 9 years ago
This should definitely NOT be by design... but anyway, here is a workaround:

Disable the <flytoview> on your networklink.  Create a second networklink (with 
flytoview enabled) that points to a script which generates an empty KML file:

<kml>
<document>
</document>
</kml>

If the script determines it needs to fly somewhere, it will add a simple 
<LookAt> 
tag inside the <document> element (instead of adding into your original 
networklink 
kml file).  

Original comment by marzi...@gmail.com on 26 Aug 2009 at 6:42

GoogleCodeExporter commented 9 years ago
I think it could be an enhacement request, not a bug.

<flyToView> can be enhanced with a third option: fly on first refresh only.

Now, <flyToView> is executed un each refresh, which is annoying if KML document 
contains features on large geographic area.

Original comment by g.ba...@gmail.com on 29 Sep 2009 at 12:04

GoogleCodeExporter commented 9 years ago
@marzig76

thanks, you workaround of using an empty <Document> inside of the <kml> works 
fine.

ps, it should be capital 'D' for document :-)

Original comment by louis.st...@gmail.com on 12 Nov 2010 at 5:43