ALKMaps.Layer.DriveTime layer can be used to create an isochrone map representing the drivable distance from a center point within the given time constraint.
Add A Polygon #
A new drive time polygon can be added your
ALKMaps.Layer.DriveTime layer using the
addDriveTimePolygon function. The parameters for this function are mapped out in the table below.
Please note that projection of the
ALKMaps.Layer.DriveTime layer is inherited from the base layer, so the projection of the
ALKMaps.LonLat used for the center of the polygon must be in the same projection.
|The center point of the polygon.|
|Driving time in minutes from the specified center point. Can be a maximum of 30 minutes.|
|Optional object containing styling properties for the polygon.|
|If true, the map will be zoomed to the bounds of the newly added polygon.|
|Optional object containing the region and any routing or truck options. By default region will be inherited from the base layer.|
|Callback function called after a successful response is received from the service. The parameter passed in will be the id of the newly added polygon.|
|Callback function triggered on service error.|
Remove A Polygon #
removeDriveTimePolygon function can be used to remove an existing polygon from the layer by providing the id of the polygon. The polygon’s id can be obtained from the parameter in the user defined success callback function of
var id = "ALKMaps.Feature.Vector_248"; driveTime.removeDriveTimePolygon(id);