maplibre-react-native icon indicating copy to clipboard operation
maplibre-react-native copied to clipboard

ERROR Warning: Failed prop type: Invalid prop `style` supplied to `LineLayer`.

Open ivanoikon opened this issue 1 year ago • 0 comments

Steps to Trigger Behavior

  1. Add MapLibreGL.Style to MapLibreGL.MapView
  2. Add style asset file from MapTiler or Mapbox

Expected Behavior

Map loaded with local style from json asset

Actual Behavior

map crashes with error:

ERROR Warning: Failed prop type: Invalid prop style supplied to LineLayer.

Version(s) affected

  • Platform: Android, iOS not tested
  • OS version: Android 12, not tested with other versions
  • Device type: Tablet
  • Emulator/ Simulator: no
  • Development OS: OSX 13.6.1
  • maplibre-react-native Version 9.1.0

Additional context

I suppose there's a problem with "stops" properties. If I remove them from json style then there's no crashes The following piece of style lead to a crash

... { "id": "River tunnel", "type": "line", "source": "openmaptiles", "source-layer": "waterway", "minzoom": 14, "layout": { "line-cap": "round", "visibility": "visible" }, "paint": { "line-color": "hsl(210, 73%, 78%)", "line-width": { "base": 1.3, "stops": [[13,0.5],[20,6]] }, "line-dasharray": [2,4] }, "filter": [ "all", [ "==", "brunnel", "tunnel" ] ] }, ...

the following version without stops is ok

... { "id": "River tunnel", "type": "line", "source": "openmaptiles", "source-layer": "waterway", "minzoom": 14, "layout": { "line-cap": "round", "visibility": "visible" }, "paint": { "line-color": "hsl(210, 73%, 78%)", "line-width": 6, "line-dasharray": [2,4] }, "filter": [ "all", [ "==", "brunnel", "tunnel" ] ] }, ...

ivanoikon avatar Dec 06 '23 10:12 ivanoikon