@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
82 lines (80 loc) • 3.85 kB
TypeScript
import type Graphic from "../../Graphic.js";
import type PopupTemplate from "../../PopupTemplate.js";
import type Polyline from "../../geometry/Polyline.js";
import type { ClonableMixin } from "../../core/Clonable.js";
import type { JSONSupport } from "../../core/JSONSupport.js";
import type { BarrierType } from "./types.js";
import type { PolylineProperties } from "../../geometry/Polyline.js";
import type { PopupTemplateProperties } from "../../PopupTemplate.js";
export interface PolylineBarrierProperties extends Partial<Pick<PolylineBarrier, "barrierType" | "name">> {
/** The point location of the barrier. */
geometry?: PolylineProperties | null;
/**
* The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/) when the graphic is selected.
*
* @since 4.30
*/
popupTemplate?: PopupTemplateProperties | null;
}
/**
* A polyline barrier to restrict travel along a street network when using a [RouteLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/RouteLayer/).
*
* @since 4.23
* @see [RouteParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/RouteParameters/)
* @see [RouteLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/RouteLayer/)
* @example
* // Print the number of polyline barriers.
* const routeLayer = new RouteLayer({
* portalItem: {
* id: "69569b47b1e445b8a42ec12feab41ce9"
* }
* });
* await routeLayer.load();
*
* const count = routeLayer.polylineBarriers.length;
* console.log(`The route contains ${count} linear barriers`);
* // output: "The route contains 2 linear barriers"
*
* // Zoom to first barrier
* view.goTo(routeLayer.polylineBarriers[0].geometry)
*/
export default class PolylineBarrier extends PolylineBarrierSuperclass {
/**
* Creates a [PolylineBarrier](https://developers.arcgis.com/javascript/latest/references/core/rest/support/PolylineBarrier/) from the parsed [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/).
* The method assumes that the graphic's attributes conform to the route layer item schema.
*
* @param graphic - A Graphic instance.
* @returns A PolylineBarrier instance.
* @since 4.24
*/
static fromGraphic(graphic: Graphic): PolylineBarrier;
constructor(properties?: PolylineBarrierProperties);
/**
* Specify whether the barrier restricts travel completely or scales time or distance when it is crossed.
*
* @see [BarrierType](https://developers.arcgis.com/rest/services-reference/enterprise/route-sync-services.htm#GUID-65AAF8A9-0B96-466C-8AA8-22090F9982A6)
*/
accessor barrierType: BarrierType | null | undefined;
/** The point location of the barrier. */
get geometry(): Polyline | null | undefined;
set geometry(value: PolylineProperties | null | undefined);
/** The name of the barrier. */
accessor name: string | null | undefined;
/**
* The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/) when the graphic is selected.
*
* @since 4.30
*/
get popupTemplate(): PopupTemplate | null | undefined;
set popupTemplate(value: PopupTemplateProperties | null | undefined);
get type(): "polyline-barrier";
/**
* Creates a [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) from the [PolylineBarrier](https://developers.arcgis.com/javascript/latest/references/core/rest/support/PolylineBarrier/) instance.
* The resulting graphic will have attributes that conform to the route layer item schema.
*
* @returns A Graphic instance.
* @since 4.24
*/
toGraphic(): Graphic;
}
declare const PolylineBarrierSuperclass: typeof JSONSupport & typeof ClonableMixin