Leaflet: An open-source JavaScript library for mobile-friendly interactive maps
leafletjs.com
leafletjs.com
Another great feature that doesn't get as much attention is Leaflet's ability to handle non-geographic images. In the same publication I'm also using it as a general-purpose deep zoom viewer for displaying artifacts[2]. It's great to just use a single library to handle all of this.
Kudos to the Leaflet developers for continuing to improve such a great library!
[1]: http://www.getty.edu/publications/romanmosaics/catalogue/ita... [2]: http://www.getty.edu/publications/romanmosaics/catalogue/1/
The Rijksmuseum "Rijksstudio" site has been around for a few years and adopted leaflet very early on for image viewing: https://www.rijksmuseum.nl/en/rijksstudio/artists/rembrandt-...
Perhaps of interest to this sub-thread is "IIIF" (the international image interoperability framework), an attempt to standardize access to images (and collections of images) with a JSON(-LD) metadata model: http://iiif.io/
RE: IIIF, we're interested in going in that direction as well. Fortunately it looks like someone already wrote a plugin for it: https://github.com/mejackreed/Leaflet-IIIF
PS - Hey Kjell! This is Eric from the Getty. It's nice to see there are other museum folks on HN!
From a user perspective the difference is huge
One of our core devs (Ivan) works on Leaflet WebGL renderer, but I'd like it to remain a plugin, so that Leaflet stays true to its goal — to be as small and simple as possible.
MapboxGL is very performant, but it changes all the abstractions to the map elements, which is something I'm particularly not very happy with. Thus Leaflet.GL.
Is there any plan to add NPM support anytime soon? I tried using the NPM library but icons did not work (got invalid path error) so I was forced to use div icons.
The leaflet/npm ecosystem goes out the window when you take into account plug-ins as well, As they require script tags.
Thanks for all your hard work!
Interestingly enough, the bug I was getting (can't seem to repro anymore) was already solved... by you! https://github.com/Leaflet/Leaflet/issues/766#issuecomment-7...
None of the fixes on that page worked, but using DivIcons did. If I can repro, I will definitely make an issue. Thanks!
I have a small question while you are here...
In my application, when a user zooms the map.. the tiles and markers seem to get get zoomed at different rates, then finally snap back together at the end of the zoom.
Is this something I'm doing wrong. Is there anyway to mitigate that effect?
Thanks again.
Shameless plug, see for instance this map using css 'explosions': https://citybik.es
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.
The numbers are real, although the timing might not be. There's an endpoint diffing our data by the minute and distributing the changes over that minute to give it the real-ish impression. A green explosion means somebody took a bike from an station, and a red one means somebody left one.
From experience working with these endpoints, data is reliable at around a window of 5 minutes.
Is there an open data feed for this stuff then? I love open data, there is so much available now.
If you are interested in the actual sources, these are available on the data files that compose pybikes[1]
[1]: https://github.com/eskerda/pybikes/tree/master/pybikes/data
1. Use WebTorrent[1] as the tile provider (would probably need a canonical WebTorrent server so that all tiles would always have at least one seeder).
2. A Progressive Web Map (teehee) so that users can store tiles offline and use the mapping service while offline. Obviously not a new concept but AFAIK there isn't a map provider that does it in the browser.
3. Client-side routing/navigation. This could start as a simple Dijkstra in JavaScript (like is demonstrated in [2]), but maybe could be made more powerful and capable soon with WebAssembly.
Is anybody working on these sorts of things? Is anybody interested in them? I've heard of peermaps[3] but it hasn't been updated in over 6 months. I'd be interested in contributing or teaming up with others on these sorts of things.
https://drive.google.com/file/d/0BwPUV--rEjyiVDc4UXBzUnhhMDA...
If I zoom the page outside of the map and then scroll so that the map fills the full screen there is no way to zoom out/get away from the map again. You will just scroll and zoom the map and eventually will have to reload the page. It also allows to scroll far out of bounds of the world which can be a bit confusing.
I'm not up to speed with the latest JS and browser features, but unless there is some sort of zoom reset from the browser itself I don't think there is an easy solution without making arbitrary decisions like "user has scrolled up 10 times, move entire page up"
For instance , if I shake my mobile (think google maps) or 3 finger Zoom out, then the browser resets the zoom level.
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!
But if Leaflet does what you need, just use it.
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.
The stuff they are doing with MapBox is super awesome as well, especially the OpenGL work.
Deeply appreciate the effort.
Is there an easy way to integrate leaflet plug-ins using react? My best attempt was to download the plug-in script and modify it such that it takes the Leaflet object as a parameter (instead of the IIFE) but this causes a lot of overhead for using plug-ins.
Any tips from a fellow react developer?
Here are some maps we have made: https://green-giraffe.eu/projects http://www.danielbeeke.nl/inbraken-in-uw-buurt/#12/52.0553/5...
Most of the stuff I saw online was for previous versions of Leaflet, I wanted to make something that uses this new release
I can't say how well it competes with alternatives, but for my use-case it was ideal and very easy to get started with.
I just hope leaflet will be there one day with smooth degradation for browser that don't have webgl enabled
Yeah I'd love to know about people using it as well. Certainly the features would be really useful.
I see the http://leafletjs.com website uses some google fonts, and google analytics, but I would have thought it would degrade gracefully if those things are blocked.
As for the leaflet maps library itself, this will definitely operate independently of google or twitter. Try here for a simple example embedded on my website (with no googleness) http://harrywood.co.uk/maps/examples/leaflet/1-just-map.view... or even better, try here where I'm loading it from locally hosted javascript: http://harrywood.co.uk/maps/examples/leaflet/1b-local-osm.vi...
Those links working for you?