CesiumGS / CesiumGS/cesium-unity

WMS URL encoding issue while using CesiumWebMapServiceRasterOverlay.cs

Open
#563 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
535
Forks
132
Avg merge
6h 45m
Merged PRs (30d)
1

Description

## Unity Version:
- Unity 6 (6000.0.32f1)

## Cesium-Unity Version:
- 1.15.5

## Issue Description:
The WMS raster overlay works correctly in the Unity editor, during Holographic Remoting for Play Mode, and when the Build Configuration is set to Debug. However, when the Build Configuration is set to Release and deployed on HoloLens 2, an error occurs. Upon investigating the error, it appears that the issue lies with the bounding box (`bbox`) parameter in the URL, which is dynamically generated by Cesium. There seems to be an issue with the URL encoding when the Build Configuration is set to Release.

## Error Details:
As per the logs, the WMS URL is formed as follows:
https://www.ncei.noaa.gov/thredds/wms/model-gfs-004-files/202502/20250201/gfs_4_20250201_0600_006.grb2?ELEVATION=2&TIME=2025-02-01T12%3A00%3A00.000Z&TRANSPARENT=true&STYLES=boxfill%2Frainbow&COLORSCALERANGE=234.2%2C313.3&NUMCOLORBANDS=20&LOGSCALE=false&layers=Temperature_height_above_ground&request=GetMap&TRANSPARENT=TRUE&version=1.3.0&service=WMS&format=image%2Fpng&styles=&width=256&height=256&bbox=-90%2C000000,0%2C000000,90%2C000000,180%2C000000&layers=&crs=EPSG:4326

The issue specifically arises with the `bbox` parameter:
bbox=-90%2C000000,0%2C000000,90%2C000000,180%2C000000

## Expected Behavior:
The URL should be formed with the `bbox` parameter encoded correctly:
https://www.ncei.noaa.gov/thredds/wms/model-gfs-004-files/202502/20250201/gfs_4_20250201_0600_006.grb2?ELEVATION=2&TIME=2025-02-01T12%3A00%3A00.000Z&TRANSPARENT=true&STYLES=boxfill%2Frainbow&COLORSCALERANGE=234.2%2C313.3&NUMCOLORBANDS=20&LOGSCALE=false&layers=Temperature_height_above_ground&request=GetMap&TRANSPARENT=TRUE&version=1.3.0&service=WMS&format=image%2Fpng&styles=&width=256&height=256&bbox=-90%2E000000,0%2E000000,90%2E000000,180%2E000000&layers=&crs=EPSG:4326

Thus, the `bbox` parameter should be set as:
bbox=-90%2E000000,0%2E000000,90%2E000000,180%2E000000

## Screenshot:
![Error Screenshot](https://github.com/user-attachments/assets/f138e3b4-1dbc-43db-8b07-8aeee3fd18e1)

## Additional Information:
Please investigate the encoding issue with the `bbox` parameter when the Build Configuration is set to Release.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.