Display the globe (Blueprints)

Learn how to set a basemap and display the globe by using Blueprints.

Global scene Blueprints result

In this tutorial, you will create a global 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 an area of New York city.

Prerequisites

Before starting this tutorial, you should:

  1. 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.
  2. Ensure your development environment meets the system requirements.
  3. Take Install and setup steps, and create a new project, and select Blueprints as your development option.

Steps

Initialize Level Blueprint

  1. Click on File on the Menu Bar and select New Level.

  2. Select Empty Level in the popup window.

    New Level

  3. Click the Blueprints button in the Level Editor Toolbar and select Open Level Blueprint.

    Open Level Blueprint

    This opens the Level Blueprint in the Blueprint Editor.

    Blueprint Editor

Configure a map and set the view mode

  1. Access the Context Menu by right-clicking on an empty space in the Graph Editor and searching for ArcGIS.

  2. Select ArcGIS Maps SDK > ArcGIS Map > Create ArcGIS Map with Map Type to create a map.

    Create with Map Type

  3. Connect the Event BeginPlay to the new node created.

    Connect node

  4. In the My Blueprint panel, in the Variables section, click the plus button to create a new variable.

    New variable

  5. Select the new variable and in the Details panel, Change the name to ArcGISMapType, select EArcGIS Map Type enum in the Variable Type.

    Set Map Type

  6. In the Toolbar click Compile.

    Toolbar

  7. In the Details panel, select Global in the ArcGISMapType.

    Select global

  8. Drag the ArcGISMapType variable into the Event Graph.

  9. Select Get ArcGISMapType and connect the variable to the Map Type pin.

    Connect Map Type variable

  10. Right-click on the Return Value pin, and select Promote to variable.

  11. In the Details panel, name the variable ArcGISMap. The variable will appear in the My Blueprint panel.

  12. Select ArcGIS Maps SDK > Spatial Reference > Create Spatial Reference to configure the spatial reference.

  13. Connect it to the Set node.

  14. All spatial reference values need to be translated to WGS 84 (wkid: 4326) geographic coordinate system in ArcGIS Map regardless of the spatial reference used in the source data. Set the WKID values to 4326.

    WKID

  15. Right-click on the Return Value pin, and select Promote to variable.

  16. In the Details panel, name the variable ArcGISSpatialReference.

This is the final result of the map.

Result Map

Set up a basemap and set the API key

  1. In ArcGIS Maps SDK > ArcGIS Basemap, select Create ArcGIS Basemap and add it to the graph.

    ArcGIS Map variable

  2. Connect it to the Set node.

  3. Go to your developer dashboard to get your API key.

  4. Go back to Unreal Engine the Blueprint Editor, and click the plus button to create a new variable in the Variables tab.

    Create API key variable

  5. Select String in the Variable Type and change the name to API Key.

    Change name of API key

  6. In the Toolbar, click Compile and the API key will appear in the Details panel > Default Value.

  7. Enter your API key.

    Enter API Key

  8. Drag the API Key variable into the Event Graph.

  9. Select Get API Key and connect the variable to the API Key pin.

  10. In the Source pin, copy the URL:

    Use dark colors for code blocks
     
    1
    https://www.arcgis.com/sharing/rest/content/items/86265e5a4bbb4187a59719cf134e0018/data

    In this tutorial, you'll use Imagery Hybrid as a basemap. For formatting a Web Map URL used for ArcGIS Maps SDK for Unreal Engine, refer to ArcGIS REST API.

  11. 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.

  12. Connect it to the Create ArcGIS Basemap node.

  13. Drag the ArcGISMap variable into the Event Graph.

  14. Select Get ArcGISMap and connect the variable to the Target pin.

This is the final result of the basemap.

Blueprints Basemap

Create elevation

  1. In ArcGIS Maps SDK > ArcGIS Image Elevation Source, select Create ArcGIS Image Elevation Source and add it to the graph.

  2. Connect it to the Set Basemap node.

  3. Drag the API Key variable into the Event Graph.

  4. Select Get API Key and connect the variable to the API Key pin.

  5. In the Source pin, copy and paste the URL:

    Use dark colors for code blocks
     
    1
    https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer

    In this tutorial, you'll use Terrain3D as the elevation source. You can find more elevation layers in ArcGIS Online.

  6. In ArcGIS Maps SDK > ArcGIS Map Elevation, select Create ArcGIS Map Elevation and add it to the graph.

  7. Connect it to the Create ArcGIS Image Elevation Source node.

    Create elevation

  8. In ArcGIS Maps SDK > ArcGIS Map, select Set Elevation and add it to the graph.

  9. Connect it to the Create ArcGIS Map Elevation node.

  10. Drag the ArcGISMap variable into the Event Graph.

  11. Select Get ArcGISMap and connect the variable to the Target pin.

This is the final result of the elevation.

Blueprints elevation

Set ArcGIS Camera

You'll configure the camera in the Details panel. To use the configured value in the ArcGIS Map, you need to set up a placeholder.

  1. In ArcGIS Maps SDK > ArcGIS Position, select Create ArcGIS Position with XYZ Spatial Reference and add it to the graph.

  2. Connect it to the Set Elevation node.

  3. Drag the ArcGISSpatialReference variable into the Event Graph.

  4. Select Get ArcGISSpatialReference and connect the variable to the Spatial Reference pin.

    Connect Node

  5. In ArcGIS Maps SDK > ArcGIS Rotation, select Create ArcGIS Rotation and add it to the graph.

  6. Connect it to the Create ArcGIS Position with XYZ Spatial Reference node.

  7. In ArcGIS Maps SDK > ArcGIS Camera, select Create ArcGIS Camera and add it to the graph.

  8. Name the camera Camera_1.

  9. Connect it to the Create ArcGIS Position with XYZ Spatial Reference and the Create ArcGIS Rotation nodes.

This is the final result of the camera.

Result Camera

Create a Renderer View

  1. In ArcGIS Maps SDK > ArcGIS Renderer View select Create ArcGIS Renderer View and add it to the graph.

  2. Connect it to the Create ArcGIS Camera node.

  3. Drag the ArcGISMap variable into the Event Graph.

  4. Select Get ArcGISMap and connect the variable to the ArcGIS Map pin.

    Connect Node

  5. In the Variables tab, click the plus button to create a new variable.

  6. Select ArcGIS Renderer View Options in the Variable Type and change the name to ArcGISRendererViewOptions.

  7. Drag the ArcGISRendererViewOptions variable into the Event Graph.

  8. Select Get ArcGISRendererViewOptions and connect the variable to the Options pin.

  9. Right-click on the Return Value pin, and select Promote to variable.

  10. Change the name of the new variable to ArcGISRendererView.

This is the final result of the Renderer View.

Renderer View Result

Create ArcGIS Renderer Container and set Renderer View

  1. In Game, select Spawn Actor from Class and add it to the graph.

  2. Connect it to the Set node.

  3. In the Class, dropdown menu select ArcGISRenderer.

  4. In the Variables tab, click the plus button to create a new variable.

  5. Select Transform in the Variable Type and change the name to DefaultTransform.

  6. Drag the DefaultTransform variable into the Event Graph.

  7. Select Get DefaultTransform and connect it to the Spawn Transform pin.

    Connect node

  8. In ArcGIS Maps SDK > ArcGIS Renderer, select Set Renderer View and add it to the graph.

  9. Connect it to the Spawn Actor from Class node.

  10. Drag the ArcGISRendererView variable into the Event Graph.

  11. Select Get ArcGISRendererView and connect it to the In Renderer View pin.

This is the final result.

render-container-final-result

Create and set an ArcGIS Sample Pawn Actor

To move around the scene and define the camera's initial position, it's is necessary to have an Unreal Pawn. In this tutorial, you'll use the sample pawn that comes with the ArcGIS Maps SDK for Unreal Engine.

  1. In Utilities > Enum, select Get Actor of Class and add it to the graph.

  2. Connect it to the Set Renderer View node.

  3. In the Actor Class, dropdown menu select SampleDefaultPawn.

  4. In Actor, select Get Component by Class and add it to the graph.

  5. Connect it to the Return Value node.

  6. In the Component Class, dropdown menu select ArcGISCameraComponent.

    ArcGISCameraComponent

  7. In ArcGIS Maps SDK > ArcGIS Camera Component, select Set Renderer View and add it to the graph.

  8. Connect it to the Get Actor Class and Get Component by Class nodes.

  9. Drag the ArcGISRendererView variable into the Event Graph.

  10. Select Get ArcGISRendererView and connect it to the In Renderer View pin.

This is the final result.

Pawn actor final result

Compile and Save the Blueprint by using the Toolbar button, then close the Blueprint Editor.

Set up ArcGIS Sample Pawn

To configure the camera in the Details panel and use it in the GIS scene that you've configured with Blueprints, you need to add the ArcGIS Sample Pawn into the level.

  1. The sample pawn that comes with ArcGIS Maps SDK for Unreal Engine is located in the folder:

    Use dark colors for code blocks
     
    1
    ArcGISMapsSDK C++ Classes\ArcGISSamples\Public

    If you want to use a custom pawn, write your own in C++ script.

  2. Select SampleDefaultPawn Actor and drag it into the level.

    Pawn

  3. In the World Outliner, rename it to ArcGISCamera.

  4. In the Details panel, select ArcGIS Location Component.

  5. In the ArcGIS Location Component, set the Position to:

    • Latitude: 40.691242
    • Longitude: -74.054921
    • Altitude: 3000 Meters
  6. Set the Rotation to:

    • Heading: 65
    • Pitch: 68
    • Roll: 0

    Pawn Result

Create custom rebasing

Next, attach a custom rebasing component to the camera. The rebasing component ensures precision when navigating in a large area. Read more about the rebasing component in use the camera.

  1. Create an actor blueprint and name it BP_rebasing.

  2. Open BP_rebasing. Click on Add New > Function on the left and name the new function check if Beyond Limits.

  3. Click on the function, on the right side, in the Inputs, click on the plus sign and add a new input Camera Location, set the data type to Vector.

  4. Connect the function to Engine to ECEF (if you cannot find this function, right click the blank area and uncheck Context Sensitive).

  5. Connect Camera Location and Engine Coordinates.

  6. Connect Engine to ECEF to ECEFTo Geographic. Connect ECEFCoordinates to ECEFCoordinates.

  7. In the blank area, right click and search for Get Geo Referencing System.

  8. Connect Return Value to the Target node of ECEFTo Geographic.

    rebase

  9. Connect ECEFTo Geographic to Branch.

  10. Connect Geographic Coordinates to To Float Approximation

  11. Connect Out Altitude to float>float.

  12. Make two float variables on the left and name them MaximumWorldOriginDistanceFromCamera and MaxAltitude. Make MaximumWorldOriginDistanceFromCamera public by clicking the eye sign.

  13. Drag MaxAltitude into the blueprint and connect it to float>float.

  14. Connect float>float to the Condition node.

  15. Right click on the empty space and search for Add Return Node. Add a boolean output variable to it and name it Result.

  16. Connect the True output to the return node.

  17. Connect the False output to a new branch condition.

  18. Connect Out Altitude to float*float. Change the other input parameter from 0.0 to 100.0.

  19. Connect the output to float<float.

  20. Drag MaximumWorldOriginDistanceFromCamera into the blueprint and connect it to float*float. Change the other input parameter from 0.0 to 5.0. Connect the output to the other node of float<float.

  21. Connect the output of float<float to the condition input of the second branch.

  22. Connect the output of multiply by 100 to float*float and change the other input parameter to 0.2.

    rebase

  23. Connect the output to Not Equal(Vector).

  24. Connect the output of Camera Location to the input node of Not Equal(Vector).

  25. Create a second Not Equal(Vector), and drag MaximumWorldOriginDistanceFromCamera into the blueprint and connect to Not Equal(Vector).

  26. Double click on the splines between Camera Location and Not Equal(Vector) to add a rerouting node, and reroute it to the other node of Not Equal(Vector).

  27. Right click and search for Add Return Node. Add a boolean output variable to it and name it Result. Right click to duplicate the return node.

  28. Connect the results of the two vector comparators to these two return nodes.

  29. Connect the true output of the branch node to the return node that connects to the MaximumWorldOriginDistanceFromCamera comparator. Connect the false output of the branch node to the other.

    rebase

  30. Drag and drop BP_rebasing into the scene and attach it to ArcGISCamera.

Set up ArcGIS Map View

  1. The ArcGIS Map View Actor defines the view mode and the Origin Location. It's located in the folder:

    Use dark colors for code blocks
     
    1
    ArcGISMapsSDK C++ Classes\ArcGISMApsSDK\Public\ArcGISMApsSDK\Actors
  2. Drag the ArcGISMapView Actor into the level.

  3. Select Global on the Map Type dropdown menu.

  4. In this tutorial, you are setting up the following Origin Location values.

    • Latitude: 40
    • Longitude: -73
    • Altitude: 0 Meters

    ArcGISMapView Result

  5. Attach ArcGISCamera to ArcGISMapView.

Set up the sky and the light

  1. Delete everything in the Detail Panel except for what you just added to the scene.

  2. In the Place Actors window, select Lights > Directional Light and drag it into the level to create a Directional Light. For more information about Directional Lights, see Lights.

    unreal_direct_light

  3. Select the Directional Light in the World Outliner, and open the Transform section in the Details window.

  4. Set the Rotation to:

    • X: 0
    • Y: -28
    • Z: -28
  5. Set the Mobility to Movable.

    transform_light_unreal

  6. In the Light section, change the Intensity Value to 3.1416.

  7. In the Atmosphere and Cloud section, enable Atmosphere Sun Light.

  8. In the Actor > Spawn Collision Handling Method section, select Always Spawn, Ignore Collisions.

    actor_light_unreal

  9. In the Place Actors window, select Lights > Sky Light and drag it into the level to create a Sky Light. For more information about Sky Light, see Lights.

  10. Set the Mobility to Movable.

  11. In the Light section, enable Real Time Capture.

    realtime_sky_unreal

  12. In the Place Actors window, select Visual Effects > Sky Atmosphere and drag it into the level to create a Sky. For more information about Sky Atmosphere, see Fog Effects.

  13. In the Planet section, change the Ground Radius to 6378.137207.

You have successfully configured the Blueprint! 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:

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.