[Mediawiki-l] Placing Google Earth *.kml, *.kmz files within a wiki page

Andrew Lowe andrew.lowe at quantm.net
Thu May 25 01:45:01 UTC 2006


> -----Original Message-----
> From: mediawiki-l-bounces at Wikimedia.org 
> [mailto:mediawiki-l-bounces at Wikimedia.org] On Behalf Of Brion Vibber
> Sent: Wednesday, 24 May 2006 6:00 PM
> To: MediaWiki announcements and site admin list
> Subject: Re: [Mediawiki-l] Placing Google Earth *.kml, *.kmz 
> files within a wiki page
> 
> Andrew Lowe wrote:
> > 	One of my users wishes to be able to place Google Earth, GE, 
> > *.kml/*.kmz files within a wiki page. In turn he wants to 
> be able to 
> > click on the link and have it load up GE, GE moving to the 
> coordinates 
> > etc within the file. Any ideas as to how I would do this? I've done 
> > some googling and not found anything like this.
> 
> You mean, how to create a URL that links to a file? Same as 
> any other file...
> 
> http://example.com/my-cool-file.ext
> 
> [http://example.com/my-cool-file.ext A text link]
> 
> [[Media:my-cool-file.ext|Text link to a file that was 
> uploaded to the wiki]]
> 
> -- brion vibber (brion @ pobox.com)

	This is what happens when you try and do something 10 minutes
before knock off and it doesn't work - hence the post. This morning I've
tried some other things and what follows is my experience:

Placed the following line in LocalSettings.php:

$wgFileExtensions = array(...defaults...., 'kml', 'kmz');

Then I logged in and hit the "Upload File" link. This dropped me in the
Special:Upload page. I hit the browse button and selected a *.kml file.
I filled in the destination name and description, hit Upload and get a
page with:

This file contains HTML or script code that may be erroneously be
interpreted by a web browser.

in big red text across it - but no  mention of it not uploading. I then
entered the [[media... link, saved my page and then hit the link.
Instead of GE firing up, I instead get directed to the Special:Upload
page again. Rummaging around in the db I only found the reference to the
uploaded file in the imagelinks table, due to my page reference. Posted
to list and went home.

	This morning tried the same thing again with another *.kml file
and once again got the red text. Next I tried a *.kmz file and lo and
behold, it worked. I uploaded the file, no red text warning this time,
although there is a warning about:

Warning: This file may contain malicious code, by executing it your
system may be compromised.

in its description page. I linked to file in my test page, saved, then
hit the link. Next thing I know GE is firing up moving to the
appropriate place.

	I've subsequently added entries for *.kmz/*.kml to the
mime.types/mime.info files.

mime.types:
	multimedia/kmz kmz kml

mime.info
	multimedia/kmz		[MULTIMEDIA]

Should I have added this mime info? Whilst looking through the mime info
I noticed that IGES was there so I thought that if IGES is there , then
kmz should be as well. One thing that I did notice is that after adding
this stuff, that after uploading another *.kmz file that it still
reports the mime type as unknown/unknown - shouldn't this be
multimedia/kmz?

	If you've got this far, my observations are as follows:

1) For some reason MediaWiki does not like *.kml file, the ASCII version
of the GE files. Should it?

2) *.kmz files are reported as being unknown/unknown MIME types even
though I think I've added the mime info in all the correct places.
Should this info be placed somewhere else as well?

	Well that's my experience with adding Google Earth data to a
MediaWiki installation. I think things are now working from the wiki's
point of view. Now I've just got to work out why Firefox is asking me
everytime I click on one of these links if I want to open it using GE -
even though I've got the "Do this automatically..." button checked!!!!

	Regards,
		Andrew Lowe



More information about the MediaWiki-l mailing list