Skip to content Skip to sidebar Skip to footer

Javascript In Kml Ignored By Google Earth Plugin

I've created a simple KML file that works in the standalone Google Earth client, but won't work at all in the Google Earth Plugin (regardless of browser):

Solution 1:

The Earth API strips out any javascript in a Balloon description for security purposes. A common workaround is to listen for a click event on your placemark (or a balloonopening event more generally) and then recreate an HtmlDivBalloon programmatically with the full content. For more details check out http://code.google.com/apis/earth/documentation/balloons.html#getballoonhtmlunsafe

Solution 2:

I have a similar problem, and have been looking around for a solution. I have found this answer, which I have yet to try myself, but it may be useful to you:

http://markmail.org/message/ivlw7jv3u5nxwkde

I hope so - do share any success you have!

Solution 3:

A simple JavaScript code (even simple jQuery) can be inputted into or and it will work. However in the Google Earth environment only. After depreciation of the Google Earth API we cannot really use the JS in .kml file outside the Google Earth. Read more about it here: http://www.mkrgeo-blog.com/content-management-in-kml-files/

Post a Comment for "Javascript In Kml Ignored By Google Earth Plugin"