Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-03-03 15:44:19

ToK
Plugin Author
Registered: 2014-02-18
Posts: 25

tok_osm_leaflet

I just made my first few lines of code available to the public — it’s a plugin for the textpattern cms:

tok_osm_leaflet displays a map based on OpenStreetMap data using the leaflet javascript library. Width and height of map div are configurable and of course the portion to be shown. A marker may be set on the landscape for adding a textual comment. A detailed instruction with examples is included on the plugins help page.

You find this plugin at github

I’d be glad, if someone would have a look, if it works as expected and the documentation makes sense, before I’ll add it to the textpattern resources page.

TIA

10.4.2015: released version 0.3

New Features

  • It is now possible to have multiple maps per page
  • Locally stored (and maybe customized) code and style can be used

Last edited by ToK (2015-04-09 22:28:01)

Offline

#2 2014-03-03 23:34:27

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,313

Re: tok_osm_leaflet

Hi Torsten,

thanks for this plugin, it’s super easy to apply: copy the tag, enter the coordinates, view.
The help text is detailed and understandable, perfect. (Total OSM beginners might want to know how to get the coordinates, though.)

Now I’d like to ask for a silly thing: please exchange the lat and lon attributes, my first attempt for Cologne threw me into the Indian Ocean, and the correct values for Paris did likewise. I checked thrice, seems like they’re both swapped, for marker and center. (Don’t forget to adjust the examples on the help page.)

Thanks again for all your work on this!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2014-03-04 13:26:07

ToK
Plugin Author
Registered: 2014-02-18
Posts: 25

Re: tok_osm_leaflet

Wow, I mixed up latitude and longitude — that’s quite heavy in a map plugin. Should be corrected now. Thank you for your attention.

Offline

#4 2025-02-19 19:27:14

mistersugar
Member
From: North Carolina
Registered: 2004-04-13
Posts: 147
Website

Re: tok_osm_leaflet

Is anyone currently using this plugin? I’ve just tried it and can’t get it to work. I see it is trying to pull from an obsolete cdn, and my attempt to host the current leaflet files didn’t work. Alternatively, is there another easy way to serve maps (not Google!) in a Textpattern site?

Offline

#5 2025-02-19 21:37:03

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,112
Website Mastodon

Re: tok_osm_leaflet

uli wrote #279399:

my first attempt for Cologne threw me into the Indian Ocean

hopefully it was on a warm beach with a beer cooler nearby.


…. texted postive

Offline

#6 2025-02-19 22:47:31

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,851
Website GitHub

Re: tok_osm_leaflet

mistersugar wrote #339109:

Is anyone currently using this plugin?

I don’t think I’ve ever used that plugin but I have included non-Google maps using MapBox GL JS, which use OpenStreetMap data but has way nicer maps. If your site isn’t high volume, you’ll be fine on the free plan. It’s well documented with numerous examples for things likes points of interest and popovers, as well as a range of built-in map styles. I’ve used it for both simple “where we are maps” and more involved maps with points of interest generated from Textpattern article data.

And, if you just need things to be simple and don’t need your map to be interactive, you can use it to generate static map images.


TXP Builders – finely-crafted code, design and txp

Offline

#7 2025-02-20 12:39:15

ToK
Plugin Author
Registered: 2014-02-18
Posts: 25

Re: tok_osm_leaflet

mistersugar wrote #339109:

Is anyone currently using this plugin? I’ve just tried it and can’t get it to work. I see it is trying to pull from an obsolete cdn, and my attempt to host the current leaflet files didn’t work.

Seems to be a nice plugin ;-) Don’t know if I’ve ever used it myself, but maybe there was a use case which I can no longer remember. I’ll set up an environment from back then and try to understand what I wrote back then – and adjust it of course.
I’m away for a few days, but I’m on it, promised.

Offline

#8 2025-02-20 17:25:30

mistersugar
Member
From: North Carolina
Registered: 2004-04-13
Posts: 147
Website

Re: tok_osm_leaflet

ToK wrote #339113:

I’m away for a few days, but I’m on it, promised.

No rush and thanks in advance. Looks like it will be useful to me for my site redesign, but that will take me a few weeks anyway.

Offline

#9 2025-02-20 17:27:11

mistersugar
Member
From: North Carolina
Registered: 2004-04-13
Posts: 147
Website

Re: tok_osm_leaflet

jakob wrote #339111:

non-Google maps using MapBox GL JS, which use OpenStreetMap data but has way nicer maps.

Oh, this could be useful. Many thanks for the tip.

Last edited by mistersugar (2025-02-20 17:27:22)

Offline

#10 2025-02-23 13:04:23

ToK
Plugin Author
Registered: 2014-02-18
Posts: 25

Re: tok_osm_leaflet

mistersugar wrote #339116:

No rush and thanks in advance. Looks like it will be useful to me for my site redesign, but that will take me a few weeks anyway.

Had some time in the train to look at the code. Plugin should be fixed and running again.

Offline

#11 2025-02-23 21:52:27

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,851
Website GitHub

Re: tok_osm_leaflet

Nice one. Cool that you updated it so quickly. Nice to see your other plugins, too. They seem new to me.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2025-02-24 01:02:52

mistersugar
Member
From: North Carolina
Registered: 2004-04-13
Posts: 147
Website

Re: tok_osm_leaflet

ToK wrote #339123:

Had some time in the train to look at the code. Plugin should be fixed and running again.

It works! I have it running on my site, visible on my Now page. Thanks a million.

Last edited by mistersugar (2025-02-24 01:03:10)

Offline

Board footer

Powered by FluxBB