ALKMaps.Layer.DriveTime

A vector layer for displaying drive time polygons.  Create a new instance with the ALKMaps.Layer.DriveTime constructor.

Inherits from

Summary
ALKMaps.Layer.DriveTimeA vector layer for displaying drive time polygons.
Properties
framePolygon{Boolean} Determines whether or not the map should zoom to the bounds of the most recently added polygon.
Constructor
ALKMaps.Layer.DriveTimeCreate a vector layer for displaying drive time polygons
Functions
setMapForces this layer having the same projection as the map.
addDriveTimePolygonAdds a new polygon to the map using the getDriveTimePolygon service.
removeDriveTimePolygonRemove the drive time polygon with the given id.

Properties

framePolygon

{Boolean} Determines whether or not the map should zoom to the bounds of the most recently added polygon.

Constructor

ALKMaps.Layer.DriveTime

Create a vector layer for displaying drive time polygons

Parameters

name{String} Used to identify this layer.
options{Object} Optional object whose properties will be set on the instance.

Returns

{ALKMaps.Layer.DriveTime} A new vector layer for drawing drive time polygons.

Functions

setMap

setMap: function (map)

Forces this layer having the same projection as the map.

Parameters

map{ALKMaps.Map}

addDriveTimePolygon

addDriveTimePolygon: function(params)

Adds a new polygon to the map using the getDriveTimePolygon service.

Parameters

center{ALKMaps.LonLat} Center point of polygon.  The center acts as the starting point of all the virtual route paths ending at each point in the polygon.  The projection of this point is inherited from the base layer.
minutes{Number} Driving time in minutes from the center point to each point of the polygon.
style{Object} optional object containing the styling properties to be used for the polygon feature.
framePolygon{Boolean} Determines whether or not map should zoom to the bounds of the polygon after it is added.
options{Object} Object containing optional routing and trucking configurations.
success{Function} success callback function
failure{Function} failure callback function

Example

driveTimeLayer.addDriveTimePolygon({
     center: new ALKMaps.LonLat(-8310543.22567,4919623.93353), //inherits projection from the base layer
     minutes: 10,
     options: {
         region: "NA",
         dataset: "Current",
         highwayOnly: false,
         tollDiscourage: true
     },
     success: function(response){
         console.log(response);
     }
});

Returns

The id of the polygon is returned in the success callback function.

removeDriveTimePolygon

removeDriveTimePolygon: function (id)

Remove the drive time polygon with the given id.

Parameters

id{String} Id of the polygon that will be removed from the layer.

Example

driveTimeLayer.removeDriveTimePolygon("ALKMaps.Feature.Vector_400");

Returns

{Boolean} Whether or not polygon was successfully removed.

setMap: function (map)
Forces this layer having the same projection as the map.
addDriveTimePolygon: function(params)
Adds a new polygon to the map using the getDriveTimePolygon service.
removeDriveTimePolygon: function (id)
Remove the drive time polygon with the given id.
Create a vector layer for displaying drive time polygons
Instances of ALKMaps.Layer.Vector are used to render vector data from a variety of sources.
Instances of ALKMaps.Map are interactive maps embedded in a web page.
This class represents a longitude and latitude pair
Close