Code Monkey home page Code Monkey logo

Comments (5)

bdon avatar bdon commented on June 6, 2024 1

@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.

bdon avatar bdon commented on June 6, 2024

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.

prusswan avatar prusswan commented on June 6, 2024

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.

prusswan avatar prusswan commented on June 6, 2024

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.

bdon avatar bdon commented on June 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.