Trusted Member
Master Gamer
April 2015 - Sept 6, 2023 12:33:10 GMT
|
Post by bridgeplayer on Jul 30, 2020 12:10:57 GMT
I have the same question as KeithM in this old Google Groups thread. (There is also a Google Earth Outreach series of YouTube videos which addresses the topic, but it’s a dizzying click, cut & paste fest, using html editors etc., which may work for others but doesn’t for me.) Here is a simple example of what I would like to do. I have three placemarks, of London, Paris and Berlin, and want to add some text and a small image (london.jpg etc.) to each of them, then package the whole in a self-contained kmz file. Meaning, the images should be extracted from the kmz file, not from the internet or anyone’s hard drive. I understand the kmz file needs to contain the usual doc.kml file, plus a folder for the images. My question is: how do I create (or edit) a kml file which can perform this task? I know about the placemark options named Add web image and Add local image, but obviously there is no Package with kmz option. Example code would be great.
|
|
Wizard
March 2015 - Oct 14, 2024 15:03:31 GMT
|
Post by tek on Jul 30, 2020 12:22:11 GMT
<description><![CDATA[<img style="max-width:500px;" src="files/something.jpg">]]></description> Is this line what you are looking for?
|
|
Trusted Member
Master Gamer
April 2015 - Sept 6, 2023 12:33:10 GMT
|
Post by bridgeplayer on Jul 30, 2020 14:20:47 GMT
<description><![CDATA[<img style="max-width:500px;" src="files/something.jpg">]]></description> Is this line what you are looking for?
I made a small test project. I added the code to the description section of the three placemarks, generated a kml file, zipped Bourtange.kml with the images folder named “files”, and renamed it Bourtange.kmz. The images don’t show up when opening the kmz file in GE. Either I made a mistake or GE has trouble with relative paths, as some people say.
|
|
Wizard
March 2015 - Oct 14, 2024 15:03:31 GMT
|
Post by tek on Jul 31, 2020 11:32:52 GMT
The code I quoted is to be inserted into the kml using a text editor like NotePad. If you are instead adding image using the Google Earth application's description window, the kml tags should be removed: <img style="max-width:500px;" src="files/something.jpg"> Attachments:Bourtange.kml (2.83 KB)
|
|
Cartographer
April 2015 - Nov 12, 2024 14:28:33 GMT
“ Armchair Traveller - Love to Roam Google Streets - 8 Star Local Guide of Google Maps „
|
Post by CuriousJM on Aug 2, 2020 9:49:30 GMT
bridgeplayer I don't see any picture in your kml. I just see ]]> . Similarly in Tek's kml, I see a question mark If my understanding is correct you want to insert an image without hosting it on some 3rd party server/hosting service? I doubt if it is possible.
|
|
Wizard
March 2015 - Oct 14, 2024 15:03:31 GMT
|
Post by tek on Aug 3, 2020 17:10:55 GMT
It's because he pasted the code I gave as an example into the description box of his GE. I had assumed Bridgeplayer had been trying out in a text editor like Notepad. But my assumption was wrong.
The image has to be located in a subfolder named "files" within the folder where the kml is saved.
|
|
Trusted Member
Master Gamer
April 2015 - Sept 6, 2023 12:33:10 GMT
|
Post by bridgeplayer on Aug 5, 2020 12:58:58 GMT
In the above kml file (2.93 KB) there are three references to the image bourtange3.jpg (and none to the other two images). It doesn’t affect the testing, but I corrected it anyhow.
The problem is that, at least on my computer, the images still don’t show up. Does it work for you, tek?
|
|
Wizard
March 2015 - Oct 14, 2024 15:03:31 GMT
|
Post by tek on Aug 5, 2020 18:02:17 GMT
|
|