Displaying a KML file into a Wordpress website

Alex Burke

Hero Member
Apr 3, 2013
869
700
NorCal
Detector(s) used
BH, GB2
Primary Interest:
Prospecting
Does anyone have a better way to display a KML file on a base map than what I have been able to find. I have figured out how to put the KML file into the root index way deep in the FTP (FileZilla) and display it using one of the popular plugins like maps marker or the like but this just seems like a nightmare personally as I am prone to blow up my whole site with a simple mistake in the directories...

I found and will try this code this week and obv it works but before I use this time consuming method and code every kml am I missing a far simpler plugin, short code generator or way to display a simple KML?!!!:)

https://developers.google.com/maps/documentation/javascript/tutorials/kml#your_kml_file
 

Clay Diggins

Silver Member
Nov 14, 2010
4,883
14,251
The Great Southwest
Primary Interest:
Prospecting
If you want simple to display two or three layer maps your best choices are all based on javascript. The simplest and most popular of the javascript maps is Leaflet.

One of the big advantages of of Leaflet map compared to google system maps is your users won't be tracked by the mapping software itself. All that tracking creates slower page loads, bigger bandwidth consumption and gives the advantages of all the work you do to google - for free (read the license).

With Leaflet your users don't have to have a plugin like the now dead Google Earth browser plugin. All the map code can be in your individual HTML webpage but there are better ways to do it by learning how to include libraries and files in your webpage. If you keep the maps small and simple they load pretty quick. You will have to learn some simple Leaflet specific javascript but the learning curve is not near as steep as other map platforms.

When you move to a server based mapping system the possibilities are nearly endless. To make complex interactive maps you will need to learn PHP, Javascript, HTML and one of the big mapping library languages like OpenLayers as well as having a working mapserver or geoserver installation. That's not really going to be feasible within a Wordpress framework. That's why you are stuck with simple javascript maps like Leaflet.

There is a Wordpress Leaflet plugin that can help you put Leaflet maps into your Wordpress framework. If you don't mind slow responses (I'm really busy these days) I can give you some code examples and help you track down problems in your maps. Just PM me after you get the plugin installed. :thumbsup:

Everything I linked to in this post is free to download, use and modify.
 

OP
OP
Alex Burke

Alex Burke

Hero Member
Apr 3, 2013
869
700
NorCal
Detector(s) used
BH, GB2
Primary Interest:
Prospecting
Thank you Clay! I have the leaflets plugin and it will work but I thought I was missing something simple to display the kml file over the base map but you have confirmed my suspicions:) I am going to look at possibly including the files in the page as you mentioned, that link was very helpful.

I am fascinating at the idea of maybe displaying CSV files in the leaflets plugin. I got it to work the other day almost.. I need to figure out how to change the template that reads and displays the CSV code to display the coords location, not the place name and change a couple of other categories, but I think it could be interesting to be able to display CSV files?Anyways, thanks again for the reply and good advice:)
 

Last edited:

Top Member Reactions

Users who are viewing this thread

Latest Discussions

Top