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, ArcGIS Online and scripting APIs 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 data management tools and scripting APIs to create and define a new feature layer that can store points with attributes. You also use Map Viewer or scripting APIs to add new features and set field values.
Prerequisites
You need an ArcGIS Developer or ArcGIS Online account to access and manage hosted layers.
Steps
Create a point feature layer
Use data management tools and scripting APIs to create a point feature layer that is powered by a feature service. The feature service will contain point geometries and attributes.
Go to your developer dashboard.
Click Layers > Create data > New hosted layer (Feature layer).
In the Data Structure pane, set the Geometry type to: Point.
Under Fields, click Add field to create the following attribute fields for the point layer:
- Field 1
- Name:
id
- Alias:
id
- Type:
Integer
- Click: Add field
- Name:
- Field 2
- Name:
name
- Alias:
name
- Type:
String
- Click: Add field
- Name:
- Field 3
- Name:
rating
- Alias:
rating
- Type:
string
- Click: Add Field
- Name:
- Click Next to continue.
- Field 1
In the Item Details pane, set the following properties:
- Title:
My Points
- Tags:
Beach access
Malibu
- Description:
Place points along the California coast line.
- Title:
Click Create Layer to create the new My Points feature layer and feature service.
Find the hosted layer ID and URL
Your Layer ID and service URL will be unique. To access a private feature layer in an application, reference its service URL using an API key or token.
Go to the item page of your new hosted feature layer.
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/GVgb Jbqm8h XASVYi/arcgis/rest/services/my_ points/Feature Server
- Layer ID:
Go to ArcGIS Online and sign in.
In the top navigation bar, click Content.
Click New item > Feature Layer > Define your own layer.
Set the following properties of the feature layer:
- Name:
m
y_ points - Type: Point layer.
- Name:
Set the following properties of the ArcGIS Online item:
- Title:
My Points
- Tags:
Beach access
Malibu
- Summary:
Place points along the California coast line.
- Title:
Click Next to create the new My Points feature layer and feature service.
In the item page of the My Points layer, click the Data tab > Fields > Add.
Create the following fields in the Fields window:
- Field 1
- Field Name:
id
- Display Name:
id
- Type:
Integer
- Click: Add New Field
- Field Name:
- Field 2
- Click Add.
- Field Name:
name
- Display Name:
name
- Type:
String
- Length:
256
- Click: Add New Field
- Field 3
- Click Add
- Field Name:
rating
- Display Name:
rating
- Type:
String
- Length:
256
- Click: Add New Field
- Field 1
Find the hosted layer ID and URL
Your Layer ID and service URL will be unique. To access a private feature layer in an application, reference its service URL using an API key or token.
Go to the item page of your new hosted feature layer and click the Overview tab.
Scroll down to find the service URL. For example:
https:
//services3.arcgis.com/GVgb Jbqm8h XASVYi/arcgis/rest/services/my_ points/Feature Server Click View to access the metadata for the feature layer. Find the Service ItemId. For example:
70264c2e37784a819e235d3a0129832f
.
- Import libraries.
- Provide authentication.
- Create the service.
- Add the layer definition.
- Handle the results.
Enable editing
To add, update, and delete features in your feature layer, you need to enable editing.
In the developer dashboard, go to the item page of the My Points feature layer.
In the item page, click the Settings tab.
Under Layer access (Sharing), ensure that People with access is set to Private (authentication required).
Under Editing settings, check Allow editing and leave the default selections.
Click Save settings.
In ArcGIS Online, click Content > My points.
In the item page, click Share to ensure that sharing permissions are set to Owner > Save.
Click the Settings tab.
Under Feature layer (hosted), click Enable editing.
Click Save.
- Provide authentication.
- Import libraries.
- Reference feature service.
- Execute updateDefinition operation.
- Handle results.
Add features
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.
Open Map Viewer.
Sign in to your account.
In the left panel, click Layers > Add > My Points > Add to Map.
On the right panel, click Map tools > Search. Type in
34.01757,-118.82549
and zoom to Zuma Beach.On the bottom of the right panel, click Edit to open the editor.
In the Editor, click New Feature and click on the map to create a new point. Set the following attribute values:
- id:
1
- name:
Zuma Beach
- rating:
Good
- Click Create
- id:
Add another point to the map at Westward Beach:
- Search for Westward Beach at the following coordinates:
34.00637,-118.812791
- Click Edit > New Feature and create a new point at the coordinates with the following attribute values:
- id:
2
- name:
Westward Beach
- rating:
Excellent
- Click Create
- id:
- Search for Westward Beach at the following coordinates:
Add another point to the map at Point Dume County Beach:
- Search for Point Dume County Beach at the following coordinates:
34.00339,-118.80485
- Click Edit > New Feature and create a new point at the coordinates with the following attribute values:
- id:
3
- name:
Point Dume County Beach
- rating:
Poor
- Click Create
- id:
- Search for Point Dume County Beach at the following coordinates:
Add any additional points you would like to include on your map using the method described above.
In the left panel, click Layers > My Points > ... > Show table to view the attribute data of your hosted feature layer. This opens the table view that you can use to inspect and edit data values.
- Import libraries.
- Provide authentication.
- Create new features.
- Execute edit operation.
- Handle results.
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:

Import data as a feature layer
Use data management tools to import and create hosted feature layers.

Access feature layer data
Use ArcGIS Online tools to access and display feature layer data.

Manage a feature layer
Set the properties and capabilities of a hosted feature layer.

Publish a vector tile layer
Use ArcGIS Online to publish a vector tile layer.

Add a feature layer
Access and display point, line, and polygon features from a feature service

Add a vector tile layer
Access and display a vector tile layer in a map.

Add an image tile layer
Access and display an image tile layer in a map.

Style a feature layer
Use symbols and renderers to style feature layers.

Query a feature layer (spatial)
Execute a spatial query to get features from a feature layer.

Query a feature layer (SQL)
Execute a SQL query to access polygon features from a feature layer.

Edit feature data
Add, update, and delete features in a feature service.

Display a popup
Format a popup to show attributes in a feature layer.