|
1 | | -# Feature Layer |
| 1 | +# Query a feature layer |
2 | 2 |
|
3 | 3 | Query objects from a feature layer and show them on the map. |
4 | 4 |
|
5 | 5 |  |
6 | 6 |
|
| 7 | +## How to use the sample |
| 8 | + |
| 9 | +1. Open the **FeatureLayer_lvl** level. |
| 10 | +2. Click on the **ArcGISMapActor** in the Outliner panel. |
| 11 | +3. Set your API key under Authentication section in the Details panel. |
| 12 | +4. Click play and select a stadium from the list. |
| 13 | + |
7 | 14 | ## How it works |
8 | 15 |
|
9 | | -1. Create an http request in the project's gamemode.cpp and gamemode.h |
10 | | -2. Using the UE_LOG, confirm that you are gathering the data properly. |
11 | | -3. Create a new Blueprint class and cast to the gamemode. |
12 | | -4. Using the cast, get the data stored from the http request. |
13 | | -5. Spawn in a new actor of the class you created above and set the data accordingly. |
| 16 | +1. Create a new C++ class and make a http request to [query a feature layer](https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-.htm). |
| 17 | +2. Create a new Blueprint Actor class |
| 18 | + - Create the event to place the stadium data returned from the feature layer. |
| 19 | + - Create a function to spawn the actor according to the stadium `NAME`. |
| 20 | + - Create a function to apply different materials according to the `LEAGUE` value. |
| 21 | + - Attach the [**ArcGIS Location Component**](https://developers.arcgis.com/unreal-engine/maps/location-component/) to the static stadium mesh model. |
| 22 | + - Create a function to place the static mesh model on the `geometry`'s `coordinates` location returned by the feature layer query and the height calculated by [raycasts](https://docs.unrealengine.com/5.0/en-US/using-a-single-line-trace-raycast-by-channel-in-unreal-engine/). |
| 23 | +3. Create a widget for the viewport so users can select a stadium from the list fed from the feature service. |
| 24 | + |
| 25 | +Note: You can use `UE_LOG` to print log messages in the **Output Log** window and see if you are gathering the data properly from the feature service. |
14 | 26 |
|
15 | 27 | ## About the data |
16 | 28 |
|
17 | | -Data for all Major League Baseball Stadiums in the United States [Feature Layer](https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/Major_League_Baseball_Stadiums/FeatureServer/0/query?f=geojson&where=1=1&outfields=TEAM,NAME,LEAGUE) hosted by Esri. |
| 29 | +Data for all Major League Baseball Stadiums in the United States [Feature Layer](https://www.arcgis.com/home/item.html?id=f60004d3037e42ad93cb03b9590cafec) hosted by Esri. (Format the request URL for the [query](https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/Major_League_Baseball_Stadiums/FeatureServer/0/query?f=geojson&where=1=1&outfields=TEAM,NAME,LEAGUE).) |
18 | 30 |
|
19 | 31 | Elevation data is loaded from the [Terrain 3D elevation layer](https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4) hosted by Esri. |
20 | 32 |
|
|
0 commit comments