Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6953267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:27:23+00:00 2026-05-27T14:27:23+00:00

I’m using KML to load an image overlay, and then I’m trying to change

  • 0

I’m using KML to load an image overlay, and then I’m trying to change camera view values such as altitude using NetworkLinkControl. None of my NetworkLinkControl updates are reflected in the GE plugin. I’ve done quite a bit of research on this issue to no avail. Any help would be appreciated.

Here are the details:

The process starts with loading a NetworkLink KML file:

google.earth.fetchKml(ge, href, function(kmlObject) { ... 

inside which the .appendChild() is done like this:

    walkKmlDom(kmlObject, function() {
        if(this.getType().match('KmlNetworkLink')) {
            ge.getFeatures().appendChild(this);

            //There are 2 NetworkLinks
            if(this.getLink().getHref().match('nodesc')) {
                networkLinkPhoto = this;
            }
            else if(this.getLink().getHref().match('control')){
                networkLinkControl = this; //will use this for updates later
            }
        }
    });

The .fetchKml() above loads the following KML 1:

    <kml xmlns="http://www.opengis.net/kml/2.2">
        <Document>
            <name>Photos</name>
            <open>1</open>
            <Style id="photoStyle">
                <IconStyle>
                    <Icon>
                        <href>http://hostname/images/ge_icon.png</href>
                    </Icon>
                </IconStyle>
                <BalloonStyle>
                    <text>$[description]</text>
                </BalloonStyle>
            </Style>
            <Folder>
                <name>My Photo</name>
                <open>1</open>
                <visibility>1</visibility>
                <NetworkLink>
                    <name>My Photo</name>
                    <open>1</open>
                    <Link>
                        <href>http://hostname/images/10000244.kml?auth_key=e34962fce2df4829b0e86870c9e834da&amp;nodesc=1</href>
                    </Link>
                </NetworkLink>
                <NetworkLink>
                    <name>Updater</name>
                    <Link>
                        <href>http://hostname/placements/10000244/control?auth_key=e34962fce2df4829b0e86870c9e834da</href>
                        <refreshMode>onChange</refreshMode>
                    </Link>
                </NetworkLink>
            </Folder>
        </Document>
    </kml>

Each of the two NetworkLink loads it’s own KML file through URLs defined in <Link>.

First one is My Photo (overlay) KML 2:

    <kml xmlns="http://www.opengis.net/kml/2.2">
        <Document>
            <name>Photos</name>
            <open>1</open>
            <Style id="photoStyle">
                <IconStyle>
                    <Icon>
                        <href>http://hostname/images/ge_icon.png</href>
                    </Icon>
                </IconStyle>
                <BalloonStyle>
                    <text>$[description]</text>
                </BalloonStyle>
            </Style>
            <PhotoOverlay id="image_10000244">
                <name>My Photo</name>
                <Snippet maxLines="1">
                    <![CDATA[<a href="#image_10000244">Enter Photo</a>]]>
                </Snippet>
                <Camera>
                    <longitude>-122.668</longitude>
                    <latitude>45.5069</latitude>
                    <altitude>1.0</altitude>
                    <heading>66.0</heading>
                    <tilt>90.0</tilt>
                    <roll>0.0</roll>
                </Camera>
                <styleUrl>#photoStyle</styleUrl>
                <color>feffffff</color>
                <Icon>
                    <href>http://hostname/get_ge_tile/10000244/$[level]/$[y]/$[x]?auth_key=e34962fce2df4829b0e86870c9e834da</href>
                </Icon>
                <rotation>0.0</rotation>
                <ViewVolume>
                    <leftFov>-17.5</leftFov>
                    <rightFov>17.5</rightFov>
                    <bottomFov>0.0</bottomFov>
                    <topFov>17.5</topFov>
                    <near>550.0</near>
                </ViewVolume>
                <ImagePyramid>
                    <tileSize>256</tileSize>
                    <maxWidth>16000</maxWidth>
                    <maxHeight>8000</maxHeight>
                    <gridOrigin>upperLeft</gridOrigin>
                </ImagePyramid>
                <Point>
                    <coordinates>-122.668,45.5069</coordinates>
                </Point>
                <shape>sphere</shape>
            </PhotoOverlay>
        </Document>
    </kml>

The second one is Updater KML 3:

    <kml xmlns="http://www.opengis.net/kml/2.2">
        <Document>
            <name>Photos</name>
            <open>1</open>
            <Style id="photoStyle">
                <IconStyle>
                    <Icon>
                        <href>http://hostname/images/ge_icon.png</href>
                    </Icon>
                </IconStyle>
                <BalloonStyle>
                    <text>$[description]</text>
                </BalloonStyle>
            </Style>
            <NetworkLinkControl>
                <Update>
                    <targetHref>http://hostname/images/10000244.kml?auth_key=e34962fce2df4829b0e86870c9e834da&amp;nodesc=1</targetHref>
                    <Change>
                        <PhotoOverlay targetId="image_10000244">

                            <Camera></Camera>
                            <ViewVolume></ViewVolume>
                            <Point></Point>
                        </PhotoOverlay>
                    </Change>
                </Update>
            </NetworkLinkControl>
        </Document>
    </kml>

The GE plugin now has the KMLs loaded, the placemark is placed at the
specified coordinates, and double clicking the placemark enters the photo
view mode.

To change the photo’s altitude, javascript API requests the update:

var updateHref='http://http://hostname/netlinkcontrol/10000244?&altitude=55&auth_key=e34962fce2df4829b0e86870c9e834da'
networkLinkControl.getLink().setHref(updateHref);

The server responds (indicated in server log) with KML 4:

    <kml xmlns="http://www.opengis.net/kml/2.2">
        <Document>
            <name>Photos</name>
            <open>1</open>
            <Style id="photoStyle">
                <IconStyle>
                    <Icon>
                        <href>http://hostname/images/ge_icon.png</href>
                    </Icon>
                </IconStyle>
                <BalloonStyle>
                    <text>$[description]</text>
                </BalloonStyle>
            </Style>
            <NetworkLinkControl>
                <Update>
                    <targetHref>http://hostname/images/10000244.kml?auth_key=e34962fce2df4829b0e86870c9e834da&amp;nodesc=1</targetHref>
                    <Change>
                        <PhotoOverlay targetId="image_10000244">

                            <Camera>

                                <altitude>55</altitude>
                            </Camera>
                            <ViewVolume></ViewVolume>
                            <Point></Point>
                        </PhotoOverlay>
                    </Change>
                </Update>
            </NetworkLinkControl>
        </Document>
    </kml>

This should work because:

  1. <refreshMode>onChange</refreshMode> is set for the Updater <NetworkLink> in KML 1, and networkLinkControl.getLink().setHref() is making the change.
  2. <PhotoOverlay targetId="image_10000244"> in KML 4 is correctly targeting <PhotoOverlay id="image_10000244"> in KML 2
  3. <targetHref> in KML 4 is targeting the correct <href> in KML 1

GE plugin however doesn’t display the altitude change. I’ve tried changing
this value through javascript API, which works. But why isn’t the KML
method working? Any ideas would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:27:24+00:00Added an answer on May 27, 2026 at 2:27 pm

    Try targetting the Camera element itself, not the PhotoOverlay parent. KML Updates in Google Earth don’t see to work so well when you are trying to make changes a couple levels down from the targeted parent.

    In other words, I would try this:

    KML 1

    <PhotoOverlay id="image_10000244">
      <name>My Photo</name>
      <Snippet maxLines="1">
          <![CDATA[<a href="#image_10000244">Enter Photo</a>]]>
      </Snippet>
      <Camera id="image_10000244_camera">
          <longitude>-122.668</longitude>
          <latitude>45.5069</latitude>
          <altitude>1.0</altitude>
          <heading>66.0</heading>
          <tilt>90.0</tilt>
          <roll>0.0</roll>
      </Camera>
      <ViewVolume id="image_10000244_viewvol" />
    </PhotoOverlay>
    

    and then in your networklinkupdate:

    <NetworkLinkControl>
      <Update>
        <targetHref>http://hostname/images/10000244.kml?auth_key=e34962fce2df4829b0e86870c9e834da&amp;nodesc=1</targetHref>
        <Change>
          <Camera targetId="image_10000244">
            <altitude>55</altitude>
          </Camera>
        </Change>
        <Change>
          <ViewVolume targetId="image_10000244_viewvol">
            <!-- new values -->
          </ViewVolume>
        </Change>
      </Update>
    </NetworkLinkControl>
    

    In general, it’s best to target the immediate parent of the simple element you want to change. Cascading updates don’t work so well.

    I would also recommend that you try this in pure KML in Google Earth itself to see if it works. Then, after the NLC update is performed, you can copy out the PhotoOverlay and paste the code into your editor and see if the change was applied correctly.

    Let me know if that works…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.