question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hillshading contained in mapbox style.json not rendered

See original GitHub issue

Hello,

In the style.json we are using, we have set multiple data sources, vector, raster, and raster-dem for elevation (hillshading and potentially have also hypsometric tints)

 "sources": {
    "contours": {
      "type": "vector",
      "url": "https://xxxxxx.com/europe-contours-copernicus.json"
    },
    "natural-earth-2": {
      "type": "raster",
      "maxzoom": 6,
      "tiles": [
        "https://xxxxx.com/naturalearth2/{z}/{x}/{y}.png"
      ]
    },
    "openmaptiles": {
      "type": "vector",
      "url": "https://xxxxx.com/data/planet.json"
    },
    "world-rgb-png": {
      "type": "raster-dem",
      "minzoom": 5,
      "maxzoom": 11,
      "encoding": "terrarium",
      "tiles": ["https://xxxxxxx.com/world/{z}/{x}/{y}.png"]
    },
    "relief-france-hd": {
      "type": "raster-dem",
      "tiles": [
        "https://xxxxxx.com /terrain/{z}/{x}/{y}.png"
      ],
      "minzoom": 6,
      "maxzoom": 15
    }
  },

The layer for hillshading is placed AFTER landuse and landcover layers in the style file :

    {
      "id": "Hillshading-france",
      "type": "hillshade",
      "source": "relief-france-hd",
      "minzoom": 7,
      "filter": ["all"],
      "layout": {"visibility": "visible"},
      "paint": {
        "hillshade-accent-color": "rgba(110, 58, 31, 1)",
        "hillshade-exaggeration": 0.5,
        "hillshade-shadow-color": "#665942",
        "hillshade-illumination-direction": 315
      }
    },

It is actually not rendered and we cannot find a proper way to retrofit its usage since it should be displayed within the layer order set in the style.json file.

For the other source layers we have the same problem (natural earth, contours) but the workaround solution is -almost- acceptable.

We have also not been able to find a way to reproduce the nice “accent-color” property in openlayers.

Any chance someone could implement this ?

View with Openlayer using the workarounds : Capture d’écran 2022-11-07 070011

View with maplibre directly interpreting the style.json (we are using more detialed source for relief here) : Capture d’écran 2022-11-07 070034

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ahocevarcommented, Nov 7, 2022

Hoping is good, contributing is better - if not by writing code, then via https://github.com/sponsors/ahocevar.

0reactions
utagawalcommented, Nov 12, 2022

Thanks but unfortunatelly I’m not a dev, I can understand a bit of code but that’s it…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Layers | Style Specification | Mapbox GL JS
Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.
Read more >
mapbox-gl-js/style.json at main - GitHub
Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL - mapbox-gl-js/style.json at main · mapbox/mapbox-gl-js.
Read more >
A Complete Guide to Sources and Layers in React and ...
If your spatial data is static and will not need to respond much to ... https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/#geojson.
Read more >
OpenLayers Examples
Example of a Mapbox vector tiles map with custom tile grid. ... Demonstrates the use of style geometries to render source features of...
Read more >
Map Style Specification | Map Display API
Purpose Map style is written in JSON format. ... no, none, Attribution that is shown when the map is displayed. ... string, no,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found