Create a new feature layer

Learn how to create a new hosted feature layer and feature service.

You can use tools in your developer dashboard and ArcGIS Online to define a new dataset in the cloud as a hosted feature layer. A hosted feature layer is also referred to as a feature layer. A feature layer is used to store point, line, or polygon geometries with attributes. After a feature layer is created, applications can access it by ID or URL and then query, edit, and display features.

In this tutorial, you use the Create data tool in your developer dashboard to create and define a new feature layer that can store points with attributes. You also use Map Viewer to add new features and set field values.

Prerequisites

You need an ArcGIS account to access your dashboard and manage hosted layers. Sign up for an account for free.

Steps

Create a point feature layer

Use data management tools to create a point feature layer that is powered by a feature service. The feature service will contain point geometries and attributes.

Developer dashboardArcGIS Online
  1. Sign in to your developer account.

  2. In the developer dashboard, click Layers > Create data > New hosted layer (Feature layer).

  3. In the Data Structure pane, set the Geometry type to: Point.

  4. Under Fields, click Add field to create the following fields for the layer of the point layer:

  5. Create the following fields in the Fields window:

    • Field 1
      • Name:id
      • Alias:id
      • Type:Integer
      • Click: Add field
    • Field 2
      • Name:name
      • Alias:name
      • Type:String
      • Click: Add field
    • Field 3
      • Name:rating
      • Alias:rating
      • Type:string
      • Click: Add Field
    • Click Next to continue.
  6. In the Item Details pane, set the following properties:

    • Title: My Points
    • Tags: Beach access. The Tags property cannot be left blank.
    • Description: Place points along the California coast line
  7. Click Create Layer to create the new My Points feature layer and feature service.

  8. In the item page, click the Settings tab.

  9. Under Layer access (Sharing), ensure that People with access is set to Public (authentication not required).

Find the hosted layer ID and URL

Your Layer ID and service URL will be unique. To access the feature layer directly, reference the layer by its index. For example, the layer's index is 0: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/my_points/FeatureServer/0.

  1. In the Overview, find the Layer ID and Service URL. It should look something like this:
    • Layer ID: 70264c2e37784a819e235d3a0129832f
    • Service URL: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/my_points/FeatureServer

Enable editing

To add, update, and delete features in your feature layer, you need to enable editing.

  1. In the Settings, find Editing settings.

  2. Check Allow others to edit and leave the default selections.

  3. Click Save settings.

  1. Go to ArcGIS Online and sign in.

  2. In the top navigation bar, click Content.

  3. Click Create > Feature Layer > Build a layer.

  4. Click Points > Create.

  5. Ensure that Point layer is checked > Next > Next.

  6. Set the following properites:

    • Title: My Points
    • Tags: Beach access: The Tags property cannot be left blank.
    • Click Done.
  7. In the item page, click Share > Everyone(public) > Save.

Add data

  1. In the item page, click the Data tab > Fields > Add.

  2. Create the following fields in the Fields window:

    • Field 1
      • Name:id
      • Alias:id
      • Type:Integer
      • Click: Add New Field
    • Field 2
      • Click Add.
      • Name:name
      • Alias:name
      • Type:String
      • Click: Add New Field
    • Field 3
      • Click Add
      • Name:rating
      • Alias:rating
      • Type:string
      • Click: Add Field

Find the hosted layer ID and URL

Your Layer ID and service URL will be unique. To access the feature layer directly, reference the layer by its index. For example, the layer's index is 0: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/my_points/FeatureServer/0.

  1. In the item page, click the Overview tab. Scroll down to find the service URL. For example: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/my_points/FeatureServer

  2. Click View to access the metadata for the feature layer. Find the Service ItemId. For example: 70264c2e37784a819e235d3a0129832f.

Add features with Map Viewer

Map Viewer can be used to add and edit feature layer data. Use it to position the map to the Santa Monica mountains and then add new point features interactively.

  1. Open Map Viewer.

  2. Sign in to your account.

  3. In the left panel, click Layers > Add Layer > My Points > Add to Map.

  4. On the right panel, click Search. Type in 34.01757,-118.82549 and zoom to Zuma Beach.

  5. On the bottom of the right panel, click Edit to open the editor.

  6. In the Editor, click Add feature to create a new point. Set the following attribute values:

    • id: 1
    • name: Zuma Beach
    • rating: Good
    • Click Add
  7. Input the next coordinate into Search for Westward Beach: 34.00637,-118.812791

    • id: 2
    • name: Westward Beach
    • rating: Excellent
    • Click Add
  8. Enter the last coordinate into Search for Point Dume County Beach: 34.00339,-118.80485

    • id: 3
    • name: Point Dume County Beach
    • rating: Poor
    • Click Add
  9. In the left panel, click Save to save the new point features.

  10. In the left panel, find Layers > My Points > ... > Show table to see the attribute data in relation to your map. This opens the table view that you can use to inspect and edit the data.

You now have a hosted feature layer and feature service. You can access the hosted layer with its URL or layer ID in your applications. To manage your hosted layer properties and capabilities, visit the Manage a feature layer tutorial.

What's Next?

Learn how to use additional tools, APIs, and location services in these tutorials:

ToolsAPIs