Leaflet author here! Just wanted to note that if you haven't looked into OpenLayers in a few years, you absolutely should — it's astonishing how much it progressed: from something that I was so frustrated with that it prompted me to write Leaflet in the first place (11 years ago) to a modern, fast, well-engineered and lovingly maintained library.
It's especially great when you're doing complex GIS stuff and need a ton of features and formats supported out of the box. As for other libraries, I'd recommend Leaflet for simple maps, and Mapbox GL for rich, highly interactive apps that benefit from vector rendering tech (I'm biased since I contributed to both), but it's great to have OpenLayers in the mix — there's a library for anyone's needs, cross-inspiration moves all three forward, and the mapping software landscape in general is greater than it has ever been.
Don't have any particular OpenLayers examples in mind at the moment but it's very heavily used in government, enterprise and academics — sectors that often need advanced projections, use various obscure formats / protocols and prefer all the features to be packed in one product and maintained consistently by one team.
For Mapbox, here's a showcase https://www.mapbox.com/showcase. It especially shines in apps that need to render hundreds of thousands of features at once, maximum customization in how the map looks and feels, updating map appearance dynamically in real time, or some cool animations.
In terms of features, Leaflet has a huge plugin community and there's a plugin for pretty much any feature since it has been around for 8 years, although their quality varies (the core is top-notch though). Mapbox GL will need to catch up on that front certainly, but on the other hand, there are things that are simply not possible with raster-based mapping libraries — things like making any feature you see interactive, changing the map appearance in real time, rendering millions of features (with high perf viz features like clustering, heatmaps, advanced labeling etc.), and general smoothness of user experience (smooth zoom transitions, labels adjusting to rotation and pitch, etc.).
To answer your question:
Leaflet.draw is superior to mapbox-gl-draw. mapbox-gl-draw is very lightly maintained and is not as full featured as Leaflet.draw. mapbox-gl-draw sounds like it may also be no longer maintained by Mapbox in the future either - refer to the recent GitHub issue on the repos that hints at this.
There are mapbox-gl-draw plugins to make it comparable to Leaflet.draw but these are features IMO that mapbox-gl-draw probably should have had in the first place.
So, as someone who works with mapbox-gl-js a lot, that is something I see as a gap.
What are the biggest features gaps you think are missing from Leaflet.draw -> gl-draw? definitely hear you on the "very lightly maintained" front, but I may be interested in submitting some PRs to gl-draw that mirror Leaflet.draw functionality if there's specific functionality folks are looking for
For complex GIS stuff in OpenLayers, you can do stuff like connect to a GeoServer instance and edit features with a ready made protocol like WFS-T. I have been involved in making these kind of tools for enterprises, like editing address points and routing paths in the browser, with transactions and edit sets and things like that.
When I was working with this stuff, Leaflet was more "view only" and not so much editing. This was back in the "have to support IE6" days. I remember trying Leaflet for a simple project, but gave up since I could not set a bounding box for panning (the map was only supposed to show a limited area of the world), while OpenLayers seemed had every API feature one could wish. Although more bloated, less polished :)
Thank you for building leaflet. It (and scrapy) are how I wound up finding the house I live in now - a quirky, dirt cheap cottage I'd never have taken note of without the tools to filter and visualize a whole country's listings.
Thank you so much for all the work you put into creating and maintaining Leaflet. It’s pretty remarkable how much time and energy you (and others, of course) put into making something so complex so intuitive.
When compared to the other two major OSS libraries I would say:
- Leaflet. Widely known, suitable for mostly simple use cases.
- Mapbox GL JS. State of the art library based on WebGL. Mapbox started off with a fork/extension of Leaflet called Mapbox.js but over time has moved on and created the Mapbox GL JS library from the ground up. Very fast, but requires a GPU due to WebGL.
- OpenLayers. Often used by more professional users. Probably the most features complete library. Also usable without a GPU.
Speaking of, does anyone know a cheaper service than Mapbox and Google Maps for raster tiles?
I have an app that uses Leaflet for rendering, and Mapbox purely for its raster tiles (both plain maps and satellite required). Mapbox has been cheap for us, at about $50/mo. But with the new pricing structure taking effect in December, it's now about $450/mo. I believe Google and Bing are both more expensive than that.
I've been considering setting up OSM, but I'd like to avoid having to run and maintain it.
If you can find the time to set it up, OpenMapTiles [0] is the way to go. In the long run, you’ll probably save more money than the time it takes to manage.
Update: So if you run the server locally and select maps, you're presented with this screen, saying you need a key from openmaptiles.com: https://i.imgur.com/NTb5zIL.jpg.
Docs for building the tiles yourself are here [0,1]. It's worked really well for me so far. If you want a visual example of self hosted tiles, you can check out my (in progress) website [2]. The tiles are all hosted statically in S3 with cloudflare as a proxy, so it was pretty cheap.
Thanks, I will look into that. It's not altogether clear from their site — their Docker image basically implies that you're supposed to use their pre-existing datasets, which aren't free.
It's a little unclear to me. But from what I can gather, the basic software can download data from OSM, but if you want hillshading or satellite, you have to get that separately, and it's part of the $1,000 "production package" [1], which is actually $2,048 for businesses, plus $1,024/year for updates.
I have a couple open source repos for generating hillshade and contours (raster and vector, respectively) that I use with my self hosted tiles at nst.guide. The data sources I'm using are US only, though SRTM is a common choice for international Digital Elevation Models.
Forgot to answer about styling. Yes, looks like custom styles with the production package (which has hillshading, which ends up making the maps look much nicer) is much better. For some reason their main demos don't show off their best map styles.
Only if you're below 500k raster tile downloads per month. The app I need this for is at 5.5m/mo, so it'd be a little more than $245/mo. Still better than Mapbox, though.
Those prices look good. I remember last time I checked they had a very good free plan but you had to jump right up to the very expensive enterprise plan if you had an internal app even if it was tiny.
Really unfortunate that Google Stadia has a name collision with y'all. :(
You don't even show up in the "stadia" search results without the term "maps" added.
If it wasn't scary and expensive to sue Google for a name change, this seems like a case of Google (probably unwittingly) crushing your brand and trademark with their own.
Have y'all noticed a decrease in search traffic (or general brand/product awareness) since Google Stadia launched? And if so, do you plan to do anything about it?
Really cool product! Your maps look slick and super clean. :)
> Have y'all noticed a decrease in search traffic (or general brand/product awareness) since Google Stadia launched?
We've actually seen an uptick because of badly placed keyword searches for Stadia.
We also aren't exactly sure the best way to counter it, but we're working on figuring out the best way. We don't really have a legal resource, either, given we didn't have a trademark before Google Stadia came along.
Cool, thanks. Pricing looks good. I'm not able to check out your product because your service appears to be down right now...?
$ curl 'https://tiles.stadiamaps.com/styles/alidade_smooth.json'
<html><body><h1>502 Bad Gateway</h1>
The server returned an invalid or incomplete response.
</body></html>
Very unfortunate timing there. We had a cache server wedge, and the failover mechanism didn't detect it quickly enough. We've diverted traffic manually and are working on bringing the bad region back into the mix after it went down.
We are hosting about 150GB of map data, raster and vector, with the following stack:
- MapProxy with Redis cache
- MapServer for rendering
- PostGIS for data storage
I went through the various providers and ended up using MapTiler Cloud, it is the cheapest option I know of besides generating and serving your own tiles.
Joe here from the Mapbox billing support team. Feel free to reach out to help@mapbox.com. We can dig into your implementation with you to see if there are ways to limit your API consumption (and reduce your overall bills).
Things like limiting panning/zooming can help limit the number of tiles your end users load. Fewer tiles -> cheaper invoices
I'm in a similar boat, looking to generate my own vector tile static images (basically raster tiles with fractional zoom levels). I use a fair amount of these, and there's no service that lets you cache them (of course). Seems like Mapbox and Maptiler are the only games in town.
OpenLayers was one of the first open source libraries of this kind; sadly it's lost some development momentum back when everyone was using it in 2008 or so, and nearly everyone switched to (then faster) alternatives like Leaflet.
Not to blow my own horn but my background is very intimately in Web-GIS (Bachelor's and Master's in geography), my career for 7 years has been in robotics and building web-UIs for real-time robotics GIS, so I think I'm probably an expert here.
I've used Leaflet for a few years and now OpenLayers for about 5 years to author UIs for monitoring robot fleets in real-time as well as build Web-GIS applications for mapping and configuring, autogenerating, validating the spatial datasets (fiducials, SLAM data, navigable positions, "zones", "pathways", etc.)
Leaflet is what I'd say will fit most people's needs when it comes to your standard web-map use cases. It's a beautifully designed library with a good level of modularity and lots of plugins. The API is great.
OpenLayers shines when you get into a lot more complex stuff. The symbology engine is phenomenally powerful and I found that the API plugs into more complex Redux-style state management in a more easy way than Leaflet.
I also found performance when doing high-volume, high-frequency data updates and interactions to be faster with OpenLayers.
That being said, I haven't dug deeply into Leaflet in about a year and things can change quite quickly!
I suspect the overwhelming majority of developers aren't doing anything all that novel or complicated. They're not making Web-GIS applications and probably will do just fine with either.
In what way is mapbox-gl not free? It's developed in the open, and works with all types of layers. I switched to mapbox-gl the moment it came out, because I already was making my own vector tiles as needed for interactive maps.
There is only one issue I encountered in the short few years it's been my go-to choice, which is that there are no plugins to integrate Google Streetmaps or Streetview. There are however, for leaflet as Google Mutant and Leaflet Pegman.
What is the level of maptalks integration with Google layers? How is it better than mapbox-gl?
Maybe I misunderstood, do you only pay for the tiles on mapbox? I’m just accustomed to having to use a restricted api key with mapbox.
If that’s the case I’m totally ditching maptalks for all it’s quirks.
And I don’t know of any libraries for google street view integration, but a dev I work with has done a fantastic job of integrating street view with map box. I’ll try to dig up some of his code
For some layers my projects do pay for MapBox tile service, but for other projects I use OSM extracts and self-made vector tiles. Mapbox charges only for the tile services, and there are multiple data sources out there, with which mapbox-gl works. It honestly the smart thing to do, as without such flexibility, I wouldn't be using their services or libraries at all.
> but a dev I work with has done a fantastic job of integrating street view with map box. I’ll try to dig up some of his code
This would be a pretty popular library, I am sure! The issue is that the Google EULA prohibits the use of their data directly, it has to be accessed using Google Maps SDK. So Google Mutant Leaflet plugin has to use the API to download the tiles and then exposes the Google Layer a custom Leaflet Layer, but it works :) On the mapbox issue tracker, they close all issues inquiring for help in implementing such a custom layer, so if your coworker did this, I'm sure it was a non-trivial exercise, kudos to him! :)
We use OpenLayers extensively in my company (https://www.podaris.com), and we push it really, really hard. It's the basis for a parametric CAD system, a bunch of GIS tools, and most recently, transport micro-simulation. It had a steep learning curve, but has held up remarkably well over the years, with remarkably few instances where it's been the bottleneck.
We had the exact opposite problem! We built a custom webgl rendering layer on top of leaflet to get around leaflet's performance issues. We have now switcher to openlayers and very happy. Guess it depends on the exact use case.
We switched the opposite direction (D3 to Leaflet) on a different app and got a performance speed up for big sets of vector shapes. Seems like there are tons of ways to engineer these web graphics apps and no clear "best solution".
We were just trying to get a ton of circles (electric vehicle ranges) on a map.
We were going to do something to optimize it in OpenLayers by simplifying the shapes, but when we tried it in Leaflet it just worked a lot faster (fast redraws). We think it's something around how Leaflet dynamically switches to a canvas renderer for big datasets.
Some time ago I checked out three libraries for my amateur small navigation app:
Leaflet - it doesn't have map rotation, so it was a dealbraker for me. People on Stack Overflow were talking about ugly hacks, I didn't want to go into the rabbit hole.
Mapbox - I found docs little clunky (again, I'm amateur so it may be the reason I didn't get it) and couldn't really work out what's paid and what's free. Didn't spend a lot of time on them, though.
OpenLayers - I think it's the best one feature-wise, but documentation is rather for more advanced developers. I struggled a lot before finally grasping how it works and still, it's not easy. Getting started guide like Vue.js has would be immensely helpful.
I ended up with OpenLayers and I'm pretty satisfied for now, despite needing fairly long time to actually implement features properly.
What a coincidence! I discovered OpenLayers yesterday when looking for a way to display a 1 Terapixel image. I got it up and running in a few hours. Kudos to the developers!
Thanks for sharing! One more curiosity - what PNG compression tool was used and how long did it take to crunch 216GB to 17GB? I'm surprised it didn't crash.
I didn't compress an actual image from 216GB to 17GB. Instead, I created the highest resolution image already as a set of tiles (each one 5000x10000 px). Then I tiled them further in two additional zoom levels, until I got 4x8 square tiles of 1250x1250px. From there I worked backwards merging chunks of 2x2 tiles.
The figure 217 GB comes from the cumulative size of all the pandas DataFrames containing the whole dataset (as mgspack files). The lossless compressed figure comes from the total size of the highest zoom level.
It didn't take that long, it was mostly done overnight (so around 10 hours in a i7 server with 24 GB RAM).
I like OpenLayers. We built a rather complex image annotation tool around it and OpenLayers worked well with all the features we added over the years, recently even a full-blown video annotation tool. The community is nice and active, too. Best of all: It's still compatible with our old school way of JS development. The only thing I'm missing is the API documentation of older versions which they seem to have dropped at some point.
We use OpenLayers at our company. We are building an interactive map with a bunch of tools for measuring distance, calculating routes, drawing features, displaying diagrams right on top of the map, and OpenLayers is doing wonders for us. It has a steep learning curve but once you grasp the fundamentals, you can figure out how to do all kinds of magic tricks with it.
What is the advantage of having the documentation CC-BY 3.0 licensed ? In cases where documentation is generated from the code it seems more convenient to use the same license for both.
I used OpenLayers back in 2008-2011 for mapping-heavy web application. It was of very high quality, and had great API documentation (using DoxyGen, iirc). Taught me some things about pre-modern-craze Javascript programming (i.e. how to correctly implement inheritance in JS)
It's especially great when you're doing complex GIS stuff and need a ton of features and formats supported out of the box. As for other libraries, I'd recommend Leaflet for simple maps, and Mapbox GL for rich, highly interactive apps that benefit from vector rendering tech (I'm biased since I contributed to both), but it's great to have OpenLayers in the mix — there's a library for anyone's needs, cross-inspiration moves all three forward, and the mapping software landscape in general is greater than it has ever been.