Google Earth KML file creation

chanppc

Member
Licensed User
Sharing a small piece of library for creating Google Place Mark KML file, such that you don't need to deal with XML creation. Double-click the final KML file will open Google Earth with Place Mark set.
Thanks to Agraham's XML library C# code, without that I don't know what is C# ;)

The library expose 2 functions:

CreateNewKML - create a new Place Mark KML file
AddNewPlaceMark - add new Place Mark (remember to pass-in GPS coordinate)
 

Attachments

  • KML1.0.zip
    4 KB · Views: 85

dlfallen

Active Member
Licensed User
Longtime User
Thanks for sharing this code, it will be useful to me.

I have a GPS program called GPSlog written specifically for ease in recording the current location (see http://www.b4x.com/forum/share-your-creations/4937-gpslog.html). I have been manually plugging the coordinates into Google Earth. Now I will add your code to my program so I can automatically generate a KLM file for my locations.

One problem with your code: You hard-wire the KLM file to the location "D:\temp". If that path does not exist, you get an error. In your sample app I replaced "D:\temp\PBS_PlaceM.kml" with Apppath & "\PBS_PlaceM.kml" - a path that always exists.

Thanks for the code!
 

SarahWard

Banned
Thanks Chan

I still intend to use your kml code in PocketBirds and the other Pocket nature series. :)
And thanks to aGraham's gpserial library I can use it with bluetooth gps too.
 
Top