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

Error: Cannot Initialize non-default texture with negative or zero width #1908

Open
pholz opened this issue Jun 29, 2023 · 1 comment
Open

Comments

@pholz
Copy link

pholz commented Jun 29, 2023

I installed mapbox-unity, and in every example, or using the map prefab I get the error below (my setup/token is valid):

Unity version 2023.1.0b20 macOS (apple silicon), HDRP pipeline
mapbox SDK version 2.0.1, downloaded from official site

Cannot initialize non-default texture with negative or zero width.
UnityEngine.Texture2D:.ctor (int,int,UnityEngine.TextureFormat,bool)
Mapbox.Unity.MeshGeneration.Data.UnityTile:SetRasterData (byte[],bool,bool) (at Assets/Mapbox/Unity/MeshGeneration/Data/UnityTile.cs:294)
Mapbox.Unity.MeshGeneration.Factories.MapImageFactory:OnImageRecieved (Mapbox.Unity.MeshGeneration.Data.UnityTile,Mapbox.Map.RasterTile) (at Assets/Mapbox/Unity/MeshGeneration/Factories/MapImageFactory.cs:71)
ImageDataFetcher/<>c__DisplayClass2_0:<FetchData>b__0 () (at Assets/Mapbox/Unity/MeshGeneration/Factories/ImageDataFetcher.cs:49)
Mapbox.Map.Tile:HandleTileResponse (Mapbox.Platform.Response) (at Assets/Mapbox/Core/mapbox-sdk-cs/Map/Tile.cs:244)
Mapbox.Platform.Cache.CachingWebFileSource:Request (string,System.Action`1<Mapbox.Platform.Response>,int,Mapbox.Map.CanonicalTileId,string) (at Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs:166)
Mapbox.Unity.MapboxAccess:Request (string,System.Action`1<Mapbox.Platform.Response>,int,Mapbox.Map.CanonicalTileId,string) (at Assets/Mapbox/Unity/MapboxAccess.cs:234)
Mapbox.Map.Tile:Initialize (Mapbox.Platform.IFileSource,Mapbox.Map.CanonicalTileId,string,System.Action) (at Assets/Mapbox/Core/mapbox-sdk-cs/Map/Tile.cs:144)
ImageDataFetcher:FetchData (DataFetcherParameters) (at Assets/Mapbox/Unity/MeshGeneration/Factories/ImageDataFetcher.cs:35)
Mapbox.Unity.MeshGeneration.Factories.MapImageFactory:OnRegistered (Mapbox.Unity.MeshGeneration.Data.UnityTile) (at Assets/Mapbox/Unity/MeshGeneration/Factories/MapImageFactory.cs:127)
Mapbox.Unity.MeshGeneration.Factories.AbstractTileFactory:Register (Mapbox.Unity.MeshGeneration.Data.UnityTile) (at Assets/Mapbox/Unity/MeshGeneration/Factories/AbstractTileFactory.cs:71)
Mapbox.Unity.Map.AbstractMapVisualizer:LoadTile (Mapbox.Map.UnwrappedTileId) (at Assets/Mapbox/Unity/Map/AbstractMapVisualizer.cs:266)
@ritolika
Copy link

ritolika commented Jul 6, 2023

In UnityTile.cs row 293
do

_rasterData = new Texture2D(1, 1, TextureFormat.RGB24, useMipMap);

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

No branches or pull requests

2 participants