1
votes

So, basically, I'm trying to figure out a way that I can draw lines (say, representing the flight path of an RC plane or something) onto Google Earth using KML. Here's the kicker though: I want to give it an initial location, and then check somewhere to see where to continue drawing the line to, draw the line, and leave it be. Once it's done, I could then move it around.

Ex:

  1. Starts at a point A in google Earth
  2. Checks File XYZ.kml on //someserver
  3. XYZ.kml has updated coordinates to draw to
  4. Google Earth pulls in those coordinates and extends the line
  5. Repeat 2->4 until complete
  6. View completed flight path from 3rd person.

Does anyone have any ideas on how to do this? It seems like it can change the location of a model or something in this fashion, but you would have to watch it first person. I haven't been able to figure out how to get this particular functionality to come out right.

1
Have you attempted anything yet? I am not 100% sure what you mean by starting at a point and then checking KML. And example of what you have tried might help. Also, is this within Google Earth or the plugin. I just want to clarify as I have no experience which what programmatic control you have in the GE app, but if the plugin I might be able to help. - Matthew
I must admit that I haven't tried much of anything yet beyond computationally creating some FlyTo stuff with cameras. Which is great, but it sadly doesn't solve the problem I want it to solve. This should be within Google Earth. - Campin Carl
I cannot think of a way to approach what you are asking in the GE app. Hopefully one of the GE experts will have insight. - Matthew
It's weird because it seems like it should be pretty easy; using KML Paths (using the <LineString>). But from what I can tell, you can't maintain existing LineString and add new Linestrings using the <Update> mechanic? Or am I just misinterpreting the documentation? - Campin Carl
You can achieve (I think) something like you are asking with Update, but it is part of the NetworkLinkControl features to reload (and possibly modify) the KML. (I think the only way to have this happen is when the NetworkLinkControl element times out / expires). I have never played with this, but I am pretty sure you could not make it execute on a click / whatever you mean by starts on point A. This said - I have read about it only, not used it. - Matthew

1 Answers

1
votes

You have a few ways of doing this, here is just 2.

  1. Create a LineString via a networkLink and then use the Update feature to update your LineString (ie replace with new version)
  2. Create a LineString and then use .getCoordinates().pushLatLngAlt() to build upon it.

Edit: Sorry, as pointed out in comments, Option 2 is for GE Plug-in, not standalone version

See this SO question for some help on using option #1

See this SO question for more info on option #2