Comments (5)
@prusswan in many cases it's easier to "assemble" a style JavaScript object (not JSON) by grabbing the layers from e.g. https://unpkg.com/[email protected]/dist/layers/light.json and providing your own sources
key.
That doesn't address the case of Maputnik, etc though. What I may do is just spin up an editor interface with the right style.json preloaded? Is there another case for needing a style.json?
I have that as part of the hosted API with API keys too:
https://api.protomaps.com/styles/v2/dark.json?key=KEY
from basemaps.
Go to https://maps.protomaps.com/ and choose "get Style JSON" and inline that JSON into your application. This lets you customize it as well.
Because the JSON is static I don't see huge value in embedding the style into the Lambda API. The other option if you're using JS is to load the style object from NPM but I don't think that is relevant to Flutter.
PMTiles are static archives of tiles, vector or raster. If you want to store raster tiles you need to generate those raster tiles somewhere. Converting from vector to raster tiles requires a rasterizer like Mapnik or MapLibre GL Native which is computationally heavy and outside the scope of this project.
from basemaps.
It would be convenient if the style.json
for the respective default styles is also provided as part of the API (would make it easier to use with https://maputnik.github.io). One workaround to get a hosted style json, is to use the daily builds https://maps.protomaps.com/builds/ -> Compare in Maperture -> something like https://build-metadata.protomaps.dev/[email protected]+theme@[email protected]
from basemaps.
I have that as part of the hosted API with API keys too:
That's neat and exactly what @coogle and I was looking for. Would be great to mention in the docs (e.g. https://protomaps.com/other), especially for users familiar with Mapbox/OpenMapTiles etc. Did not know about protomaps-themes-base
as I only found this repo and thought users were expected to build the style.json themselves
Is there another case for needing a style.json?
Other than the online maputnik, I use it for working with other map clients and libraries where it is convenient to download/reference a style that already exists and just override the tile url or strip out the parts I don't need
from basemaps.
I listed out the hosted style endpoints at https://protomaps.com/other
The styles as part of the open source project have source code at https://github.com/protomaps/basemaps/tree/main/styles and also are compiled into layers objects like this: http://unpkg.com/[email protected]/dist/layers/dark.json - seems easiest to let you assemble your own Style
object with the correct sources
keys. Let me know if you find a better way!
from basemaps.
Related Issues (20)
- Missing boundaries in various places `pmap:min_admin_level 4` HOT 3
- Inconsistent naming and presence of disputed border attribute
- Low contrast in the "contrast" style HOT 5
- pmtiles center coordinates wrong (was:not able to render pmtiles file in maplibreGL) HOT 7
- Place labels in Uganda HOT 3
- Poor low-zoom generalization of linear water features comprised of areas HOT 1
- More simplification on country borders HOT 3
- Some landuse elements missing: village_green, allotments, playground HOT 6
- School Building heights are being incorrectly parsed/inferred HOT 3
- Rome vs Vatican State HOT 5
- Disconnected roads at zooms < 6 HOT 3
- Major road minzoom HOT 3
- More baselayers HOT 3
- make monaco fails on first run HOT 1
- better minzoom ranking for water labels HOT 1
- TS and JS build files of npm package out of sync HOT 29
- export 'default' (imported as 'layers') was not found in 'protomaps-themes-base' (module has no exports) HOT 5
- Add basic support for sprites HOT 5
- Mechanism for disputed map labels HOT 2
- Generate basemap with richer/more specific tags/layers HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from basemaps.