Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Raster DEM source serialization #2895

Merged
merged 2 commits into from
Jul 22, 2023
Merged

Fix Raster DEM source serialization #2895

merged 2 commits into from
Jul 22, 2023

Conversation

neodescis
Copy link
Collaborator

@neodescis neodescis commented Jul 21, 2023

Closes #2889.

While investigating the issue, I determined that not only are undefined properties included when serializing, but not all relevant properties are included either (e.g. minzoom and maxzoom). However, I can see no reason to not just use the base class RasterTileSource's serialize() function directly. So, I've removed the function from RasterDEMTileSource, and added a test for both RasterTileSource and RasterDEMTileSource.

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

minzoom: 2,
maxzoom: 10
});
expect(source.serialize()).toStrictEqual({
Copy link
Collaborator Author

@neodescis neodescis Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regular toEqual() assertion doesn't fail on properties that are unexpectedly present but undefined, whereas toStrictEqual() does

@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2023

Codecov Report

Patch coverage: 91.83% and project coverage change: +0.01 🎉

Comparison is base (fac50bf) 74.48% compared to head (41fe381) 74.49%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2895      +/-   ##
==========================================
+ Coverage   74.48%   74.49%   +0.01%     
==========================================
  Files         238      238              
  Lines       19002    19018      +16     
  Branches     4284     4285       +1     
==========================================
+ Hits        14153    14167      +14     
- Misses       4849     4851       +2     
Impacted Files Coverage Δ
src/source/raster_dem_tile_source.ts 50.00% <ø> (-1.29%) ⬇️
src/ui/handler_manager.ts 96.47% <50.00%> (ø)
src/ui/map.ts 82.92% <81.25%> (-0.04%) ⬇️
src/geo/transform.ts 97.41% <100.00%> (-0.04%) ⬇️
src/render/terrain.ts 96.04% <100.00%> (+0.36%) ⬆️
src/source/vector_tile_worker_source.ts 96.10% <100.00%> (-0.05%) ⬇️
src/ui/camera.ts 95.14% <100.00%> (+0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@HarelM
Copy link
Collaborator

HarelM commented Jul 22, 2023

Thanks! Please add a changelog entry.

@neodescis
Copy link
Collaborator Author

Entry added!

@HarelM HarelM enabled auto-merge (squash) July 22, 2023 14:14
@HarelM HarelM merged commit 1674322 into maplibre:main Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raster DEM sources are not serialized correctly
3 participants