Open TDC-bob opened 11 years ago
Some example code to display custom icon:
kml = simplekml.Kml()
kml.newpoint(name="Kirstenbosch", coords=[(18.432314,-33.988862)])
pnt = kml.newpoint(name="Icone de test", coords=[(18.432414,-33.988990)])
pnt.iconstyle.icon.href = 'https://lh6.googleusercontent.com/-pyqo-LMmhos/AAAAAAAAAAI/AAAAAAAAAAA/WpBRYvZ7x4A/s27-c/photo.jpg'
kml.save("botanicalgarden.kml")
gMap result: http://goo.gl/maps/JSptj
http://www.portailsig.org/content/python-creer-facilement-des-fichiers-kml-avec-le-module-simplekml
SimpleKml for Python 3.3: https://pypi.python.org/pypi/simplekml/1.2.1
1) First is the kml creation, see "misc" folder for example 2) Custom NATO icons can be referenced (upload then linked in the kml) 3) Then all we needa do is
http://maps.google.com/?q=<url to kml file>
(seriously now how huge is that ?)Misc links: http://apiolaza.net/code/dynamic-maps-python.html https://pypi.python.org/pypi/googlemaps/ http://pyvideo.org/video/672/making-maps-with-python https://gist.github.com/dbr/3304597