5 ms·
Interesting article. It's been a few years since I've had a play with this kind of stuff; what's the best option available for someone to host custom styled vec
by have_faith 5y ago
Interesting article. It's been a few years since I've had a play with this kind of stuff; what's the best option available for someone to host custom styled vector maps and display them in a performant way? preferably on an open source stack. I haven't used MapBox before as I was worried about costs and being locked in. I'm interested in experimenting with map interaction/UX.
- n8cpdx 5y agoBoth ArcGIS Platform and Mapbox make this quite easy. Not fully open, but you get what you pay for. ArcGIS at least makes data import and export easy, and comes with a generous free tier
- Rebelgecko 5y agoThere's some forks of pre-closed source Mapbox
- TOMDM 5y agoOne of these is called MapLibre for the curious. https://maplibre.org/ https://maplibre.org/ https://github.com/maplibre/maplibre-gl-js https://github.com/maplibre/maplibre-gl-js I've used it on a smaller project, it worked well for me.
- deleted 5y ago[deleted]
- bezossucks 5y agoLeaflet for simpler use cases or OpenLayers for more power Recent versions of both are semi-fast, enough for general use
- KronisLV 5y agoCorrect me if i'm wrong, but isn't OpenLayers (https://openlayers.org/ https://openlayers.org/) mostly just a client side library for the displaying of maps, much like Leaflet (https://leafletjs.com/ https://leafletjs.com/)? To have your own tile server, you'd probably want something like OpenMapTiles (https://openmaptiles.org/ https://openmaptiles.org/) or another alternative like Tilemaker (https://tilemaker.org/ https://tilemaker.org/).
- VectorVoxels 5y agoYou're not wrong. But not all maps are tile based. A layer can come from a tile server, yes, or local cached data served with the web page, or geojson, or bitmaps, or algorithmic shapes, or geo databases, etc. OL is much more than a rendering library, it understands different geospatial input formats (raster and vector, tiled or not) and dynamically reprojects them to the same map projection, and lets you overlay UI elements (points of interest, polygons, lines, animations, etc.) or blend layers together (backgrounds, base maps, hill shades, etc.) Check out the examples: https://openlayers.org/en/latest/examples/ https://openlayers.org/en/latest/examples/
- KronisLV 5y agoThat much is definitely true and it's indeed interesting to see the many approaches to maps! Now, personally, I'd still go for using a tile server in most cases in apps where the map functionality isn't the main part of the app, because of how simple that approach is, as well as how friendly to battery life those maps can be. Of course, if maps are front and center to your app, then things probably change somewhat! Though i do believe that OP was also particularly asking about how to host their own solution, presumably on a VPS or another server somewhere. In that regard, it's interesting to see the options out there, in part because there didn't used to be that many - sure, PostGIS is perfect for processing and storing geospatial data, yet when it comes to the display of maps, that niche of the industry is a little bit more new!
- VectorVoxels 5y agoExactly. The best stack to use would ideally depend on your particular use case (and constraints, of course). Tiles make sense if you have a large area of interest (a country, a continent, the world). But in many cases your users would be better served by one of the big providers instead (Google, Mapbox, Here.com, Bing, OpenStreetMap) because of their superior infrastructure. If I got a dime for every time some local government GIS site self-hosted on ESRI bloatware slowed to a crawl or just plain broke... (though, to be fair, the ESRI web viewers are getting rapidly better. there's just a lot of legacy crap from old versions still in the wild) For smaller areas of interest (say, a city map, a campus map, an indoor building map) tiles are not only excessively complicated but also produce a worse UX because they don't allow for seamless zooming & panning. If your geometry can be easily described in a few hundred lines, the whole thing can just be served as a few kB geojson attached to the page and rendered dynamically by openlayers or leaflet. With a modern phone or computer, that rendering happens way quicker than it would take to load map tiles over the phone, and once it's all loaded the rest of the interactions are instant. You can even make it a progressive web app for offline use if you wanted to (but does anyone actually do that?) Tiles were a 90s/early 2000s solution to the infrastructure at the time, where servers were much more powerful than clients and Javascript was still in its infancy. These days a lot can be done on the clientside and arguably should be, except in cases where the data to be transmitted would be huge due to complex geometries or intricate graphics (e.g. for clients without a gfx card, rendering 3D textured maps on the fly a la Google Earth may be difficult... in that case prerendering them into tiles on a server makes sense) In any case, real-world maps typically combine approaches. They could use a tiled basemap as a background, overlay first-party bitmaps onto them (like a pretty map ripped from the print prochure), then add geojson POIs on top of them. This is one we built on openlayers using hybrid data sources, including a tiled background from OSM: https://map.fieldmuseum.org/ https://map.fieldmuseum.org/
- hampelm 5y agoThe author has been been building an open-source map rendering stack -- here's an intro blog post on that from April this year: https://protomaps.com/blog/new-way-to-make-maps https://protomaps.com/blog/new-way-to-make-maps
- pininja 5y agodeck.gl is another open source rendering option with a TileLayer, TerrainLayer, and MVTLayer. Other libraries mentioned have better text label and styling support out of the box compared to deck, so typically people do interleaved WebGL rendering with deck.gl and other basemap libraries to get a beautiful base and a super performant deck overlay. Tile hosting is still typically a paid service from someone, though COGS and S3 are a self-hosting option. I primarily work on libraries adjacent to deck.gl, happy to answer questions.