am2222 / mapbox-pmtiles

A custom source to add PmTiles support to mapbox gl js. Supports both raster and vector pmtiles
https://am2222.github.io/mapbox-pmtiles/
12 stars 1 forks source link

Layer type symbol error #9

Open Mtehabsim opened 7 months ago

Mtehabsim commented 7 months ago

Hello, when adding a layer of type symbol It freeze and raise this:

uncaught TypeError: e is undefined continuePlacement pauseable_placement.js:35 continuePlacement pauseable_placement.js:109 _updatePlacement style.js:1751 _render map.js:3161 _frame map.js:3551 frame browser.js:37 _triggerFrame map.js:3545 triggerRepaint map.js:3539 _update map.js:3042 Map map.js:614 fire evented.js:129 fire evented.js:144 fire evented.js:144 update style.js:571 _render map.js:3135 _frame map.js:3551 frame browser.js:37 _triggerFrame map.js:3545 triggerRepaint map.js:3539 _update map.js:3042 addSource map.js:1993

index.html:34 fire evented.js:129 _render map.js:3188 _frame map.js:3551 frame browser.js:37 _triggerFrame map.js:3545 triggerRepaint map.js:3539 _render map.js:3253 _frame map.js:3551 frame browser.js:37 _triggerFrame map.js:3545 triggerRepaint map.js:3539 _render map.js:3253 _frame map.js:3551 frame browser.js:37 _triggerFrame map.js:3545 triggerRepaint map.js:3539 _render map.js:3253 _frame map.js:3551 frame browser.js:37 _triggerFrame map.js:3545 _render map.js:3265 _frame map.js:3551 frame browser.js:37 _triggerFrame map.js:3545 triggerRepaint map.js:3539 _update map.js:3042 Map map.js:614
am2222 commented 7 months ago

@Mtehabsim can you please share an example of the style you define for your layer?

Mtehabsim commented 7 months ago

@am2222 Sure


map.addLayer({
                    'id': 'points',
                    'type': 'symbol',
                    'source': 'pmTileSourceName',
                    "source-layer": "vector",
                    "filter": ["in", "$type", "Point"],
                    'layout': {
                        'icon-image': 'cat',
                        'icon-size': 0.25
                    }
am2222 commented 7 months ago

@Mtehabsim unfortunetly mapbox only supports symbols for vector and geojson sources not custom source types. we might be able to monkey patch it

https://github.com/mapbox/mapbox-gl-js/blob/fd2045fd6aef55d9265c9a4c43fb48b294289482/src/style/style.js#L1408