Search code examples
htmlrgoogle-mapskmlgoogle-earth

How to start an embedded kml tour?


This is my first post, wooohooo! I've been using stack exchange when I needed information but usually someone had the same problem as me and I didn't need to make a post. Which means this website is really good.

Now turns out I have a pretty unique problem.

Please check out http://gaia.tru.ca/birdMOVES/

You will see a website with a google map. It is connected to a db which will be automatically updated.

The purpose of this website is to track how birds feed. There is going to be bird feeders equipped with NFC all over the world to track birds equipped with RFID when they feed.

I am taking care of the front-end, the web app for visualizing. This is a work in progress so try not to care about the looks of it. Apparently everything was written in RApache because the person who made everything this far is a Geography teacher(Not a lot of programming background, I had to refactor his code and learn R because it wasn't in my array of known languages.)

My client asked me to add time animation to his map. Feasible with the help of Google Earth.

I made the existing R code generate a tour. It works perfectly and even shows on my map.

Here is the address of my dev server: http://thelab.dyndns.org:1080/birdmoves/ You can see that there is an extra check box for time animation. If you check it, the tour will appear as an object on the map (no way to use it whatsoever right now).

So what I'd like to know is how do I make it work? How do I make it autoplay when the submit button is pressed? With standard google earth controls for rewind, pause and fast-forward. And independently from the google maps without tour?

This is intense. I have the feeling google earth isn't going to work because they deprecated all their gadgets.

I'm on the clock and I need help.


Solution

  • In case you were wandering what eventually happened:

    We ended up making a hybrid website where the static visualization is within Google maps using kml and the time animation is within CesiumJs using CZML.

    CZML is based off JSON and can be used very similarly to kml. The api is also very nice, it only takes one line of javascript code to get a map running on an existing server.

    To implement time visualization CZML supports putting multiple consecutive values for almost any property(like position, to animate movement, or even color to change colors) and takes account of time.

    Also very nice, CesiumJs supports animated 3d models!

    If you're interested http://cesiumjs.org/

    It also has a lot of support, documentation and tutorials... etc.. It's being maintained by professionals. I really recommend it.

    The Google Earth API got deprecated and will not function by December this year which is not a viable option for a long term service. So cesium was the only option for this specific project.

    Cheers