Live data from Hacker News

LeafletJS: a JavaScript library for interactive maps

leafletjs.com

41–50 of 91 posts

Re: LeafletJS: a JavaScript library for interactive maps

#43
post #36

How does it compare to this? https://github.com/maplibre/maplibre-gl-js

* Leaflet is based completely on the web platform. It achieves a zoomable slippy map experience by animating DOM elements - usually image tiles. * MapLibre GL JS is a BSD licensed fork of Mapbox GL JS version 1. Instead of consuming bitmap image tiles, it consumes tiles corresponding to the same coordinate extents as the above tiles, but containing tagged geometry features. So instead of sending a PNG image you're se…

Thanks!

Re: LeafletJS: a JavaScript library for interactive maps

#45

Earlier quoted context omitted.

Depending on the use case, you may be able to host tiles on any web host/cdn

You still have to pay for the server you host it yourself on. Which usually means generating the tiles from scratch rather than relying on some precached ones. The prices for something like mapbox are not outrageous for what they provide.

Here’s an example of statically hosting map tiles on GitHub Pages:

https://seagl.org/maps/2019

Source: https://github.com/SeaGL/seagl.github.io/pull/148

Re: LeafletJS: a JavaScript library for interactive maps

#46

Leaflet is fantastic. One of the more interesting use cases I've seen for it is the Guild Wars 2 wiki. They use it heavily to display the game map for regions, areas of interests etc. It's quite impressive, and very useful as a player! https://wiki.guildwars2.com/wiki/Kryta#Interactive_Map

I'm a freelance web developer for https://gamerguides.com/ which also uses Leaflet for video game maps. It's a little weird to get working with at first but it turns out it's well suited for that sort of use case. I love it.

Re: LeafletJS: a JavaScript library for interactive maps

#49
post #5

I have used this and it is excellent. It is a tremendous alternative to all the paid GIS/mapping suites.

When I used it, I really wished it used JS inheritance rather than its own custom inheritance/mixins.

JavaScript inheritance wasn't really a thing when Leaflet started out, and definitely not widely-supported (is it even now?).

Re: LeafletJS: a JavaScript library for interactive maps

#50

Earlier quoted context omitted.

Depending on the use case, you may be able to host tiles on any web host/cdn

You still have to pay for the server you host it yourself on. Which usually means generating the tiles from scratch rather than relying on some precached ones. The prices for something like mapbox are not outrageous for what they provide.

> You still have to pay for the server you host it yourself on.

I mean, I guess? Can't it be presumed that if you have a web site upon which you wish to place a map, you've already got a web server set up one way or another?

> Which usually means generating the tiles from scratch rather than relying on some precached ones.

Well, yes. The way I've set it up for my client is basically that we start from a large image which will be the map at its maximum "zoom in level" and run a script which scales the map 50% smaller, dices the image into 256x256 tiles, and saves those tiles with a pre-defined naming scheme (something like Xcoord_Ycoord_Zoomlevel.png - I can't recall the details), then scales the original map by 25%, creates tiles from that, and repeats until the entire map can fit into four tiles (512x512). It's not terribly difficult stuff for a reasonably capable developer to do, though working with the larger maps can eat up a lot of RAM on the system we run this script on.

Post reply on HN