A request for Google Earth users

  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Posts: 1417
  • Loc: 55° N, 3° W

Post 3+ Months Ago

Could anybody that uses Google Earth perhaps click this link:

http://[link removed by OP].com/flyto.php?lat=16.360&long=145.655&place=Anatahan&group=Mariana+Islands (it's my own site, so I guarantee nothing bad will happen).

I seem to be having some issue with this in that it dosen't work for some people. If it works correctly for you, then you should see a file download message and then Google Earth should open and zoom to the coordinates in the link. It may be a browser issue, a server issue or something else that prevents it doing what it should for some people.

How can you help? Just click the link, see if Google Earth opens and takes you to Anatahan. If it does or does not work then you can tell me your OS/browser combo too.

Thanks for your time.
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Posts: 3318
  • Loc: Trout Creek, MT

Post 3+ Months Ago

It appears to be working for me, but my computer is slow so google earth isn't completely started yet. But so far so good.

edit: It does work.
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Posts: 1417
  • Loc: 55° N, 3° W

Post 3+ Months Ago

Cool, thanks for testing.

Can I check that you did see a volcanic island in close up, a big caldera and crater?
Were you using IE7 or FF3? Or perhaps something else?



FF3 and IE6 are causing a problem for some. Opera doesn't work for me.

I really don't even know if it's actually a browser issue as such as it seems to be different for different users. Perhaps a browser config issue?
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Posts: 3318
  • Loc: Trout Creek, MT

Post 3+ Months Ago

I'm on firefox 3, and it worked but it went a wee bit slow. When I clicked your link it opened in a new tab, then the tab closed, then the download dialog window came up and I hit open with google earth, and google earth took its precious time starting up and the globe spinned in to a little island in the pacific with a mountain and big crater on it viewed from an angle instead of straight down.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23458
  • Loc: Woodbridge VA

Post 3+ Months Ago

IE7 worked just fine.
FF3 started to work just like kc0tma described but as soon as it downloaded, even though I had told it to open with Google Earth, it defaulted to Dreamweaver which is my default php editor. Not quite certain at all why it did that.
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Posts: 1417
  • Loc: 55° N, 3° W

Post 3+ Months Ago

ATNO, that kind of sounds like the problem I've been hearing about. It seems that some systems (here I'm just guessing) are seeing the php file that the link points to rather than the kml file (google earth file) that the php file writes on the fly... or something.

It may be something to do with the weird MIME type stuff that google earth requires.

I might ask around the google earth/maps type lists and see what is going on as I don't have a clue.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23458
  • Loc: Woodbridge VA

Post 3+ Months Ago

This is interesting. I actually didn't know this existed but now I want to use it, so I did a little digging around. I worked around the Firefox Issue.

Basically you have to have administrative access to your server to do this, but if you add the KML MIME Type: application/vnd.google-earth.kml+xml For Apache: AddType application/vnd.google-earth.kml+xml .kml I found the MIME Type info at the bottom of this page http://code.google.com/apis/kml/documen ... kml_server

I did that on my Windows server and saved your kml file as a kml file and it works just fine in FF3. HOWEVER, oddly it doesn't work in IE7 and I'm not certain why. It brings up the Open/Save dialog box but if you click Open it does nothing. If you click Save it errors that it cannot find the server. Not sure why it's doing that because obviously it found the KML file and read enough to initiate the download. I think maybe the "server" it's talking about is the XML name space http://earth.google.com/kml/2.1 because right now that displays a 404 and I can't open it in HTML-Kit or Dreamweaver either. Not sure why that would affect IE and not FF though. If I figure it out, I'll let you know.

Anyway, here's the KML file that works in FF
http://www.alaron-nuclear.com/ozzu/flyto-1.kml
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Posts: 1417
  • Loc: 55° N, 3° W

Post 3+ Months Ago

I remember reading that particular kml documentation page when I first started doing this a year or two ago. At the time, I wrote to my hosts asking them to configure the Apache httpd.conf for the correct MIME type. They never bothered answering, so I took it no further - they are quite useless at times.

Instead, I stuck that sort of info in the php file:
Code: [ Select ]
 
<?php
header("Content-type: application/vnd.google-earth.kml+xml");
 
 
the full code is available in the programming forum
(I posted it in there before I figured it was not really appropriate for there)
 
  1.  
  2. <?php
  3. header("Content-type: application/vnd.google-earth.kml+xml");
  4.  
  5.  
  6. the full code is available in the programming forum
  7. (I posted it in there before I figured it was not really appropriate for there)
  8.  


Since it worked perfectly (or so it seemed) I thought no more about it. Then today I get some feedback via the site contact form that the GE links don't work.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23458
  • Loc: Woodbridge VA

Post 3+ Months Ago

This works.

http://www.alaron-nuclear.com/ozzu/kml-test.html

Still linking to and using the KML file, but if you view the anchor link in page source see how I include the mime type.
Code: [ Select ]
<a href="http://www.alaron-nuclear.com/ozzu/flyto-1.kml" type="application/vnd.google-earth.kml">KML Test</a>

Tested in
IE7
FF3
Safari for Windows 3
Opera 9.5 (Opera users have to add the mime type manually first: application/vnd.google-earth.kml {don't include the "+xml" part} in Preferences>Advanced>Downloads, then close and re-open Opera for it to work)
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Posts: 3318
  • Loc: Trout Creek, MT

Post 3+ Months Ago

I think I would do as ATNO has done and go with the kml because then if people are using some other program for their 3d digital maps it might still work for them. Like in my office we have arc view GIS stuff which I don't think will open php files, but it does the kml\kmz files like pie.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23458
  • Loc: Woodbridge VA

Post 3+ Months Ago

Update to this. I just tested this with KMZ packages too and it works just as well. All you have to do is change the mime type in the link

http://www.alaron-nuclear.com/AlaronKMZ.html

(Yes, that's where I work *smiles)

I like the KMZ because I can look up any location in GE and then just email myself the package. Already has the KML written nice and tidy. For reference, WinRar will unzip the KMZ package and the KML opens the best in Dreamweaver for any editing you may want to do.

I'm really glad you brought this topic up Zwirko. Learned something new and useful this week!
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Posts: 1417
  • Loc: 55° N, 3° W

Post 3+ Months Ago

Hi,

Glad you took the time to look in to this issue. What you have there looks promising. I can't try it myself right now (due to the shifts I'm working) but I'll definately be testing this out come Monday.

Thanks.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23458
  • Loc: Woodbridge VA

Post 3+ Months Ago

Bad news.

Guess what. I just tried setting this up on one of my personal websites on a host different from my work server. It appears that even with the Mime type in the link, the Mime type still has to be added to the host server in order for the browser to know what application to associate it with.

I didn't attempt the KML, but without the KMZ mime type on the server, my browser interpreted it as a .zip file and blew the whole theory right out of the water.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

What happens if you have PHP send the Content-Type,

Code: [ Select ]
header("Content-type: application/vnd.google-earth.kml+xml");


Generate links like this,

Code: [ Select ]
http://domain.com/pattern.kml


and rewrite kml via htaccess/etc

Code: [ Select ]
RewriteRule (pattern)\.kml$ kml.php?pattern=$1
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Nevermind, I'm getting lazy on the reading lately.
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Posts: 1417
  • Loc: 55° N, 3° W

Post 3+ Months Ago

Old post, I know, but if anyone else runs into this problem and lands here then read on...

Long story short: if you are generating kml files on the fly with something like php then it is important to be sending the correct headers.

In addition to the header I was using previously:

Code: [ Select ]
header("Content-type: application/vnd.google-earth.kml+xml");


I also added this one:


Code: [ Select ]
header("Content-Disposition: attachment; filename=\"foo.kml\"");


So far it seems to working well.

Post Information

  • Total Posts in this topic: 16 posts
  • Users browsing this forum: No registered users and 3 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.