Live data from Hacker News

Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

leafletjs.com

11–20 of 78 posts

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#11
Leaflet is awesome and what I'd recommend for any starter or simpler project. But also be aware of the existence of OpenLayers when your needs start to grow considerably. I find it much more featured and closer to a GIS than just a mapping interface.

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#12

Leaflet is awesome and what I'd recommend for any starter or simpler project. But also be aware of the existence of OpenLayers when your needs start to grow considerably. I find it much more featured and closer to a GIS than just a mapping interface.

Can you elaborate more on what features OpenLayers has or does better than Leaflet?

We recently replaced an app built with GeoServer for one with Leaflet and Angular. My employer had previously used OpenLayers so we considered it but Leaflet is just so easy (we pushed most of the complexity to the API/database and kept the UI as a lightweight tile/geojson renderer). I'm curious about what we missed out on by not using OpenLayers!

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#13
post #5

In my experience the best thing about Leaflet is the possibility of using CSS to style, transform and animate markers. Shameless plug, see for instance this map using css 'explosions': https://citybik.es

I'm not so sure this is a great reference. On a brand new iPhone 6S with pretty much nothing else open, the performance of scrolling that map is terrible.

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#14
post #5

In my experience the best thing about Leaflet is the possibility of using CSS to style, transform and animate markers. Shameless plug, see for instance this map using css 'explosions': https://citybik.es

I'm not so sure this is a great reference. On a brand new iPhone 6S with pretty much nothing else open, the performance of scrolling that map is terrible.

My bad, the site does not degrade correctly to mobile devices. There's a nasty hack for hijacking focus on the map in order to keep it as a hero and being able to scroll down that has not been tested enough. Also note this is keeping a websocket connection open and receives streaming data for changes.

Maybe a direct map works better https://citybik.es/map/citi-bike-nyc

In any case, I just wanted to show how markers with 'DivIcon' [1] as they are called in leaflet can be used to create cool looking marker styling without resorting to images / svg / canvas.

[1]: http://leafletjs.com/reference.html#divicon

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#15
Leaflet is really nice. I used it to render a big map of my drawing game ScribbleGrid:

http://scribblegrid.com/maps/origin/

I used Node.js Canvas to render a file of each room, ImageMagick morgify/montage to add grid borders as well as combine them into one big image and GDAL2Tiles to split the image up into parts in a "z / x / y" folder structure for Leaflet to fetch.

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#18
I'm working on a project right now and using ui-leaflet for Angular, which sadly is getting pretty stale. I suppose it's not a huge surprise for an Angular 1 project, but it's still worth checking out if you use Angular and Leaflet.

Re: Leaflet: An open-source JavaScript library for mobile-friendly interactive maps

#19
post #12

Leaflet is awesome and what I'd recommend for any starter or simpler project. But also be aware of the existence of OpenLayers when your needs start to grow considerably. I find it much more featured and closer to a GIS than just a mapping interface.

Can you elaborate more on what features OpenLayers has or does better than Leaflet? We recently replaced an app built with GeoServer for one with Leaflet and Angular. My employer had previously used OpenLayers so we considered it but Leaflet is just so easy (we pushed most of the complexity to the API/database and kept the UI as a lightweight tile/geojson renderer). I'm curious about what we missed out on by not usin…

Lots of stuff, starting with nicer projections. http://openlayers.org/en/latest/examples/

But if Leaflet does what you need, just use it.

Post reply on HN