Comments (19)
@Naphier Thanks for the report! I have an idea what the issue is, but you can help me confirm. In your HTTPRequest
class, please log the url
. Copy the url and paste it into your web browser. Does the data look complete?
If the data (or url) are incorrect, you will need to check that all of your factories are using a proper MapID
. It seems in some circumstances, the MapID does not maintain serialization across projects or is corrupted by Unity version differences.
from mapbox-unity-sdk.
I'm using the MapID from MapboxStudio:
And I'm getting the same issue under the same setup as @Naphier.
When debugging the URL, I get:
https://api.mapbox.com:443/v4/ahokinson.8ww3j897/9/157/190.vector.pbf
Where I have excluded the access token.
from mapbox-unity-sdk.
I should note that my map tiles are created, but in trying to use custom POI data, I get these errors.
from mapbox-unity-sdk.
@Naphier @ahokinson When you paste the url into your browser, does it download a .pbf file? When testing https://api.mapbox.com:443/v4/ahokinson.8ww3j897/9/157/190.vector.pbf
I get:
{
"message": "Tile does not exist"
}
When using my access token.
from mapbox-unity-sdk.
After adding in a Debug.Log message into the HTTPRequest's constructor everything I am able to get the maps. When I use the DriveVisualization (map visualisation) everything seems to be OK. Maybe it's something to do with async and Unity and the Debug.Log message is ensuring the main thread completes a cycle before starting the DoRequest coroutine?
.
My URLS show an image in the browser.
.
So if I have a range of 1,1,1,1 it now works OK. But if I do a range of 10,10,10,10 it will get me the tiles then start throwing index out of range exceptions.
IndexOutOfRangeException: Array index is out of range.
Mapbox.VectorTile.VectorTileReader..ctor (System.Byte[] data, Boolean validate)
Mapbox.VectorTile.VectorTile..ctor (System.Byte[] data, Boolean validate)
Mapbox.Map.VectorTile.ParseTileData (System.Byte[] data) (at Assets/Mapbox/Core/Map/VectorTile.cs:106)
UnityEngine.Debug:LogException(Exception)
Mapbox.Map.VectorTile:ParseTileData(Byte[]) (at Assets/Mapbox/Core/Map/VectorTile.cs:112)
Mapbox.Map.Tile:HandleTileResponse(Response) (at Assets/Mapbox/Core/Map/Tile.cs:155)
Mapbox.Unity.<DoRequest>c__Iterator0:MoveNext() (at Assets/Mapbox/Core/Unity/HTTPRequest.cs:40)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
vectorTile.Error: ParseError responseData: 20
parameters: Id: 16/18831/24226 MapId: mapbox.mapbox-traffic-v1,mapbox.mapbox-streets-v7 Fs: Mapbox.Unity.FileSource
UnityEngine.Debug:LogFormat(String, Object[])
Mapbox.MeshGeneration.Factories.<CreateMeshes>c__AnonStorey1:<>m__0() (at Assets/Mapbox/Scripts/MeshGeneration/Factories/MeshFactory.cs:89)
Mapbox.Map.Tile:HandleTileResponse(Response) (at Assets/Mapbox/Core/Map/Tile.cs:162)
Mapbox.Unity.<DoRequest>c__Iterator0:MoveNext() (at Assets/Mapbox/Core/Unity/HTTPRequest.cs:40)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
from mapbox-unity-sdk.
@david-rhodes I do see that now...
Given these factories, do you have any suggestions?
What I find odd is that using the example dataset works. I uploaded a geojson file to MapBox studio to test with. It looks okay to me, but maybe I've used Studio completely wrong. That's a strong possibility...
from mapbox-unity-sdk.
My URLS show an image in the browser.
You should not see an image for a vector tile request. Can you post a url without your access token? It doesn't look like you are using a custom tileset, but my best guess is that data is missing for a tile somewhere in that larger range.
from mapbox-unity-sdk.
@ahokinson My guess is that your data does not exist for the tiles you are requesting. Have you tried a different region or zoom level?
from mapbox-unity-sdk.
@david-rhodes Trying just now yields the same results with different amounts of ParseErrors. Even if there was no data for a tile, would a ParseError really be expected?
Here is everything working with the standard poi_label set from mapbox.mapbox-streets-v7
Is there something required of datasets to work with the PoiMesh system?
from mapbox-unity-sdk.
Even if there was no data for a tile, would a ParseError really be expected
Well, I'm not sure that we are handling a case of "tile missing" at this moment. Probably just an oversight on our part. So, if the data (which is not a valid .pbf at this point) cannot be parsed as expected, that's the error you will see.
Is there something required of datasets to work with the PoiMesh system?
No. The root of this problem is that your url requests are not valid. Are you able to share your tileset with me? If you add that tileset to a studio style, does it render as you would expect?
from mapbox-unity-sdk.
Yeah, I definitely agree with you on the first point. I just thought you were implying this might be normal. My mistake.
The data I'm using for experimenting is as follows:
cities.txt
I'm willing to share the tileset, but I'm not sure how. When I attach it to a style, it appears correctly:
from mapbox-unity-sdk.
@ahokinson Ok, I think I've solved the problem.
I uploaded your data to my own tileset and added it's ID to the mesh factory. When requesting your tile coordinates, I also got "no tile exists." But, when requesting the San Francisco area, for example, I do see POIs being created and the url request is valid (downloads a pbf and everything).
That said, I did have to remove:
if (!feature.Properties.ContainsKey("name"))
return;
and
var tm = go.GetComponent<ILabelVisualizationHelper>();
tm.Initialize(feature.Properties);
from PoiVisualizer.cs
to be compatible with this dataset. The reason is because of an early return since name
was not a valid feature in your set.
The ParseError
is a generic error, which I just realized is a bug. We actually have more robust error reporting available. But, this occurs when requesting a tile that does not contain any data. I'm assuming our servers do not generate tiles that are not needed (as data does not exist). Therefore, we cannot parse a "null" tile. 😏
Anyway, change your code as above and you should see some POIs.
from mapbox-unity-sdk.
I made the first change, but not the second because I implemented the ILabelVisualizationHelper interface which is actually a very convenient spot to initialize my objects. :)
And sure enough, I can see markers!
Thanks for persisting with me on this one! Everything seems to make sense now, but it wouldn't have without your responses. Glad to hear robust error handling will be coming in the future.
from mapbox-unity-sdk.
Awesome! That makes sense--most people don't implement ILabelVisualizationHelper
, so that's why I suggested its removal.
We need developers like you to help find bugs and suggest improvements. However, please have patience as we are still in beta.
from mapbox-unity-sdk.
Lol I'm sorry. I don't mean to sound impatient. It's the frustration of being mostly correct, but missing something very small. I absolutely love this sdk and the potential it offers. It could not have been made public at a better time. Thanks for your hard word. Seriously, it's much appreciated!
from mapbox-unity-sdk.
Thanks @ahokinson! Please continue to provide feedback or even contribute with your own improvements! 😄
from mapbox-unity-sdk.
@Naphier Did any of the above help you? If not, which tiles specifically are not being created?
from mapbox-unity-sdk.
After a bit of goofing around I think that my issue was actually an invalid API token. I removed a character from the token to test this out and I'm getting the same parse error as before. So perhaps it wasn't being serialized properly or maybe I made a mistake?!
It does seem to be fixed now and everything's working. Try putting in a bad API key and actually logging the exception from VectorTile.ParseTileData in the existing try-catch and you'll see the "Unkown Tile tag : 15" exception. I think the easiest solution for this is to just verify the token before initiating the tile data requests. But then again, maybe the new method of using the token that you mentioned in #46 will make this less of an issue.
Thanks for the quick support!
from mapbox-unity-sdk.
@Naphier Yes, the MapboxAccess
editor will validate tokens! Thanks for keeping us posted!
from mapbox-unity-sdk.
Related Issues (20)
- Unexpected behaviour on SetZoom HOT 1
- The 3D models on the map change their position when locating is activated.
- Setting the Map Extent Options to CameraBounds at runtime doesn't work HOT 1
- Spawn prefabs upwards with a fixed gap
- why only mapbox street v7 can edit POI prefab
- Mapbox + Unity Cloud Build
- Error: Cannot Initialize non-default texture with negative or zero width HOT 1
- suddort URP ? HOT 2
- How to Apply Texture to Tiles
- Swapped North/South and West/East coordinates in Tile Id To Bounds?
- This project is dead? HOT 12
- Your hardware does not support this application. Failed to load 'libmain.so' java.lang.UnsatisfiedLinkError: dopen failed: library "libmain.so" not found HOT 1
- Can I make changes to AbstractMap's Features?
- Can I make changes to AbstractMap's Map Layers Tileset ID via code during runtime?
- heatmap rendering issue
- Meta Quest 3 Build Issues
- Some Building Meshes get "cutoff"
- Mapbox building:levels property support of Unity SDK HOT 3
- language support for raster tile
- Unity - Mapbox environment "Profiles"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapbox-unity-sdk.