Display a specific area (Blueprints)
Learn how to set a basemap and elevation, and display a specific area by using Blueprints.
In this tutorial, you will create a local scene using a Web Map from ArcGIS Online as a basemap. The surface of the scene is defined with an elevation layer, and the camera is positioned to display a cropped area of New York City.
Prerequisites
Before starting this tutorial, you should:
- Have an ArcGIS account and an API key to access ArcGIS Online services while you are developing. If you don't have an account, sign up for free.
- Ensure your development environment meets the system requirements.
- Take Install and setup steps, and create a new project, and select Blueprints as your scene setting option.
Steps
Initialize Level Blueprint
Click on File on the Menu Bar and select New Level.
Select Empty Level in the popup window and click Create.
Click Window in the menu bar and select World Settings.
Open Advanced under World and check the Enable Large Worlds.
Click on File on the Menu Bar and select Save Level As. Name your level and click Save.
From the Quick Add menu on the Tool Bar, drag an empty Actor and drop into the Viewport.
Click the newly created Actor in the Outliner panel and rename the Actor to ArcGISRenderer in the Details panel.
Click on + Add in the Details panel and select ArcGIS Renderer component. When you attach the ArcGIS Renderer component to an empty Actor, it will add ArcGIS Map View Actor automatically to the Outliner panel.
ArcGIS Map View Actor will place your GIS content in Unreal Engine space, and you can enable/disable the editor mode and Mesh Colliders. In this tutorial, you will configure where your GIS content is to be placed at
0, 0, 0
of the game engine space. Click on ArcGIS Map View Actor in the Outliner panel and set the Origin Position in the Details panel.You need to configure the Origin Position with a WKID for the values. In this tutorial, you are setting up the following Origin Position values for New York City.- Longitude: -74
- Latitude: 40
- Altitude: 0
- Spatial Reference WKID: 4326
This is the result of the ArcGIS Map View Actor.
Click the Blueprints button in the Level Editor Toolbar and select Open Level Blueprint.
This opens the Level Blueprint in the Blueprint Editor.
Create ArcGIS Map
ArcGIS Map is a container of your GIS content. First, create this container to add your content for the level.
Access the Context Menu by right-clicking on an empty space in the Graph Editor and search for ArcGIS.
Select ArcGIS Maps SDK > ArcGIS Map > Create ArcGIS Map with Map Type to create a map.
Set the Map Type to
local
and connect the Event BeginPlay to the new node.Right-click on the Return Value pin, and select Promote to variable.
In the Details panel, name the variable ArcGISMap.
This is the final result of the map.
Set up a basemap and set the API key
In ArcGIS Maps SDK > ArcGIS Basemap, select Create ArcGIS Basemap with Basemap Source and add it to the graph.
Connect it to the Set node.
Go to your developer dashboard to get your API key.
Go back to Unreal Engine the Blueprint Editor, click the + Add button in My Blueprint and select Variable.
Select newly created variable in My Blueprint.
Rename the variable name to API Key and select String for the Variable Type in the Details panel.
In the Toolbar, click Compile and the API key will appear in the Details below the Default Value.
Enter your API key.
Drag the API Key variable into the Event Graph.
Select Get API Key and connect the variable to the API Key pin.
In the Source pin, copy the URL:
Use dark colors for code blocks Copy In this tutorial, use Imagery with Labels as a basemap. To format a web map URL used for ArcGIS Maps SDK for Unreal Engine, refer to ArcGIS REST API.
In ArcGIS Maps SDK > ArcGIS Map, select Set Basemap and add it to the graph.
Note: If the node doesn't appear uncheck the Context Sensitive checkbox at the top right of the Context Menu.
Connect it to the Create ArcGIS Basemap with Basemap Source node.
Drag the ArcGISMap variable into the Event Graph.
Select Get ArcGISMap and connect the variable to the Target pin.
This is the final result of the basemap.
Create elevation
In ArcGIS Maps SDK > ArcGIS Image Elevation Source, select Create ArcGIS Image Elevation Source and add it to the graph.
Connect it to the Set Basemap node.
Drag the API Key variable into the Event Graph.
Select Get API Key and connect the variable to the API Key pin.
In the Source pin, copy and paste the URL:
Use dark colors for code blocks Copy In this tutorial, you use Terrain3D as the elevation source. You can find more elevation layers in ArcGIS Online.
In ArcGIS Maps SDK > ArcGIS Map Elevation, select Create ArcGIS Map Elevation with Elevation Source and add it to the graph.
Connect it to the Create ArcGIS Map Elevation with Elevation Source node.
In ArcGIS Maps SDK > ArcGIS Map, select Set Elevation and add it to the graph.
Connect it to the Create ArcGIS Map Elevation with Elevation Source node.
Drag the ArcGISMap variable into the Event Graph.
Select Get ArcGISMap and connect the variable to the Target pin.
This is the final result of the elevation.
Create an extent
In ArcGIS Maps SDK > Spatial Reference, select Create Spatial Reference and add it to the graph.
For the extent position, you need to configure the XY values for the center of the extent. For this tutorial, set the values to:
In this tutorial, you will specify the spatial reference with a well-known ID (WKID). There are nodes already configured for WGS84 (WKID: 4326) and WGS 84 / Pseudo-Mercator (WKID: 3857).
- X: Longitude
- Y: Latitude
Connect it to the Set Elevation node.
Set the WKID values to
4326
to configure the extent location and values in WGS84.In ArcGIS Maps SDK > ArcGIS Position, select Create ArcGIS Position with XY Spatial Reference and add it to the graph.
For the extent position, configure the XY values for the center of the extent. For this tutorial, set the values to:
- X: -74.0
- Y: 40.72
Connect the Return Value of the Create Spatial Reference to the Spatial Reference pin.
In this tutorial, you will use circle extent to clip a specific area. In ArcGIS Maps SDK > ArcGIS Extent Circle, select Create ArcGIS Extent Circle and add it to the graph.
Connect it to the Create ArcGIS Position with XY Spatial Reference node.
Set the Radius to
5000
. Units for WGS84 is meters, so this will create an extent with the radius of 5000 meters.In ArcGIS Maps SDK > ArcGIS Map, select Set Clipping Area and add it to the graph.
Connect it to the Create ArcGIS Extent Circle node.
Drag the ArcGISMap variable into the Event Graph.
Select Get ArcGISMap and connect the variable to the Target pin.
This is the final result of the extent.
Compile and Save the Blueprint by using the Toolbar button, then close the Blueprint Editor once.
Set View Options and Map
Set the Map you create with Blueprints to ArcGIS Map View Actor to be rendered in the Viewport. Also, you can select either you load data from invisible layers or not depending on your needs.
Click on the ArcGIS Map View Actor in the Outliner panel.
Reopen the Level Blueprint editor window and right-click to open the All Actions for this Blueprint window. Click on Create a Reference to ArcGIS Map View to add it to the Event Graph.
Click the + Add button in My Blueprint and select Variable.
Rename the variable to ArcGISRenderer View Options in the Details panel.
CLick Variable Type drop-down and select Structure > ArcGIS Renderer View Options.
In the Toolbar, click Compile and the ArcGIS Renderer View Options will appear in the Details below the Default Value. When you set the Load Data from Invisible Layers option to
True
, you can change the layer visibility during runtime.Drag the ArcGISRenderViewOptions variable into the graph and select Get ArcGIS Renderer View Options.
ArcGIS Map View Actor communicates with ArcGIS Renderer view. You can set either you load data from invisible layers or not for the ArcGIS Map View Actor to use the setting in the ArcGIS Renderer. In ArcGIS Maps SDK > ArcGIS Map View, select Set View Options and add it to the graph.
Connect it to the previous Set node.
Connect ArcGIS Map View to the Target pin and ArcGIS Renderer View Options to the View Options pin.
In ArcGIS Maps SDK > ArcGIS Map View, select Set Map and add it to the graph.
Connect the Set Map node to the Set View Options node and ArcGIS Map View to the Target pin.
Drag and drop the ArcGIS Map variable to the graph and select Get ArcGIS Map.
Connect ArcGIS Map to the Map pin.
This is the result of set View Options and Map.
Compile and Save the Blueprint by using the Toolbar button, then close the Blueprint Editor.
Set up ArcGIS Pawn
To configure the camera, add the ArcGIS Pawn into the level.
Select ArcGIS Pawn Actor and drag it into the level from the Content Drawer.
Click the Actor and select ArcGIS Location Component in the Details panel.
In the ArcGIS Location Component, set the Position to:
- Longitude: -74.054921
- Latitude: 40.691242
- Spatial Reference WKID: 4326
- Altitude: 3000 Meters
Set the Rotation to:
- Heading: 55
- Pitch: 58
- Roll: 0
This is the result of the ArcGIS Pawn.
Set up the sky and the light
From the quick add menu on the toolbar, select Lights > Directional Light and drag it into the level to create a Directional Light. For more information about Directional Lights, see Lights.
Select the Directional Light in the Outliner, and open the Transform section in the Details window.
Reset the Location and Set the Rotation to:
- X: 0
- Y: -28
- Z: -28
Set the Mobility to Movable.
In the Light section, change the Intensity Value to
3.1416
.In the Cascaded Shadow Maps section, change the Dynamic Shadow Distance MovableLight from
20000
to2000000
.In the Atmosphere and Cloud section, enable Atmosphere Sun Light.
In the Actor > Spawn Collision Handling Method section, select Always Spawn, Ignore Collisions.
From the quick add menu on the toolbar, select Lights > Sky Light and drag it into the level to create a Sky Light. For more information about Sky Light, see Lights.
In the Transform section, reset the Location and set the Mobility to Movable.
In the Light section, enable Real Time Capture.
From the quick add menu on the toolbar, select Visual Effects > Sky Atmosphere and drag it into the level to create a Sky. For more information about Sky Atmosphere, see Fog Effects.
In the Planet section, change the Ground Radius to
6378.137207
.
You have successfully configured the Blueprints. You can click the Play icon and see your map.
You can use the WASD Keys to move left/right/forward/backward. Use the left mouse button to pan around the scene, the right button to orbit, and the scroll wheel to zoom in or zoom out.
What's next?
To explore more features and learn how to use additional services, try these tutorials: