"building_id" property will show fill-extrusion layer with wrong heights
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
### mapbox-gl-js version
3.28.1
### Browser and version
151.0.7922.77
### Expected behavior
feature property `building_id` does not have any influence of any rendering when it is not used in style.
So a `fill-extrusion` layer together with a terrain will be rendered as normal also if features has `building_id` as a string property.
### Actual behavior
Will show `fill-extrusion` layers with strange heights at tile borders when using it together with terrain. Height will be correct when i delete my property `building_id`, which is an string uuid.
looks like `building_id`is used internally and needs to be an number, otherwise breaks.
https://github.com/mapbox/mapbox-gl-js/blob/v3.28.1/src/data/bucket/fill_extrusion_bucket.ts#L1080
```
if (feature.properties && Object.hasOwn(feature.properties, 'building_id')) {
centroid.buildingId = Number(feature.properties['building_id']);
}
```
might be that it can be fixed by
- also check if its an number
- allow string
- make the property key configable
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/data/bucket/fill_extrusion_bucket.ts around line 1080, then reproduce a terrain fill-extrusion layer using a string-valued building_id property. Trace how that property affects centroid building IDs and verify the fix by confirming unused string properties no longer produce incorrect heights at tile borders.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100