Displaying a KML file with Google Maps

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
rgtr
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Tue Sep 01, 2009 11:31 am
Location: Glasgow
Contact:

Displaying a KML file with Google Maps

Post by rgtr » Sun Mar 28, 2021 2:14 pm

Hi
This is my first plugin, after getting a module to display a Facebook page which works fine.
I am developing in Joomla 3.9.24, and testing on J4.0.0 beta4. Both are working identically.

I have nice simple structure, but I have to be doing something wrong.
The J4 Beta 4 page [not] showing the map, but showing the div and its style [h, w, and border] is all working ok using default parameters, and specific parameters is here:
http://tdocplus.co.uk/0a_Empty400/index.php/map-test.

I have put all the code and all my notes up as well.
http://tdocplus.co.uk/0a_Empty400/index ... e-map-code

I have been looking exhaustively at the code from KKSou, Embed Google maps, and Mike Reumer's Google Maps

I am NOT using the document->addscript method [but have tried it], but adding the script after the div. it shows up like this - taken from view source.

Code: Select all

<div id=map0></div>

<script>
var map0;
var src0 =http://tdocplus.co.uk/lp_routes/lp_wb_top_wood.kml;

function initMap0() {
gmap0 = new google.maps.Map(document.getElementById('map0'), {});

var kmlLayer = new google.maps.KmlLayer(src0, {map: gmap0});}

</script>
I changed all the variable names as that had obviously been a problem for KKSou. Tested all that in the JSFiddle attached - including thinning down the code - to the Google Sample page at:
https://developers.google.com/maps/docu ... script/kml

Normally when no authority is provided one gets a map with a polite message plastered all over it to make it useless - NOT a blank.

Now I am STUCK ! Meaning that I am bereft of ideas as to what to do next.

Some help and or comments would be much appreciated. Anyone want the plugin or an Akeeba backup - just ask.

Richard
Last edited by Per Yngve Berg on Sun Mar 28, 2021 5:31 pm, edited 1 time in total.
Reason: Added code tags around code

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39981
Joined: Sat Apr 05, 2008 9:58 pm

Re: Displaying a KML file with Google Maps

Post by Webdongle » Sun Mar 28, 2021 9:17 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

rgtr
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Tue Sep 01, 2009 11:31 am
Location: Glasgow
Contact:

Re: Displaying a KML file with Google Maps

Post by rgtr » Fri Apr 23, 2021 10:43 am

Hi
Thanks to Google Map Support who straightened me out.
I now have a functioning plugin that works perfectly in both J3.9 and J4.0.0.beta

It can be downloaded here: [ redacted ]

Remember that to use it you need a Google Maps API Key, and it only presents a KML file.
Richard
Last edited by toivo on Sun Apr 25, 2021 2:26 am, edited 2 times in total.
Reason: mod note: URL removed - please observe the forum rules about self-promotion!

rgtr
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Tue Sep 01, 2009 11:31 am
Location: Glasgow
Contact:

Re: Displaying a KML file with Google Maps

Post by rgtr » Thu May 06, 2021 9:16 am

Sad when one makes available to the general public some useful code ... the link is "redacted".

User avatar
mandville
Joomla! Master
Joomla! Master
Posts: 15051
Joined: Mon Mar 20, 2006 1:56 am
Location: The Girly Side of Joomla in Sussex

Re: Displaying a KML file with Google Maps

Post by mandville » Thu May 06, 2021 6:55 pm

rgtr wrote:
Fri Apr 23, 2021 10:43 am
I now have a functioning plugin that works perfectly in both J3.9 and J4.0.0.beta

It can be downloaded here: [ redacted ]
why not put it on the JED then?
HU2HY- Poor questions = Poor answer
Un requested Help PM's will be reported, added to the foe list and possibly just deleted
{VEL Team Leader}{TM Auditor }{ Showcase & Security forums Moderator}


Post Reply

Return to “Extensions for Joomla! 3.x”