There is the possibility to create one marker and display it with the WP OSM Plugin. If you want to display several markers in a map you should keep these markers in a file and manage them separate. This can be done with:
- text file that uses tabs to format
- text file that uses the KML standard
A great tool to create and manage such KML files is the free tool Viking. It’s absed on layers and let’s you export an layer as KML file. The steps to create an KML file for visualisation are:
* install Viking on your system
* load the OpenStreetMap layer (green plus):
* Create a TrackWayPointLayer for your markers (again green plus):
* Set your marker in the layer (button with green plus and blue flag).
* Export the layer as KML file
* Open the KML file in a text editor and replace the icons (all png addresses) to:
http://www.YourDomain.com/wp-content/plugins/osm/icons/mic_photo_icon.png
or any other icon from this list.
* Add the KML file in your map:
[*osm_map lat="40.715" lon="-74.009" zoom="15" width="600" height="450" map_border="thin solid grey" file_list=="../../../../wp-content/uploads/sites/2/2015/01/TrackWaypoint.kml"]
Hi MiKa,
I would like to ask you few questions before I proceed.
I use wp and would like to send an image about our plan to you before making more questions.
One picture is more than 1000 words!
Best regards
Erkki
Hi MiKa,
thanks for this great plugin.
I spended a lot of time, but I cannot find the solution.
KML-File
vWordPress OpenStreetMap Plugin
Liegenschaften
../../../../wp-content/plugins/osm/icons/mic_black_camera_01.png
1.00
Plattenburg
<![CDATA[
Plattenburg
Text is more readable and
easier to write when you can avoid using entity
references.
]]>
#Kamera
12.0299,52.9588
Shortcode:
[osm_map_v3 map_center= "52.9658,12.0271" zoom="11" width="95%" height="450" map_border="thin solid" kml_file=“http://saldern-familienverband.de/wp-content/uploads/osm_map/Saldern.kml“ control=””]
BTW: You live in Graz? Next visit I will drink a beer with you oder whatever else.
Kind regards
Matthias
Hallo Matthias,
Dein File habe ich hier getestet und auch den Shortcode angepasst:
https://wp-osm-plugin.hanblog.net/forum-test-page/
Du musst nat. den Stern entfernen und auch den Ort zum KML file bei Dir anpassen – am besten wie im Beispiel relativ.
Br, Michael
Moin moin aus Lüneburg,
danke für die Mühe. Es funktioniert nun alles.
Lieber Gruß
Matthias
Hallo Matthias,
danke für die Rückmeldung. Wir freuen uns natürlich über eine Bewertung hier:
https://wordpress.org/support/plugin/osm/reviews/
Danke & br, Michael
Bonjour,
J’ai un petit souci. J’ai suivi les différentes étapes mais je n’arrive pas à afficher les marqueurs sur la carte.
J’ai fait le calque KML sur viking, exporter le calque, changer les 2 lignes png sur le fichier texte KML, et je pense que je ne fais pas ensuite ce qu’il faut pour l’intégrer correctement sur la page.
J’ai téléchargé le fichier sur notre hébergeur et changé le shortcode sur la page mais rien ne se passe :
“[osm_map_v3 map_center= "-9.5970,-74.6980" zoom="5.092860838595564" width="95%" height="450" map_border="thin solid "file_list == "home/jonpap4/lestworistes.com/wp-content/uploads/Lima.kml "] ”
Avez-vous une solution à me proposer ?
Hi claire,
file_list==”” should be files_list=””
br, MiKa
Bonjour,
Merci pour votre retour. Je viens de modifier le code mais les marqueurs n’apparaissent pas.
J’ai donc 2 questions :
– 1 seul fichier KML avec 9 marqueurs suffit ou il faut que j’en fasse un par marqueur?
– J’ai téléchargé le fichier KML directement sur le site de mon hébergeur. Est-ce bien la bonne méthode ?
Bonne soirée.
Hello Claire,
1.) Yes, one kml file for all your markers is fine
2.) Yes, the file has to be on the same domain as the map, for you somewhere at http://www.lestworistes.com/wp-content/uploads/..
Feel free to post a link to check your kml file.
Br, MiKa
Bonjour,
J’ai du me tromper en uploadant le fichier directement sur mon hébergeur car le lien http://www.lestworistes.com/wp-content/ uploads /. . ne fonctionne pas.
Désolée, je débute sur wordpress, mais pouvez vous m’indiquer comment charger un fichier ?
Bonne soirée.
Hello Claire,
do you have FTP access?
Br, MiKa
Bonjour,
Je n’en avais pas, je viens de télécharger FileZilla. Je me suis connecté et j’ai téléchargé le fichier KML dans mon dossier upload.
Mais je ne vois pas comment utiliser le fichier avec la carte OSM sur wordpress.
Regards.
J’ai également le message d’erreur :
[OSM-Plugin-Error]:Array hast got wrong file extension (gpx, kml)!
Can you post the link to the KML file?
Bonjour
Je n’y arrive pas.
J’ai pourtant téléchargé le fichier avec filezilla.
/home/jonpap4/lestworistes.com/wp-content/uploads/Fichiers KML/Perou.kml
Bonjour,
Je suis désolée mais auriez-vous un mode d’emploi plus complet pour débutant à m’envoyer par mail ?
J’ai le fichier KML fait sur viking mais je ne sais pas comment le mettre sur wordpress et l’utiliser avec OSM.
Et je ne sais pas s’il faut des plugins en particulier pour lire le fichier en question.
Hello Claire,
I do not have anything else but only the website. Just post a linke to your kml file, something like:
http://www.MyWebsite.Com/wp-content/uploads/Fichiers KML/Perou.kml
To makes sure your link is correct just paste it in your browser and check if you can load it.
Br, MiKa
Bonjour,
Veuillez trouver le lien : http://www.lestworistes.com/wp-content/uploads/Fichiers%20KML/Perou.kml
We will check it at the weekend and let you know the way you have to integrate it.
He Claire,
I modified one iconstyle in your KML file. Find the demo and the shortcode (without “*”) here:
https://wp-osm-plugin.hanblog.net/forum-test-page
Here is the KML file:
https://wp-osm-plugin.hanblog.net/wp-content/uploads/plugin_test/Perou.kml
Br, MiKa
BTW: If you like the plugin, then rate it here:
https://wordpress.org/plugins/osm/#reviews
Bonjour,
Merci pour le fichier mais je n’arrive toujours pas à le lire. Dois-je le rentrer dans l’onglet “Carte et GPX | KML” du fichier ou directement sur la page ?
Dois-je avoir un plugin spécifique pour lire les fichiers kml sur wordpress ?
Hello Claire,
it should work the same way you upload a JPG photo …
Br, MiKa
I had a hell of a time getting this to work, but I finally did. Here’s VERY basic starter code for your KML file and WordPress post. It uses two different marker icons and shows two locations…..
FIRST create a text file and give it a name. In this example, I’ll name it “mypoints.kml”
Then paste the first part of the code you find here:
https://jsfiddle.net/asr2e1fv/1/
Be sure to change “EXAMPLEDOMAIN.COM to whatever your domain actually is (and fix the path as you need to). You can view all the available icons in that folder.
SAVE THE FILE SOMEWHERE IN YOUR WORDPRESS DIRECTORIES. I SUGGEST IN YOUR UPLOADS FOLDER. In this example I am saving it to my uploads/2017/10 folder.
Then put the second bit at the bottom of the code from that jsfiddle (above) into your page/post/custom post type.
Again, DON’T FORGET to change EXAMPLEDOMAIN.COM to whatever your domain is. And edit the path to correctly match where you put that KML file.
ONE FINAL THING….. If for some reason your markers don’t show up, make sure you haven’t entered the Longitude and Latitude backwards. If you’re pulling those from Google Maps, I’ve found Google to sometimes list Latitude before Longitude!
I hope this will help someone down the line…..
I had a hell of a time getting this to work, but I finally did. Here’s VERY basic starter code for your KML file and WordPress post. It uses two different marker icons and shows two locations…..
FIRST create a text file and give it a name. In this example, I’ll name it “mypoints.kml”
Paste the following into the file:
WordPress OpenStreetMap Plugin
OSM-Plugin-Demo
http://EXAMPLEDOMAIN.COM/wp-content/plugins/osm/icons/mic_blue_pinother_02.png
http://EXAMPLEDOMAIN.COM/wp-content/plugins/osm/icons/mic_blue_information_01.png
New York —
A description that appears in the popup.
#BlueIcon
-73.996195,40.731500
Philadelphia —
This one is using the Blue Info icon.
#BlueInfoIcon
-75.160746,39.936968
Be sure to change “EXAMPLEDOMAIN.COM to whatever your domain actually is (and fix the path as you need to). You can view all the available icons in that folder.
SAVE THE FILE SOMEWHERE IN YOUR WORDPRESS DIRECTORIES. I SUGGEST IN YOUR UPLOADS FOLDER. In this example I am saving it to my uploads/2017/10 folder.
IN YOUR WORDPRESS PAGE/POST:
This is what in you would put in your page/post/custom post type (in the regular WordPress content editor of course):
[osm_map_v3 map_center="40.341160,-74.64988" zoom="5" width="100%" height="480" control="scaleline" file_list="http://EXAMPLEDOMAIN.COM/wp-content/uploads/2017/10/mypoints.kml"]
Again, DON’T FORGET to change EXAMPLEDOMAIN.COM to whatever your domain is. And edit the path to correctly match where you put that KML file.
ONE FINAL THING….. If for some reason your markers don’t show up, make sure you haven’t entered the Longitude and Latitude backwards. If you’re pulling those from Google Maps, I’ve found Google to sometimes list Latitude before Longitude!
I wanna know how can I simulate the real movement of one or more markers at the same time, changing its coordinates. Is it possible?
Hello Mika!
thank you for the plugin.
I’m having troubles to display the markers in the map with the kml file.
Should it still work? or something has changed?
I’ve followed all the steps you say. I can’t find de error.
Thank you very much.
Hello! thank you for the plugin.
I have problems with the markers file. I have done the kml file, changed the icon address. Upload the icon file in the plugin folder.
Written the code, but nothing happends. It only appears the map, without anymarker.
What am I doing wrong?
Thnank you for your help!
Hello MiKa
you wrote here of the two alternatives to manage multiple markers:
text file that uses tabs to format
text file that uses the KML standard
The kml-file solution is well explained.
Can you give some advice or an example for tab-delimited format?
Thanks a lot.
hajo
Hello hajo,
the tab – text file is not supported anymore … sorry. Let me know if you miss something in the KML file.
Br, MiKa
Hey MiKa, related to my previous questions: please could you tell me, why the “hotSpot”-method described here https://developers.google.com/kml/documentation/kmlreference#iconstyle does not work for the WP OSM Plugin? My KML file is working fine with Google Earth (http://www.geographie.nat.uni-erlangen.de/wp-content/uploads/PanoramaTrail_WP.kml). Thank You!
Hi! First of all: Thanks for the great Plugin!
I have a question on how to display
-one or multiple gpx/kml track-file/s
-combined with one ore multiple gpx/kml waypoint-file/s.
To get an idea of what i mean, see http://s33.postimg.org/yz4j7ws5b/mehrere_Marker.png
Would be great if you can help me! Thanks!
–solved the issue following your instructions and the kml reference here: https://developers.google.com/kml/documentation/kmlreference?csw=1#elements-specific-to-groundoverlay
atm i cannot get my icons working properly with the -method – when you zoom in or out, the icons move around the point they should be on (same problem occurswith your example here). As a solution for this, i enlarged my icon-pngs by the half of their height, with anchor at top of image, and it works. Maybe you have a better/neater solution.
screenshot of my map here: http://postimg.org/image/z4yappr0b/
Hi,
thanks for the tutorial.
I Tried this – exported a KML from Viking and put it in WordPress OSM. But:
No Pop-Up boxes with text. How do you do this? How did you add the popop boxes with text?
Hello MiKa,
I followed the steps described above except for the latitude and longitude because I used map_center instead. This is map code I’m using:
[*osm_map_v3 map_center=”50.907,5.268″ zoom=”9″ width=”100%″ height=”450″ map_border=”thin solid blue” kml_file=”/wp-content/uploads/limburg/TrackWaypoint.kml”]
The map shows up at this page:
http://cng.muscleboykanan.com/vlaanderen/limburg/
but without the three CNG Filling Stations of Bree, Hasselt and Heusden-Zolder.
(Viking is also available for Arch Linux. I’m using Bluestar Linux which is based on it. When I go to http://cng.muscleboykanan.com/wp-content/uploads/limburg/TrackWaypoint.kml
it opens and loads fine in Marble, and the filling stations do show up there.
I first tried the value “http://cng.muscleboykanan.com/wp-content/uploads/limburg/TrackWaypoint.kml”, but that didn’t help. I already had to remove control=”mouseposition,scaleline” and theme=”dark” because no map shows up with those two things.
Hello Marko,
copy this file: http://wp-osm-plugin.hanblog.net/wp-content/uploads/osm_map/OSM_02.kml and try the first osm shortcode from here: http://wp-osm-plugin.hanblog.net/examples/display-kml-file/ and post a link to the test page. Correkt the file tag to:file_list=”../../../../wp-content/uploads/limburg/TrackWaypoint.kml”
Br, MiKa
Hello again MiKa,
As you can see here http://cng.muscleboykanan.com/wp-content/uploads/limburg/TrackWaypoint.kml I copied your KML file but removed the code with the lining because I don’t want to see the red and black lines. I also changed the file tag to:file_list=”../../../../wp-content/uploads/limburg/TrackWaypoint.kml” in my page.
I first forgot to rename kml_file, and nothing changed. But when I reread your answer, I saw it and when I renamed it to file_list, it works !
Normally it will also work with the small logos of the brands of the filling stations, I noticed. I see that I should keep them small, something around 16px to 20px and in that case setting scale to 1.00
It’s a bit weird that when clicking on the icon in the map, such a small window appears, that the width is quite small. Can this also be changed in the KML file?
I already thank you for what you have done up until now!
Hello everyone,
I’m trying to get my shortcode to work by mapping an KML file of locations of monitoring sites via stagbeetlemonitoring.org
File: https://www.stagbeetlemonitoring.org/wp-content/uploads/transectslocs-1.kml
My KML locations shows up when I use a random website to visualize its contents.
I’m using the following shortcode:
[osm_map_v3 file_list="../../../../wp-content/uploads/transectslocs-1.kml"]
For this webpage: https://www.stagbeetlemonitoring.org/map-test/
However, it doesn’t work and I was wondering if a more advanced user of the OSM plugin may suggest a solution. I would greatly appreciate this!
He Damian,
there were some issues in your KML file. We corrected it and added three of your placemarks. Find the demo and the shortcode (without “*”) here:
https://wp-osm-plugin.hanblog.net/forum-test-page
Here is the KML file:
https://wp-osm-plugin.hanblog.net/wp-content/uploads/plugin_test/transectslocs-1.kml
Br, MiKa
BTW: If you like the plugin, then rate it here:
https://wordpress.org/plugins/osm/#reviews