import Stop from "@arcgis/core/rest/support/Stop.js";const Stop = await $arcgis.import("@arcgis/core/rest/support/Stop.js");- Inheritance:
- Stop→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.23
A stop respresents the start, end, or midpoint of a route in RouteLayer.stops or RouteParameters.stops.
- See also
Example
// Display the route name and overall distance and duration.const routeLayer = new RouteLayer({ portalItem: { id: "69569b47b1e445b8a42ec12feab41ce9" }});await routeLayer.load();
const locale = "en-US";const formatDate = new Intl.DateTimeFormat(locale, { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', timeZone: "America/Los_Angeles"});
for (const stop of routeLayer.stops) { const { arriveTime, departTime, name, locationType } = stop; console.log(`Stop: ${locationType} at ${name}`); console.log(`Arrival Time: ${formatDate.format(arriveTime)}`); console.log(`Departure Time: ${formatDate.format(departTime)}`); }
// Stop: stop at Kenoak Pl, Pomona, California, 91768 // Arrival Time: 12/7/2020, 3:58:50 PM // Departure Time: 12/7/2020, 3:58:50 PM // Stop: stop at 173 E Arbeth St, Rialto, California, 92377 // Arrival Time: 12/7/2020, 4:38:29 PM // Departure Time: 12/7/2020, 4:38:29 PM // etcConstructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
| | ||
| | ||
declaredClass readonly inherited | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
type readonly | "stop" | |
curbApproach
- Type
- CurbApproach | null | undefined
Specify the direction a vehicle may arrive at and depart from the stop.
locationType
- Type
- LocationType | null | undefined
popupTemplate
- Type
- PopupTemplate | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 4.30
The template for displaying content in a Popup when the graphic is selected.
sequence
If the findBestSequence parameter is set to false, the output routes will visit the stops in the order you specify with this attribute. In a group of stops that have the same RouteName value, the sequence number should be greater than 0 but not greater than the total number of stops. Also, the sequence number should not be duplicated.
Methods
| Method | Signature | Class |
|---|---|---|
fromGraphic static | fromGraphic(graphic: Graphic): Stop | |
fromJSON inherited static | fromJSON(json: any): any | |
clone inherited | clone(): this | |
toGraphic(): Graphic | | |
toJSON inherited | toJSON(): any |
fromJSON
- Signature
-
fromJSON (json: any): any
Creates a new instance of this class and initializes it with values from a JSON object
generated from an ArcGIS product. The object passed into the input json
parameter often comes from a response to a query operation in the REST API or a
toJSON()
method from another ArcGIS product. See the Using fromJSON()
topic in the Guide for details and examples of when and how to use this function.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects. | |
- Returns
- any
Returns a new instance of this class.
clone
- Signature
-
clone (): this
Creates a deep clone of this object. Any properties that store values by reference will be assigned copies of the referenced values on the cloned instance.
- Returns
- this
A deep clone of the class instance that invoked this method.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.