0

I'm working on a geolocation-based game, currently using MapBox API, we need to spawn a GameObject in every neighbourhood, MapBox have a script to spawn in map when the user is closer enough to a spot, the problem is, i have to put all the coordinates manually, and that is just impossible because of the number of neighborhoods in the world.

Edit: MapBox is a Geolocation service for real-time mapping. It's a SDK for Unity. all configuration is in-editor, so no revelant scripts to show off. My problem is to spawn in every neighbourhood, this kinds of tags already exists inside Mapbox API, but i have no clue how to use

Edit 2: Im trying to make it search automatic for an neighbourhood, and so put an gameobject there whatever he claims to be a neighbourhood.

Is there a smarter way to spawn that? Like a instruction to spawn in determinated places that im missing?

I'll leave some links to MapBox here. API playground (here you can see how the api works): Link

API reference (if it helps somehow, doesn't helped me yet): Link

Add markers tutorial: Link

el_diego
  • 9
  • 4
  • 2
    Pretend that none of us here has any clue what MapBox is or does and how you use it in your project. Do you have any code to show? What is a `neighbourhood` here and what data does it hold? – derHugo Sep 23 '19 at 07:17
  • sorry for not make it clear, MapBox is a Geolocation service for real-time mapping. It's a SDK for Unity. all configuration is in-editor, so no revelant scripts to show off. My problem is to spawn in every neighbourhood, this kinds of tags already exists inside on Mapbox, but i have no clue how to use. – el_diego Sep 23 '19 at 11:01
  • Can you add the tags/data that Mapbox provides that you are using as a `neighborhood`? And do you want to spawn objects everywhere in the world all at once, or are you trying to automate the discovery of `neighborhood`? It's not completely clear what you are trying to achieve. – Colin Young Sep 23 '19 at 12:36
  • Yes, im trying to make it search automatic for an neighbourhood, and so put an gameobject there. I'll leave some links to MapBox here. API playground (here you can see how the api works): https://docs.mapbox.com/api-playground/#/?_k=zfj67t API reference (if it helps somehow, doesn't helped me yet): https://docs.mapbox.com/mapbox-unity-sdk/api/ Add markers tutorial: https://docs.mapbox.com/unity/maps/overview/add-markers/ And sorry again, never asked here before :v – el_diego Sep 23 '19 at 19:37
  • What data are you using to determine a `neighborhood`? Is it existing, or have you added custom data? e.g. are you using `place_label` from `mapbox.mapbox-streets-v7`? – Colin Young Sep 24 '19 at 12:35
  • so I deduced this info based on the playground API that I quoted up there. I don't know how to access this info in unity. – el_diego Sep 24 '19 at 13:34
  • I'd suggest looking at the [Data Explorer example](https://docs.mapbox.com/unity/maps/examples/data-explorer/). You _will_ need to look into the scripts they use. The POI section will give you some ideas on how to spawn GameObjects in specific locations. I'll try to post a more detailed answer tonight when I get in front of Unity. – Colin Young Sep 24 '19 at 15:45
  • I did a research here, and yes, it helped a bit, but i feel i will have to create an custom data to the map. Later i'll try this: https://docs.mapbox.com/unity/maps/overview/custom-maps/#use-custom-data – el_diego Sep 24 '19 at 21:58

0 Answers0