-
save
()
{Promise<PortalItem>}
使用此 RouteLayer 中的信息更新当前分配的 portal item。
返回:
类型 说明 Promise<PortalItem> 已保存的门户项目。 例子:
// Create a route layer from an existing route portal item const routeLayer = await Layer.fromPortalItem({ portalItem: { id: "3828dfec3a0749a1b1aff9e2fa53157c" } }); // Add the route layer to a map map.add(routeLayer); // Wait for both the view and route layer to load await view.whenLayerView(routeLayer); // Zoom to the extent of the route layer await view.goTo(routeLayer.fullExtent); // Update the route portal item on mouse click view.on("click", async (event) => { // Reset the route layer's stops with the mouse click location being a waypoint routeLayer.stops = [ { geometry: { x: -86.9074392, y: 21.0847238 } }, // Cancun Airport { geometry: event.mapPoint }, // Mouse click location { geometry: { x: -88.1331506, y: 20.6354437 } } // Chichén Itzá ]; // Solve the route const result = await routeLayer.solve({ apiKey }); // Use the results of the solve to update the route layer routeLayer.update(result); // Refresh the route portal-item using the route layer await routeLayer.save(); });
基本信息
以下是所在类或对象的基本信息。
AMD:
require(["esri/layers/RouteLayer"], (RouteLayer) => { /* code goes here */ });
ESM:
import RouteLayer from "@arcgis/core/layers/RouteLayer";
类:
esri/layers/RouteLayer
继承: RouteLayer > Layer > Accessor
自从:用于 JavaScript 4.23 的 ArcGIS API
用法说明
RouteLayer.save
函数(或属性)的定义如下:
相关用法
- JavaScript ArcGIS RouteLayer.saveAs用法及代码示例
- JavaScript ArcGIS RouteLayer.solve用法及代码示例
- JavaScript ArcGIS RouteLayer.stops用法及代码示例
- JavaScript ArcGIS RouteLayer.opacity用法及代码示例
- JavaScript ArcGIS RouteLayer.visible用法及代码示例
- JavaScript ArcGIS RouteLayer.portalItem用法及代码示例
- JavaScript ArcGIS RouteLayer.effect用法及代码示例
- JavaScript ArcGIS RouteLayer.url用法及代码示例
- JavaScript ArcGIS RouteLayer.minScale用法及代码示例
- JavaScript ArcGIS RouteLayer.maxScale用法及代码示例
- JavaScript ArcGIS RouteLayer.when用法及代码示例
- JavaScript ArcGIS RouteLayer.on用法及代码示例
- JavaScript ArcGIS RouteLayer.fullExtent用法及代码示例
- JavaScript ArcGIS RouteLayer layerview-create事件用法及代码示例
- JavaScript ArcGIS RouteLayer layerview-create-error事件用法及代码示例
- JavaScript ArcGIS RouteLayer用法及代码示例
- JavaScript ArcGIS RouteParameters.findBestSequence用法及代码示例
- JavaScript ArcGIS RouteParameters.travelMode用法及代码示例
- JavaScript ArcGIS RouteParameters.apiKey用法及代码示例
- JavaScript ArcGIS RouteInfo用法及代码示例
- JavaScript ArcGIS RotationVariable用法及代码示例
- JavaScript ArcGIS RotationVariable.clone用法及代码示例
- JavaScript ArcGIS RasterShadedReliefRenderer.clone用法及代码示例
- JavaScript ArcGIS RelationshipQuery.orderByFields用法及代码示例
- JavaScript ArcGIS RasterColormapRenderer.createFromColormap用法及代码示例
注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 RouteLayer.save。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。