Query objects from the feature layer provided, or provide your own, in order to show them on the map.
How to setup (Feature Layer Level)
- Open the FeatureLayer_lvl level.
- Click on the ArcGISMapActor in the Outliner panel.
- Set your API key under the Authentication section in the Details panel.
- Click play and select a stadium from the list.
How to setup (Sample Viewer)
- Click Play in Unreal Editor.
- Input your API key under the API Key Drop-down.
- Click the Sample Drop-down and select Feature Layer.
How to use the sample
- A Feature Layer of park trees is already available. When you run the scene, these feature items are spawned at their default latitude and longitude with all their associated properties.
- Click on any of these objects under the Outliner drop-down in Unreal Engine to see its latitude, longitude, and any properties received by the query.
- The Outfields drop-down is set by default to Get All Outfields. Click on any other outfield to deselect Get All Outfields and return only the outfield selected; multi-select is supported. Outfields are the properties associated with individual features.
Important note
To change the default link, users can update the link in the input field. However, if the link they provide has different Request Headers than the default ones provided (/0/, query?, f=geojson, where=1=1, outfields=*), the user must update these on the bp_feature
game object in the Outliner. Each header performs a different function for the link and is added to the link once the user enters it into the input field.
How it works
- Create a new C++ class and make a http request to query a feature layer.
- Create a new Blueprint Actor class
- Create the event to place the data returned from the feature layer.
- Create a function to spawn the actor according to the data recieved in teh query.
- Attach the ArcGIS Location Component to the static stadium mesh model.
- Create a function to place the static mesh model on the
geometry
'scoordinates
location returned by the feature layer query and the height calculated by raycasts.
- Create a widget for the viewport so users can select a stadium from the list fed from the feature service.
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.
About the data
Data for all Major League Baseball Stadiums in the United States Feature Layer hosted by Esri. (Format the request URL for the query.)
Elevation data is loaded from the Terrain 3D elevation layer hosted by Esri.
Tags
Feature Layer, Data Collection