OpenStreetMap 로고 OpenStreetMap

MapBBCode: free maps for everyone

Zverik님이 English로 2013년 10월 31일에 게시함.

It is now time to mark a milestone in my month-long programming marathon and announce the first release of the MapBBCode library: a way to integrate maps into almost everything, but primarily written for forums and blogs. There is a long introduction on the official site, but the problem it solves is very common and somewhat annoying, especially with biking and construction sites: they have no maps.

Mapping plugins for forums tend to focus on geolocating users, which is a dull and useless task. What if I want to draw a route and allow fellow bikers to download it as GPX before setting off? The world of embedded maps is dominated by monstrosities, like the one I’ve spotted in Shaun’s blog (40€ for a map!). We have Leaflet, we have the best map in the world, and forum/blogging engines have API — let’s get coding.

MapBBCode

Map BBCode is a string enclosed in [map]…[/map] tags. It can be copied anywhere and edited as text; essentially it is GeoJSON with restricted set of properties and adapted for forums. A small javascript library turns it into a Leaflet map panel and allows editing code not by entering numbers, but by drawing on a map. You can try in on the project’s page. There are also modules for phpBB forums: this Monday a popular local forum on road construction has installed it, and now I’m pushing it to local cycling forums. Someday there will hopefully be plugins for vBulletin, WordPress, SMF, MediaWiki and others.

As an example of library’s versatility, MapBBCode Share website was born. The idea was simple: put strings in a database — and you’ve got a map sharing service, simple and accessible, like pastebin or imgur. And you can copy raw code to a forum or a blog. This vision started to shatter when GIS-Lab community used the site for planning a mapping party by openly publishing an edit link. And then I added import and export to a dozen of formats, personal libraries (so you won’t have to store bookmarks locally) and API. It turned out that sharing maps is only a fraction of the site’s potential.

MapBBCode Share

Now you can plan a trip together with friends, place markers, embed the developing map in a forum post, and a day before the trip you can download the route and waypoints in GPX format right from a forum page. You can import CSV and immediately download it as HTML with no external dependencies (besides Leaflet). No iframes — unlike every other service, MapBBCode Share produces full-featured HTML that works offline and can be included in a website by copying code. You can upload OSRM-generated routes, quickly edit poly files, inevitably export GeoJSON, — the site “competes” not only with geojson.io and uMap, but even with JOSM. Privacy is bulletproof: you sign in with OpenID (google/yahoo accounts will do), your ID is immediately hashed before storing, so even the administrator doesn’t know who is using the website. The hash doesn’t leave the server, so no one can link maps to users.

Today I am releasing the whole package: more than 200K of code, 60K of documentation, 7 new Leaflet plugins, everything published under the most permissive license of all, WTFPL. The development goes on, but now all changes are logged, and the author is responsible for keeping backwards compatibility. Please use MapBBCode Share and write plugins for embedding the code into forum and blog engines. Let’s make the [map] tag a standard, and make sharing maps no harder than sharing images or code.

이메일 아이콘 Bluesky 아이콘 Facebook 아이콘 LinkedIn 아이콘 마스토돈 아이콘 텔레그램 아이콘 X 아이콘

토론

2013년 10월 31일 21:14Stalfur님의 의견

This looks fantastic! Looking forward to delving into it and test it out!

2013년 10월 31일 21:42Richard님의 의견

Superb. Really hope this gets adopted widely.

2013년 11월 1일 01:18Glassman님의 의견

What a great tool. Thanks!!!

2013년 11월 1일 11:06Tom Chance님의 의견

This is fantastic, thank you.

Where can you add labels to polygons, as in your second screenshot?

2013년 11월 1일 11:38Zverik님의 의견

Those are not polygon labels, but regular markers inside polygons. There is a way to add popups to polygons by editing the raw code, but adding markers was proved to be more intuitive for users.

2013년 11월 1일 11:47Tom Chance님의 의견

Ah, got it, thanks.

2013년 11월 1일 14:20malenki님의 의견

I kuldn’t resist to excavate teh lolcat uf awzumnez for yur græt workz, Mistah Zferik!

Or to say it with Terry Pratchett: !

2013년 11월 1일 14:31Zverik님의 의견

Oh wow. That is the greatest honour one can receive in this project. My life is now complete. Thank you :)

2013년 11월 1일 15:33baditaflorin님의 의견

Wow, it is really great :)

One Request, the posibility to delete a line. Now you cannot delete a line, you can only detele points, until you remain with 2 points.

2013년 11월 1일 15:39Zverik님의 의견

baditaflorin, did you try clicking on a line (between points)? There is a popup panel with a “Delete” button.

2013년 11월 1일 15:58Harry Wood님의 의견

There’s a standardisation opportunity which is constantly evading us here. It’s always bothered me, ever since I wrote the two MediaWiki extensions years ago, and I’ve been meaning to come back to this. So MapBBCode has a new “map sharing” syntax, and it’s also a map sharing service, or maybe the term should be something like “annotation services”? Recently we’ve seen umap come along, and also geojson.io They all do slightly different things, adopting different syntaxes. The other family of similar map sharing ideas comes from static map image services which we’ve had for a while. With some services the data needs to be put into a URL params. This is even possible on the OpenStreetMap.org front page (marker and box parameters) but as with the syntax approaches… no real standardisation yet it would seem.

2013년 11월 1일 16:18Zverik님의 의견

The problem is, only one of those services/plugins offer raw textual data for user’s objects that can be edited by hand and copied into another medium, and it’s GeoJSON — rather cumbersome and hard to read, especially in small textareas. Most of these just show a map with almost no extra information. So that makes MapBBCode the first attempt at the task. The bbcode can be integrated into your MediaWiki extensions, just by allowing content inside the tags. But OpenLayers is so 2009 :)

I intend to see the adoption of the bbcode through. There is a module in the works for OSM’s forum, and we are planning to invade a lot of russian offroading and cycling forums, making open source plugins along the way. It, of course will take time, but surely is inevitable.

2013년 11월 4일 09:58Vincent de Phily님의 의견

Many thanks. I tried to write an ad-hoc gpx-display plugin for Blogger a couple of years ago and gave up after much frustration.

I realistically won’t have time to look at it again for a while, but please put Blogger on your radar of interesting targets (and savour the irony of a Google platform getting OSM support before GM support).

2013년 11월 30일 17:41FTA님의 의견

This is great!

2015년 4월 13일 22:17John Carter님의 의견

Its nice.You can check mine too. Maptags shortens your address to your favourite word and makes sharing address as easy as sharing a word. Visit at mapta.gs/maptags.html

2015년 4월 25일 18:06John Carter님의 의견

Its nice.You can check mine too. Its regarding google maptags. Maptags shortens your address to your favourite word and makes sharing address as easy as sharing a word. Visit at mapta.gs/maptags/700110

댓글을 남기려면 로그인하세요