Page 1 of 1

Re: Trouble getting KML file to load

Posted: 30 Mar 2010, 08:06
by joortje
Maybe you're looking at it in internet explorer (not supported), but I guess not. What you could do is post the kml file, so I can test.

I will test it using version 1.0.5 and the improvement I posted in this topicviewtopic.php?f=38&t=7475.

Re: Trouble getting KML file to load

Posted: 28 Aug 2010, 15:13
by bcordis
I have Phocamaps 1.1.0
and i still am not able to get it to load
https://www.nfsda.org/soul-1000-136.html
http://www.nfsda.org/custom/1000.kml
or http://www.nfsda.org/custom/kmloptions.php
Can you look and see what is making this not work.

Re: Trouble getting KML file to load

Posted: 03 May 2011, 20:42
by snoopy1978
even if this post is one year old, me too wasn't abled to load kml files to my map, but after a little bit of searching i found the solution what could be interesting for other people:

When everything is set correctly (1. KML File load enabled in PhocaMaps configuration, 2. KML File uploaded to phocamapskml, 3. including kmlfile=1 as option in the {phocamap...} - line), in Firebug you can see:

geoXML3 is not defined
var phocaGeoXmlPlgPM1 = new geoXML3.parser({map: mapPhocaMapPlgPM1});

So it seems that there is a .js not loaded.

Indeed, there is a bug in the actual Phocamap version (1.1.1):
In Apache Log you can see, that the file [JOOMLA_ROOT]/components/com_phocamaps/assets/js/geoXML3.js
could not be found.
And yes, the file is named: geoxml3.js

A simple rename from geoxml3.js to geoXML3.js solved this issue.

Could it be, that PhocaMaps is developed in case-insensitive OSes wheras it will run in case-sensitive ones? ;)

Greetings
Snoopy

Re: Trouble getting KML file to load

Posted: 04 May 2011, 23:01
by snoopy1978
There is one more thing i figured out:

The hosters webserver may not know / automatically recognize the mime type

application/vnd.google-earth.kml+xml

which is needed by the geoXML parser. If the mime type in the responeses header is another than the mentioned, the parser will not process the kml as it things, it is another format. You then will see:

Unable to retrieve <filename.kml>

as an output of geoxml3.js.

The solution is to put this line in a .htaccess in the root directory of your site, if it's possible:

AddType application/vnd.google-earth.kml+xml .kml

Greetings
Snoopy

Re: Trouble getting KML file to load

Posted: 07 May 2011, 06:15
by seasamin
A simple rename from geoxml3.js to geoXML3.js solved this issue.
I have been likewise struggling to get kml file to load onto the map for several days now. This fix worked immediately to display the waypoints/place-holders from my kml file and data pop-ups for clicking those points. But it does not draw the lines between these points.

Found several other kml loading Joomla tools also did not work. But the mod_pro_googlemaps module extension does it perfectly. However I want to load many kml file maps in my site and would much prefer the PhocaMaps component to do it.

Has anyone also found the above fix working but without the lines joining the markers? (I also tried the htaccess fix but no noticeable effect to my specific issue)

Re: Trouble getting KML file to load

Posted: 26 Jul 2011, 21:26
by Jan
Hi, since 2.0.1 the standard internal function for KML will be used.

Jan