Over the last few months we’ve released a number of new features for developers using hosted data services and the basemap styles service. To help take advantage of them, we’ve updated to the Mapping APIs and location services guide. This article summarizes the key content updates that you should be aware of.
Help us improve the developer documentation!
Before we dive in, we want to mention that we also added a short survey to the guides to get your feedback on the quality of developer documentation. Are you looking for more code examples, tutorials, or how-to content? How are the API refs and samples? What type of content and resources do you find most helpful? Please feel free to let us know!
Data hosting
In November, 2023, data hosting for ArcGIS Platform developers moved out of beta. This feature gives ArcGIS Platform developers the ability to create, manage, and access data (for their apps) by hosting data in ArcGIS. The main services you can create are feature services, vector tile services, and map tile services.
The key to using data services and maximizing performance in your applications is understanding how they work, how to manage them, and how to access them effectively.
To support this, here are some of the new and updated topics:
- (Updated) Introduction to data services
- (New) Types of data services and Choosing a data service
- (Updated) How to work with data services
- (Updated) Import data and create new data services
- (New) Topics to manage feature services, data caches, drawing optimizations, field indexs, and sharing levels
- (New) Topic on Repeatable vs Unique queries and when to use them
- (New/Updated) Create vector tile services and map tile services
- (New) Display and access features services, vector tile services, and map tile services
- (New) code examples to optimize queries to feature services with paging
- (New) tutorial for styling vector tile layers with the ArcGIS Vector Tile Style Editor
- (New) workflows to create applications that use feature services, vector tile services, and map tile services
- (New) Best practices for CDN caching and drawing optimization
- (New) FAQ
New code examples
Query features with paging
const queryParams = {
where: "1=1",
outFields: Object.keys(appParams.outFields),
orderByFields: ["FID asc"], // order by object id
returnGeometry: true,
num: appParams.returnCount, // resultRecordCount
start: appParams.currentPage, // resultOffset
}
To get the code, go to Query features with paging.
Access a vector tile layer
const vectorLayer = new VectorTileLayer({
portalItem:{
id: "c4fc087b100542fe91df0b279df23ef9"
},
opacity: 0.75,
})
To get the code, go to Display vector tiles.
Basemap places
The basemap styles service provides styles that you can use in your applications as a basemap layer. Beyond styles, the service has additional capabilities such as the ability to display basemap places. Basemap places allows you to show or hide place locations directly in a basemap. The places are part of the style and represent business, services, landmarks, and other places of interest.
To use this feature, you need to reference the service URL directly and set the places
parameter with values such as: all
or attributed
. To learn more, we created a new page in the Mapping APIs and location services guide that include demos and code examples.
Note: This feature is currently in beta. If you want to provide feedback, go to the Early Adopter Program.
At present, you can only use the following open source libraries to access this capability:
The ArcGIS Maps SDKs will provide full support soon!
New code examples
Display all places
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/navigation
?places=all&token=<ACCESS_TOKEN>
To get the code, go to the example.
Display places with attributes
Attributes include place name, category, and place ID.
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/navigation
?places=attributed&token=<ACCESS_TOKEN>
To get the code, go to the code example.
Note: If you want to return additional place information, you can also integrate basemap places with the places service to return attributes such as hours and user ratings. Check out our new tutorial in the MapLibre GL JS developer guide to learn how.
Worldview
Another new feature of the basemap styles service is the ability to display worldviews. Worldview are borders and labels based on a specific view of a country. Worldviews are only available for some ArcGIS basemap styles. To use this feature, you need to reference the service URL directly and specify the worldview
parameter to an enumerated value.
Note: This feature is currently in beta. If you want to provide feedback, go to the Early Adopter Program.
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/navigation
?worldview=morocco&token=<ACCESS_TOKEN>
To get the code, go to the Esri Leaflet sample or the OpenLayers and MapLibre GL JS examples.
We hope you find this update helpful!
Article Discussion: