@geoapify/route-planner-sdk
Version:
TypeScript SDK for the Geoapify Route Planner API. Supports route optimization, delivery planning, and timeline visualization in browser and Node.js
36 lines (35 loc) • 722 B
JavaScript
export class ShipmentStep {
constructor(raw) {
if (raw) {
this.raw = raw;
}
else {
this.raw = {
time_windows: []
};
}
}
getRaw() {
return this.raw;
}
setRaw(value) {
this.raw = value;
return this;
}
setLocation(lon, lat) {
this.raw.location = [lon, lat];
return this;
}
setLocationIndex(value) {
this.raw.location_index = value;
return this;
}
setDuration(value) {
this.raw.duration = value;
return this;
}
addTimeWindow(start, end) {
this.raw.time_windows.push([start, end]);
return this;
}
}