Unable to Show KML File in Phocamaps 3.0.0

Phoca Maps - displaying maps in Joomla! CMS
pyrovespin
Phoca Member
Phoca Member
Posts: 20
Joined: 24 Oct 2011, 05:17

Unable to Show KML File in Phocamaps 3.0.0

Post by pyrovespin »

I've tried everything in the instructions, I have a kml file in the phocamapskml folder, and I have set the options I know of in phocamaps but the kml will not show up on my map.. the website 3riversdistrict.com/district-resources/district-area-map any suggestions would be appreciated.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Unable to Show KML File in Phocamaps 3.0.0

Post by Jan »

Hi, I see 403 on your site :idea:

Jan
If you find Phoca extensions useful, please support the project
pyrovespin
Phoca Member
Phoca Member
Posts: 20
Joined: 24 Oct 2011, 05:17

Re: Unable to Show KML File in Phocamaps 3.0.0

Post by pyrovespin »

I forget sometimes that I run Geoip filtering for other countries outside of the us.. I have unlocked it.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Unable to Show KML File in Phocamaps 3.0.0

Post by Jan »

And did it help?
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Unable to Show KML File in Phocamaps 3.0.0

Post by Jan »

Anyway, info for all other who have problem with KML - your site needs to be online to display the KML (cannot be test on localhost)

Jan
If you find Phoca extensions useful, please support the project
pyrovespin
Phoca Member
Phoca Member
Posts: 20
Joined: 24 Oct 2011, 05:17

Re: Unable to Show KML File in Phocamaps 3.0.0

Post by pyrovespin »

The Geoip filtering was what gave you the 403 error, I have removed the filtering so you shouldn't get the error, and it is a production site on a live server. that's been running for several years. We had the kml files working in joomla 2.5 but somewhere in the switch between 2.5 and 3.0 something stopped working.. We use the kml map mostly seasonally and I didn't notice it didn't work until last week..
pyrovespin
Phoca Member
Phoca Member
Posts: 20
Joined: 24 Oct 2011, 05:17

Re: Unable to Show KML File in Phocamaps 3.0.0

Post by pyrovespin »

I looked at the source code of the maps page and noticed that phoca was trying to point to the kml file. I'm thinking it is somehow a problem with my iis configuration I tried just opening the kml file with a link http://www.3riversdistrict.com/phocamap ... strict.kml and i get a 404.3 error from my server.. and I'm curious if that could be the problem.
pyrovespin
Phoca Member
Phoca Member
Posts: 20
Joined: 24 Oct 2011, 05:17

Re: Unable to Show KML File in Phocamaps 3.0.0

Post by pyrovespin »

nevermind, I fixed the 404.3 error by adding a mime type to kml in iis, that is not the problem.
pyrovespin
Phoca Member
Phoca Member
Posts: 20
Joined: 24 Oct 2011, 05:17

Re: Unable to Show KML File in Phocamaps 3.0.0

Post by pyrovespin »

found the problem, in phocamapsmap.php on line 939 I needed to replace:

function setKMLFile($kmlFile) {

$js = ' var kmlLayer'.$this->_id.' = new google.maps.KmlLayer( \''.$kmlFile.'\');'."\n"
.' kmlLayer'.$this->_id.'.setMap('.$this->_map.');'."\n";
return $js;
}

with

function setKMLFile($kmlFile) {

$js = ' var kmlLayer'.$this->_id.' = new google.maps.KmlLayer({ url: \''.$kmlFile.'\'});'."\n"
.' kmlLayer'.$this->_id.'.setMap('.$this->_map.');'."\n";
return $js;
}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Unable to Show KML File in Phocamaps 3.0.0

Post by Jan »

Hi, thank you for the info, I will take a look at it (for me it works without url item, but maybe there is some problem for different addresses)

Thank you for the info.
If you find Phoca extensions useful, please support the project
Post Reply