Table of contents
1. Mapbox account registration
To use the Mapbox plug-in for unity, you first need to register an account on the official website, enter the official website and click sign up in the upper right corner to register, and fill in the user information. → Mapbox official website link
After this step, you need to add credit card information. Since there are no resources in this area, I found a small tool to randomly generate a credit card account at that time. You can temporarily respond to emergencies, or you can directly use the information in the picture. → Generate a random account.
After clicking get started, it will show that the submission failed. Don’t worry about it. After receiving the email, verify it to complete the registration. After successful registration, you can see the Access Token in the account information, which will be used later.
Two, Unity import
I am using the mapbox v2.1.1 version of the package here. If you need it, you can contact me directly, and I will give the corresponding link later.
It should be noted here that it may be that the mapbox update has not kept up, and AR-related packages are not compatible with unity2020 and above, so we only check the mapbox option to import.
After the import is successful, the error shown in the figure below will be reported, and the corresponding code segment will be found.
It can be solved by removing the comment of the heading variable declaration.
After the modification, the setup window will pop up. If there is no pop-up window, you can click mapbox->setup on the toolbar to set it yourself, copy the previous Access Token and submit it to use.
3. Set the satellite map
First create an empty game object named Map, and add the Abstract Map component to the Map object. In the Inspector view, you can set related properties as needed. In the IMAGE property, set the Data Source to Mapbox statellite to display the satellite map.
Realize the effect ↓