Display a map

Learn how to set a basemap, elevation source, data layers and display a specific area by using the Map Creator UI and the High Definition Render Pipeline from Unity.

In this tutorial, you will create a Unity local scene using a basemap layer service, and data layers. 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.

Local scene UI

Prerequisites

Before starting this tutorial, you should:

  1. You need an ArcGIS Developer account or ArcGIS Online account and an API key to access ArcGIS services. If you don't have an account, sign up for free.

  2. Ensure your development environment meets the system requirements.

  3. Follow install and setup steps and install the plugin. Make sure to import the sample assets.

  4. Create a new HDRP project.

If you are not familiar with the Unity's interface, see Unity Manual for the information about the most common editor windows, and how to make full use of them.

Steps

Create a new scene and open the Map Creator UI

  1. In the top menu, click on File > New Scene and open the pop-up window.

    Create a new scene

  2. Select Basic Outdoors (HDRP) template and click on the Create button, then save the scene with a scene name.

    Select Basic Outdoors (HDRP) template

  3. In the top menu, click on ArcGIS Maps SDK > Map Creator. Adjust the windows size after opening the Map Creator UI if it is needed.

    Open the Map Creator UI

Create a map

In this tutorial, you will create a local scene and set a circular extent.

  1. Click on the Map tab and display the panel content.

  2. Click on Local in the Map Type section.

  3. In the Origin Position section you can set up the the center of your GIS scene with its coordinates and a spatial reference Well-Known ID (WKID). For the tutorial, set the parameters to these values:

    • Longitude = -74;
    • Latitude = 41;
    • Altitude = 0;
    • Spatial Reference WKID: 4326

    For the information regarding the spatial reference, see the spatial references page.

  4. In Map Extent, mark on the Enable Map Extent checkbox and set the extent of the map to these values:

    • Longitude = -74.0;
    • Latitude = 40.72;
    • Shape: Circle;
    • Spatial Reference WKID: 4326
    • Shape Dimensions = 5000;

This is the result of the Map panel.

Create a local scene

In the Hierarchy window, you can find the ArcGISMap game object is created.

ArcGISMap game object

When you click on the ArcGISMap game object in the Hierarchy window, you can see that the game object has the ArcGIS Map component attached.

ArcGIS Map component

For more information about creating an ArcGIS Map, refer to the Maps page.

Set the API key

In this tutorial you will use a preset basemap which requires an API key.

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

  2. Click on the Auth tab to display the panel content.

  3. Set the API key in the API Key section.

Make sure your API key is in the field where you see Paste your API key here in this screenshot. You can find the information about how to get API keys by clicking on Get an API Key in the UI.

Set the API key

For more information about the API key, refer to the API keys section.

Create and set up a camera

ArcGIS Maps SDK for Unity will load better LODs for areas closer to the view and lower LODs for the areas that are further away with the ArcGIS Camera.

  1. Click on the Camera tab.

  2. The Camera Position defines the initial point of view of the camera. For the tutorial, set the parameters to these values:

    • Longitude = -74.054921;
    • Latitude = 40.691242;
    • Altitude = 3000;
    • Spatial Reference WKID: 4326
  3. The Camera Rotation defines the angle of the camera.

    • Heading = 55;
    • Pitch = 58;
    • Roll = 0;
  4. Click on the Create Camera button.

This is the result of the Camera panel.

Create a camera

In the Hierarchy window, you can find the Main Camera game object has been converted to ArcGISCamera game object and moved under ArcGISMap game object.

ArcGISMap camera object

When you double-click on the ArcGISCamera game object, your Scene view camera will be moved to the position. If you also want to adjust pitch, heading, and roll, you should do so by holding the right mouse button down in the Scene view.

At this point, you may want to disable Fog in the Sky and Fog Volume to see the basemap and data layers you will add. At the last of this tutorial, you will adjust the lighting.

Disable Fog

Attach a camera controller

During the editor time, you have the Scene view camera to navigate around in the viewport when the Editor mode is enabled. For the play mode, you must attach a camera controller to explore your scene. In this tutorial, you will attach a controller from the ArcGIS Maps SDK for Unity's sample assets.

  1. Click on the ArcGISCamera in the the Hierarchy window.

  2. In the Inspector window, click on the Add Component button.

  3. Search for the ArcGIS Camera Controller and attach it to the ArcGISCamera game object.

    Attach ArcGIS Camera Controller

For the information about camera, see the Camera page.

Set basemap

In this tutorial, you will use one from the preset basemap.

  1. Click on the Basemap tab and display the panel content.

  2. Make sure Imagery is selected.

This is the result of setting up the basemap to Imagery from the preset.

Set basemap

Set elevation

In this tutorial, you will use the default elevation from the Map Creator UI.

  1. Click on the Elevation tab and display the panel content.

  2. Make sure Default Elevation is selected.

This is the result of the elevation panel.

Set elevation

Add data layers

You will add three tile image layers and one 3D object scene layer from ArcGIS Online.

  1. Click on the Layers tab.

  2. In the Add Data section, select ArcGIS Image Layer from the Type.

  3. Enter the layer's online service URL in the URL field to add a raster tile layer UrbanObservatory_NYC_TransitFrequency.

    Use dark colors for code blocksCopy
     
    1
    https://tiles.arcgis.com/tiles/nGt4QxSblgDfeJn9/arcgis/rest/services/UrbanObservatory_NYC_TransitFrequency/MapServer
  4. Type 01 - New York Transit Frequency in the Layer Name field.

  5. Click on the Add button to add the layer to your map. When it's added you can see it in the Layers section.

  6. Repeat steps 1-4 to create the other layers.

    • Layer name: 02 - New York Industrial Areas

      ArcGIS Online item: New_York_Industrial

      Use dark colors for code blocksCopy
       
      1
      https://tiles.arcgis.com/tiles/nGt4QxSblgDfeJn9/arcgis/rest/services/New_York_Industrial/MapServer
    • Layer name: 03 - New York Population Density

      ArcGIS Online item: NewYorkCity_PopDensity

      Use dark colors for code blocksCopy
       
      1
      https://tiles.arcgis.com/tiles/4yjifSiIG17X0gW4/arcgis/rest/services/NewYorkCity_PopDensity/MapServer
  7. In the Add Data section, select ArcGIS 3D Object Scene Layer from the drop-down list.

  8. Enter the layer's online service URL in the URL field to add a 3D object scene layer New York, USA Buildings, and name the layer 04 - New York Buildings.

    Use dark colors for code blocksCopy
     
    1
    https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_NewYork_17/SceneServer
  9. Click on the Add button and add the layer to your map.

  10. On the Layers section, change the opacity of the layers 01 and 02 to 0.9 and 0.6. Keep the default opacity value of layers 03 and 04.

This is the result of the Layers panel.

Add data

Adjust sky and lighting

Unity provides sky and lighting system. See the Sky and lighting page for more information. In this tutorial, you will adjust the settings for the game objects that were added by the template.

Adjust the Sun

  1. In the Hierarchy window, click on the Sun game object.

  2. In the Inspector window, set the rotation to the following values in Transform section.

    • X: 36
    • Y: 110
    • Z: 85
  3. Open the Emission section and set the Intensity value to 10000.

This is the result of the Sun game object.

Adjust the Sun

Adjust the Sky and Fog Volume

  1. Click on the Sky and Fog Volume in the Hierarchy window.

  2. ArcGIS Maps SDK for Unity has a sample profile for Sky and Fog volume for HDRP. Click on the icon next to the Profile name in the Inspector window Volume section.

  3. Select the Sky and Fog Settings SampleScenes Profile in the pop-up window.

    Sky and Fog Settings SampleScenes Profile

You have successfully configured a map the Map Creator UI. Click the Play icon on the Toolbar and see your map in the Game view.

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

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