8 ms·
OpenLayers
- andrewshadura 7y agoOpenLayers 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.
- jackinloadup 7y agoAnyone know how OpenLayers compares to Leaflet today?
- bransonf 7y agoWell, I think it has better (official) WebGL support than leaflet, but most all the developers I know are jumping to Mapbox by default. EDIT: My favorite open source library right now is maptalks. Basically mapbox sort of functionality and rendering, but totally free.
- Demiurge 7y agoIn 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? EDIT: There is an issue with the zooming and baselayer being completely out of sync with the buildings here: https://maptalks.org/gallery/extrude-buildings/index.html https://maptalks.org/gallery/extrude-buildings/index.html
- bransonf 7y agoMaybe 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
- Demiurge 7y agoFor 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! :)
- Waterluvian 7y agoNot 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.
- jackinloadup 7y agoThanks for your perspective
- atombender 7y agoSpeaking 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.
- bransonf 7y agoIf 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. [0] https://openmaptiles.org/ https://openmaptiles.org/
- atombender 7y agoInteresting, thanks. Unfortunately, those tiles are pretty ugly compared to Mapbox, but it might be an option if I can't find anything else. Edit: Also it's $1,000 for commercial use, even to use with OSM data?
- TomMarius 7y agoCould you send an example of a great looking map?
- atombender 7y agoMapbox's tiles are very good. I particularly like the hybrid terrain + road mode, which you can see here: https://homes.stltoday.com/search https://homes.stltoday.com/search
- kylebarron 7y agoI agree that layer is gorgeous. I think the best open vector map style is OSM liberty [0]. My fork, which includes my generated hillshade and contours, is here [1]. [0]: https://github.com/maputnik/osm-liberty https://github.com/maputnik/osm-liberty [1]: https://github.com/nst-guide/osm-liberty/blob/gh-pages/style.json https://github.com/nst-guide/osm-liberty/blob/gh-pages/style...
- nickik 7y agoCan I get topological maps without roads and so on with this? Is their hight data?
- widforss 7y agoThis is a library for presenting map data, you have to specify your map source yourself.
- jascii 7y agoUSGS Topo tiles are available to use with web-mapping libraries: https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer https://basemap.nationalmap.gov/arcgis/rest/services/USGSTop...
- maliker 7y agoWe used openLayers, ran in to performance issues, switched to Leaflet, and couldn't be happier. Just our experience, for what it's worth.
- k__ 7y agoI used Leaflet and had to do some things with realtime visuals in D3 as overlay for Leaflet, because of performance issues.
- maliker 7y agoWe 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".
- zefman 7y agoWe 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.
- maliker 7y agoSounds like we should do some more OpenLayers testing! Thanks.
- Demiurge 7y agoWhat kind of performance/use case did you have? I haven't touched leaflet since the giant rewrite.
- maliker 7y agoWe 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.
- herogreen 7y agoWhat 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.
- rickette 7y agoWhen 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.
- giancarlostoro 7y agoThank you so much for this, I was wondering what the differences were. I've used Leaflet, but not OpenLayers or Mapbox.
- baroffoos 7y agoWhat do you mean requires a gpu? Doesn't all computing with a gui require some kind of GPU?
- bmn__ 7y agoHe means a GPU with 3D acceleration.
- mourner 7y agoLeaflet 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.
- conroydave 7y agohey thanks for building leaflet
- guu 7y agoThanks for creating Leaflet and Mapbox GL! Do you have any specific examples of "complex GIS stuff" (Uses OpenLayers) or a "highly interactive app" (Uses MapBox GL)? Are there any big feature gaps from leaflet->mapbox-gl that developers should consider when choosing a mapping library?
- mourner 7y agoNote: I didn't create Mapbox GL, I'm just a part of the core team: https://github.com/mapbox/mapbox-gl-js/graphs/contributors https://github.com/mapbox/mapbox-gl-js/graphs/contributors 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 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.).
- ghgr 7y agoWhat 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!
- degenerate 7y agoAre you serving it as a "static image" or using a different method? https://openlayers.org/en/latest/examples/static-image.html https://openlayers.org/en/latest/examples/static-image.html
- ghgr 7y agoI followed a tiled based approach, as explained here: https://openlayers.org/en/latest/examples/localized-openstreetmap.html https://openlayers.org/en/latest/examples/localized-openstre... Although the image is not a map at all, I tiled it and served it as a custom map layer. You can view it at https://finance.alisio-computing.eu https://finance.alisio-computing.eu
- degenerate 7y agoThanks 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.
- ghgr 7y agoI 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).
- mzur 7y agoI 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.
- pkalinowski 7y agoSome 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.
- nkoren 7y agoWe use OpenLayers extensively in my company (https://www.podaris.com 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. Definitely recommended!
- kls 7y agojust did a port from a custom D3 map solution to OL due to mobile requirements. I can say the OL's mobile support is first class.
- n1vz3r 7y agoI 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)
- moonfleet 7y agoWe 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.