biker :: Webmaps using OpenStreetMap

info :: blog :: log :: feed :: español


So in my little steps of trying to be fully free (as in beer), I decided to change the map in my Places section from Google Maps to OpenStreetMap. There is a whole table in the OpenStreetMap wiki with many libs you can use to embed OpenStreetMap into a webpage, and add a lot of stuff to it.

The one I picked was the one at the top of the list, called Leaflet, which the authors describe as a library that focuses on performance, usability, simple API, small size and mobile support. In my experience, it was really easy to implement on my site, as well as I just needed something simple: a map with a bunch of markers. There is an easy quick start guide on Leaflet's site, where they use Mapbox for the maps, but if you are like me and want to use OSM, you only need to change the tileLayer to use it, see my example.

It didn't take me more than an hour to have the map with all the markers on it. If you want an alternative solution for embedding maps into your site, you can use this opensource one (:

Categories: openstreetmap , rugebiker , linux