Launch Google Earth website and auto load KML file? - kml

I would like to launch the Google Earth website with a URL that would load a KML file from my PC.
Something like:
https://earth.google.com/web?kml=localfile.kml
I know I can bring up https://earth.google.com/web in my browser and then manually load a kml file. But I want to automate this load and not make the user have to go through the steps to manually load the kml file. Any way to automate this at all?

From https://support.google.com/earth/thread/41761002?hl=en
Alas not at this time.
KML support in Google Earth Web is pretty basic, and users may need to manually enable it in settings first.
... hopefully over time the support will mature.

Related

Open SVG as a Google Drawing Programmatically

I have an SVG generated on a webpage. Is it possible to add a link that someone could click on to open the svg in google drawing without having to download it? Ideally it would send the user here: https://docs.google.com/drawings
I have enabled Drive UI integration using https://developers.google.com/drive/v3/web/enable-sdk and I believe I have credentials. I'm not sure how to get a file on Google Drive though & provide a link to a user.

How to display website in SWF files

I would like to create a shockwave file that can display a website with an internal webbrowser or something similar. The final target to display the website in a pdf file, but I think the only way to do this, is the swf trick.
I tried to find resources for this on the web, but found nothing.
UPDATE:
I am looking for a way to display a website in a downloadable pdf file. The website is only one html file fuelled by jquery and css.
Download SWF template for your website and edit it in macro media flash editor.
I would use a PHP script to create a PDF file (my choice for this kind of stuff is TcPDF, which has many example/how to scripts ready to use), and I'd put a captured image of my website in it; there are several websites offering this service for free, just google it, for example webthumbnail.org.
Disclaimer: I'm not linked to TcPDF nor Webthumbnail.org in any way, they are just the first examples that came into my mind.

Need to catalog a large web application

We have a web application with over 560 pages. I would like a way to catalog the site somehow so that I can review the pages (without having to find each on in the menu or enter the URL). Be very glad for ideas on the best way to go about this.
I'd be happy to end up with 560 image files or PDFs, or one large PDF or whatever. I can easily put together a script with all the URLs, but how to pull those up and take a snapshot of some sort and save that to a file or files is where I need help.
The site is written in Java (server) and javascript (client).
I found a great plugin for Firefox that made this relatively painless. The plugin is called Screenshot Pimp (hate the name, love what it does). It takes a snapshot of your browser contents and immediately saves it to a file on your hard drive.
So then I wrote a script that would pull each page up in an IFrame with the URL showing above that, and took snapshots of each page. It took a couple hours to cycle through the whole set of 560+ pages, but it worked great, and now I have a catalog of all the pages.

Why does Google Earth show incorrect images when using google hosted images

Earth often seems to load random images instead of the ones specified in kml. For example load the kml sample from the kml documentation for IconStyle (https://developers.google.com/kml/documentation/kmlreference#iconstyle) It specifies the image at http://maps.google.com/mapfiles/kml/pal3/icon21.png which when viewed in a browser is a building on a green field, but in earth shows up as mountains.
Seems almost as though earth is hard coded to use an internal palette whenever a google hosted image is found and the palettes have gotten out of sync.
(Earth version is 6.2.1.6014 (beta))
I think this is a unfortunate legacy issue.
Google Maps at one point changed around their icons - reusing the same filenames!
Google Earth on the other hand knows that many users where using the specific icons in their Places and KML files. So rather than everybodies icons suddenly changing randomly, they choose to still show the old icons.
Would be funny if it wasn't true!
If you really want to use Google hosted icons, you could use an alternative URL - one that hopefully Google Earth wont attempt to 'fix', eg http://googleapis.com/mapfiles/kml/pal3/icon21.png
But really would not recommend relying on Google Hosted icons. They can change at any point.
If you really don't want to have any problem download the icons you want to use and create a KMZ layer instead of KML. Like that you will be able to have a folder with your images inside and you won't be depending on the hosted ones.

Pass google earth a secure KML file

Is it possible to pass a secure KML file to Google Earth?
This KML file will require either a token or authentication of some sort.
(I'll adapt the solution based on the possible methods of securing the KML file that are acceptable.)
We need to display some secure information on a google map, and yes we are an enterprise customer. (If that helps.)
That alternative is to plot the points using the google API, but that require's slightly more effort.
If your intention is just to protect the Kml from unauthorized access, you can use the following approach. I tried this approach in one of the scenarios and it worked for me.
http://keelypavan.blogspot.com/2011/07/protect-kml-kmz-files-from-unauthorized.html
Just some information..
If you pay Google you can have your website run via HTTPS.
If you want something that's a bit more powerful to play with, you might want to try something like GeoServer with an OpenLayers frontend. It can serve your data dynamically from a postgres database as kml (or kmz, gif, jpeg, png, svg, and even pdf) out of the box. You don't have to code a single line to get that done, and it's free.
And indeed, you could draw stuff yourself by using the Google Maps API, but if your page is HTTPS, your users will get a warning about Google's javascript files.
Furthermore, if your browser sucks (at rendering maps), Google does the actual rendering for you server-side, and for that, the actual data will be sent to Google, and a rendered overlay image will be sent back. Maybe you can disable that behaviour, but at least you should be aware of that if you're concerned about security.
As KML files are loaded by Google servers, you can restrict access to KML file only for Google servers.

Resources