Page 1 of 2
KML file zoom size
Posted: 30 Aug 2016, 22:14
by TenX
Hi,
I created a kml file in Google Earth Pro and uploaded it to my server. Works fine and displays, but now I can't set the Zoom level in the Phoca Maps. Its opens to a default zoom that i can't control. Is there a fix for this?
Thanks.
Re: KML file zoom size
Posted: 30 Aug 2016, 22:53
by Jan
Hi, if you load the KML, then you should set the zoom in KML
Jan
Re: KML file zoom size
Posted: 25 Sep 2016, 04:31
by myaso1488
No! I have same problem. In KML file i cant find ZOOM paremeter.
Re: KML file zoom size
Posted: 25 Sep 2016, 15:34
by Jan
Hi, and as in the first post, you cannot set the zoom in map? (edit of map in Phoca Maps administration?)
See:
https://www.phoca.cz/joomlademo/phoca-maps-kml - zoom is set in Map
Jan
Re: KML file zoom size
Posted: 25 Sep 2016, 17:36
by myaso1488
i can set 3,5,6,7,8 zoom level in administrator panel. But! Maps with marker initialized first with right zoom, but after load kml file - zoom out.
so. My kml file - all world. From America to Japan. With my map widht not all world u can watch. Bu its ok. I can see part of america.
And i set normal zoom and great center position.
KML file i thik wanna see ALL kml objects and set zoom level to 1
Re: KML file zoom size
Posted: 27 Sep 2016, 16:12
by Jan
Hmmm, hard to say, testing here:
https://www.phoca.cz/joomlademo/phoca-maps-kml - the kml is automatically zoomed to see the marked area
Jan
Re: KML file zoom size
Posted: 03 Oct 2016, 01:28
by myaso1488
YES! But, a don't wanna auto zoom to KML area.
That my map after load KML file
http://shot.qip.ru/00Qtrh-5mIrA3NYm/
But i want like that
http://shot.qip.ru/00Qtrh-6mIrA3NYn/
Like without KML - set center, set zoom in administrator panel and get great look.
Re: KML file zoom size
Posted: 03 Oct 2016, 13:44
by Jan
Hi, it is possible, that Google Maps API automatically wants to display all the areas so it automatically adds the low zoom to display all the area. Realyl hard to say, as I am not the developer of the Google Maps API but in some examples I have seen, the area set in KML was automatically zoomed so it is displayed as whole
Jan
Re: KML file zoom size
Posted: 06 Oct 2016, 20:37
by myaso1488
Re: KML file zoom size
Posted: 07 Oct 2016, 18:43
by Jan
Hi, where do you display the maps - in plugin or component?
administrator/components/com_phocamaps/helpersphocamapsmap.php line cca 1070
change
FROM:
Code: Select all
$js = ' var kmlLayer'.$this->_id.' = new google.maps.KmlLayer({ url: \''.$kmlFile.'\', suppressInfoWindows: true, preserveViewport: false, map: '.$this->_map.'});'."\n";
TO:
Code: Select all
$js = ' var kmlLayer'.$this->_id.' = new google.maps.KmlLayer({ url: \''.$kmlFile.'\', suppressInfoWindows: true, preserveViewport: true, map: '.$this->_map.'});'."\n";
Please let me know if this work for you, if yes, I will add it as parameter.
Thank you, Jan