kml hotlink fails upon GE restart - kml

The following kml code creates a hotlink in a placemark balloon to a photo file using a relative reference. It works properly when first opened in GE (i.e., clicking on the hotlink causes the photo to appear). But if GE is closed and then reopened, the hotlink no longer works. What is causing this?
PhotoName
Thanks,
Rob

When you view the KML as it was first opened in GE, the link is relative to the original location of the KML file from which the JPEG is resolved. When you exit Google Earth and reopen, the KML is now part of the saved places file in for example the location "C:\Users\%username%\AppData\LocalLow\Google\GoogleEarth\myplaces.kml".
The location of your saved places can be found here:
https://support.google.com/earth/answer/166438?hl=en
To fix this, you need to move the JPEG image to the same directory as the saved places KML file or change relative link to an absolute URL.

Related

KML overlay splash screen

Is there a way to get an overlay of some kind to open in GE when the user loads my kml?
I want to add a splash screen with a disclaimer on it and i want to be sure each user sees it.
The overlay would appear as the kml is opened in GE and they would click to dismiss it.
Is this possible?
Try using CDATA for the description of the top-level object in your KML file (eg Doc or Folder). This will pop up as a balloon when user adds KML file to Google Earth.
If you're working with NetworkLinks, you could add the overlay when the NetworkLink first loads, then set refresh to occur a short time later (eg 5 seconds) which returns an Update with a to remove the Overlay.

"Driving directions:" in kml balloons, suppressing - Kml doc file does not say

My project involves kml files that show several sites so I have several placemarks. The first placemark, well off to one side, shows a balloon with descriptive text that is forced to load on start-up, subsequent placemarks in the file identify specific features. I have read the documentation file: https://developers.google.com/kml/documentation/kmlreference#balloonstyle but I guess I don't understand it.
The doc file says: "To prevent the driving directions links from appearing in a balloon, include the element with some content, or with $[description] to substitute the basic Feature ." Alas, including the text element in BalloonStyle does nothing. If description is not included or is in BalloonSdozentyle, the icon cannot be selected (the cursor remains the hand). If description is there, so is "Directions:" in the balloon.
My kml file
http://www.pinacate.org/kmlfiles/hydrovolcanic.kml
shows a dozen icons. The intro balloon is forced to display by gx:balloonVisibility and shows without "Directions:" but when closed and then reopened using the "Hydrovolcanic" icon on the left, it has directions. Sykes Maar and Cerro Colorado maar cannot be selected. All the selectable icons show "Directions:" in the balloon. I cannot figure out how to turn it off.
Problem solved:
I hope I'm a better geologist than I am a coder. By trial and error, I finally found that "Directions:" is suppressed by putting the following code in the STYLE definition and not in the placemarks. In retrospect, it makes sense.
I wrapped $[description] in "text" tags and that in "BalloonStyle tags, all inside the "style" tag e.g.
<Style id="blahblah">
...
<BalloonStyle>
<text>$[description]</text>
</BalloonStyle>
...
</Style>
See https://developers.google.com/kml/documentation/kmlreference?csw=1#balloonstyle for more information.

Is there anyway to close balloons from placemarks read from kml if this kml was removed while balloon is still showed?

To put it simple, I have some placemarks in KML file, if I load this KML, then click on Placemark - balloon will show.
If i remove that KML, placemark is gone, but balloon still showed.
Anyway to make it close?
This should do the trick to close any open balloon:
ge.setBalloon(null);

How to: place link to another kml file within a placemark

I'm drawing the path of a ship sailing around the world, using a series of kml files, each containing multiple placemarks.
When I click on the last visible placemark, I DO NOT want to open a ballon containing text and a URL to the next file. Instead, I'd like GE to load and "flyto" the kml file that contains the next series of placemarks. So far, I haven't found a way to do this, so I'm wondering if it's possible. If so, how to? Thanks, John
I'm assuming you're using KML in Google Earth. KML doesn't have an "onclick" method for Placemarks like this, when you click on a placemark, it opens up a balloon if there is one to be opened. If you want something more guided, you can do a tour or you can open up a balloon that has a link with a ;flyto method added that takes you to a particular Placemark.

thickbox image gallery

if I display one image link from a folder how can I use this image to create a gallery for that folder using thickbox without having to display all images from the folder.
Btw. from the thickbox homepage
While Thickbox had its day, it is not
maintained any longer, so we recommend
you use some alternatives.
Need to add a hidden div afterwards with the links of all the other images after the first thumbnail. Might be useful to anyone else who has had the same problem.

Resources