Coder Social home page Coder Social logo

osm-liberty's Issues

Script to catch unnecessary style elements

There are several style elements, like visibility: visible that are unnecessary because those are the same as the defaults. It seems advantageous and not very difficult to write a short JS script to test PRs for these elements. (It could also be added to the pre-commit hook).

My thinking is to simply traverse the JSON and check each element of each style rule against that rule's default value. So the first step I suppose is to construct a list of the style defaults.

Provide font metadata

Motivation:

  • To prevent confusion when using the style with Maputnik. Currently there is a 404/warning logged because there is no metadata file available for
    https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf :
    auswahl_423

  • To benefit from Maputnik's ability to show available fonts, e.g. this is how it looks with
    http://fonts.openmaptiles.org/{fontstack}/{range}.pbf, there is a metadata file available:
    font_preview
    This might be helpful in a case like #30.

Some thoughts about possible options:

  1. Add a metadata file to https://github.com/orangemug/font-glyphs.
  2. Use https://github.com/orangemug/font-glyphs-v2 if Maputnik would be able to use such metadata.
  3. Use https://maps.tilehosting.com/fonts/{fontstack}/{range}.pbf?key={key}. There is metadata available and we use Maptiler Cloud also as default for the tiles.

//cc @orangemug

Styling of protected areas

I think current rendering is quite confusing, see:
http://osm-liberty.lukasmartinelli.ch/#12.96/54.2656/18.0823
http://osm-liberty.lukasmartinelli.ch/#14.2/54.5175/18.5117

First, it's not obvious, as green is associated with vegetation, which may not be there. Secondly, whole settlements get filled. Last, as you can see from these two examples, forest and protected area doesn't stack well, in the first area light green is protected area, while in second light green indicates a forest.
Maybe just styling their outline would be more appropriate, like in osm-carto. Note there is no label, too.
The other problem is due to Mapbox Streets schema, in which for weird reasons national parks are conflated together with city parks, which doesn't make sense at all.
Also, the example areas are only landscape parks (differentiated by protect_class), which don't have permanent staff in them (no rangers or guides, though regular maintenance may take place). These areas often have however designated trails, educational/information boards, but allow for a modest level of human activity, so that entire villages may be enclosed by them.

Make the style easier to use

Because osm-liberty uses tilehosting.com for it's data sources for someone to use the style they first have to download the style and edit this line, replacing {key}

"url": "https://free.tilehosting.com/data/v3.json?key={key}"

That seems like a awkward user experience to me, so I made https://github.com/orangemug/mapbox-gl-tokens which hopefully resolves that issue.

What does everybody think about adding https://github.com/orangemug/mapbox-gl-tokens to the README.md?

Add script to format and validate the style

As a possible workaround to the JSON formatting issues mentioned in #66 and maplibre/maputnik#591, it might be easiest to just add gl-style-format in place as a Git pre-commit hook. It should be as simple as adding an NPM package.json with a couple dev dependencies, e.g. nst-guide@75b0657#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R24-R32
(for now, that only validates, not formats in place)

Before writing up a PR, just wanted to check if this is of interest.

Maptiler key broken

The maptiler key for displaying through web Maputnik is presumably broken. When I get to the end of the Natural Earth layers, it's just blank:
image

One way arrow isn't very clear

The one-way-arrow is not very clear. If you look on it, you couldn't see, in which direction it goes.

grafik

Even in the sprite atlas it isn't very clear.

grafik

As you see, the arrow is very inconspicuous. It is hard to see, in which direction it goes. If it is rotated, then it gets even worse.

Self hosted offline

I'm using an openmatiles.com self-hosted server with default styles and additionally osm-liberty.
All styles work fine when creating offlinepacks with react-native-mapbox-gl apart from osm-liberty.
Is there anything that I need to configure or consider when trying to use this style offline?
It's working perfectly fine when connected, but it won't cache the last seen map view or work when downloaded as a pack.

Missing POI icons

There are some POIs without an icon, e.g.:

grafik

There are some new Maki icons, so it would be good to check if there are any new icons we could use for missing ones:

OpenMapTiles POI layer:
https://github.com/openmaptiles/openmaptiles/tree/master/layers/poi

Maki icons:
https://labs.mapbox.com/maki-icons/

Currently used iconset:
https://github.com/maputnik/osm-liberty/blob/gh-pages/iconset.json

SVGs for the used iconset:
https://github.com/maputnik/osm-liberty/tree/gh-pages/svgs/svgs_iconset

How to add new icons to the sprites used for the style:
https://github.com/maputnik/osm-liberty#icon-design

Error reading style file

Tried to load the the style file in tileserver-gl, But it shows an error like this. from where should i get correct config and style file?
Screenshot from 2024-03-26 12-27-04

Tile boundaries stop at zoom 6 after setting showTileBoundaries = true

Visit the style page, open the javascript console, and:

maps['osm-liberty'].showTileBoundaries = true;

Once done you'll notice red lines delimiting the tile boundaries in the osm-liberty demo map, with the tile coordinates in the top left corner of each red box.

Then zoom the osm-liberty map beyond zoom level 6, and the tile boundaries disappear.

I found this out because I've copied this style to a map I'm working on as a proof-of-concept for the use of mapbox-gl for my company. I've noticed this problem is tied to the natural_earth layer in style.json. If I completely remove this layer definition and reload the page, setting showTileBoundaries = true does absolutely nothing. If I remove the source declaration for natural_earth_shaded_relief after removing the natural_earth layer, everything works as expected.

I'll also file this bug on mapbox-gl's git and cross reference.

One way roads

I noticed that oneway is an attribute on the transportation class of openmaptiles, but from a search of the repository it doesn't look like it's used. It might be nice to add a subtle arrow on one way roads

Add rendering for place=quarter

OSM Liberty currently renders place=neighbourhood and place=suburb, but not the intermediate place=quarter (OSM wiki). I have opened an issue at OpenMapTiles (openmaptiles/openmaptiles#1064) to add place=quarter there as well.

OSM Liberty only uses the words neighbourhood and suburb in one place in style.json. Is it sufficient to add quarter there or is more needed for rendering?

OSM Liberty is used by the OSM-based website knooppuntnet.nl and I would like to fix the lack of place=quarter labels there (vmarc/knooppuntnet#136). Of course, as place=quarter is an established tag with over 40,000 uses it should benefit all users of this style.

Self Host Tiles

The Readme seems to imply that I can

host the tiles and assets yourself for complete liberty.

But the tiles don't appear to be in the repo. Have I misunderstood the intent? I see that the tiles are being served from a free, non-commercial-use CDN, but what if I do want to serve them myself, say offline?

Style also POI subclass?

from #110 (comment)

OSM Liberty style uses icons very basically: it's just "icon-image": "{class}_11".
In the future the subclass could be used, yes. But how?

specify an icon for each subclass (or maybe for each class-subclass pair)
=> are there some features with an empty subclass? if so, do we need a fallback?
=> will we accept to duplicate lots of icons? or can we create aliases in sprite.json?
for each subclass (or class-subclass pair), create rules in the style that select an icon

...what are your thoughts?

Highway shields

I was reading through the openmaptiles schema and saw that transportation_name had a key named network whose values say whether the motorway belongs to a standard network. (https://openmaptiles.org/schema/#transportation_name)

We could use those values to provide road shields that are more descriptive than a rectangle. This would encompass adding svgs to the sprite for each # of characters of ref

Here are US highway shields
https://commons.m.wikimedia.org/wiki/Category:Diagrams_of_U.S._Highway_shields

CA TransCanada: https://commons.m.wikimedia.org/wiki/File:TCH-blank.svg#mw-jump-to-license

Bad filter syntax

There are some layers with filters defined like:

      "filter": [
        "all"
      ],

They should be removed.

Vector natural earth tiles?

Has any thought been given to using the vector Natural Earth tiles? Currently osm-liberty only uses the natural_earth_shaded_relief raster tiles.

Take a look at this example map:
http://naturalearthtiles.lukasmartinelli.ch/maps/natural_earth.vector.html
image

Here's the style.json for that map. It looks like in that style.json the vector data is overlaid on top of the raster, so a PR to OSM-liberty would be adding the vector layers to the existing raster.

The current raster layer only shows shading, and doesn't include boundaries or labels. Presumably when OSM data has been generated for the entire world, the OSM labels show through at low zooms, but when you're generating tiles through OpenMapTiles for a specific part of the globe, labels are otherwise missing:
image

Vector natural earth tiles are also available on Klokantech's repo: https://github.com/klokantech/naturalearthtiles/tree/gh-pages/tiles/natural_earth.vector

So if there was interest in adding this, I'd think we'd set Natural Earth vector to display at zooms 0-6(?) and then set most/all other OSM features/labels to only display from zoom 7 onwards

Host fonts in repository

I'm curious how you'd feel about hosting fonts in this repository. It might make it slightly easier for people to use the style.

Currently, glpyhs points to

"glyphs": "https://api.maptiler.com/fonts/{fontstack}/{range}.pbf?key={key}"

which means someone can't use the style without adding a maptiler api key, or self hosting their own fonts.

As an example, in this repository I just store several fontstacks from openmaptiles/fonts releases in the git repository unzipped. That means I can just put glpyhs as

"glyphs": "https://raw.githubusercontent.com/kylebarron/openmaptiles-fonts/master/fonts/{fontstack}/{range}.pbf",

and serve them directly from Github.

So similarly, you could add the Roboto fontstacks to this repository (optionally on a non-master branch), and then host them directly from this repo.

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.