AddDrivetimeZone method
Adds a freeform closed shape representing the driving distance from a point on the map within a specified amount of time. Returns the newly created Shape object with a Type property of geoFreeform.
Applies to
Collections: Shapes
Syntax
object.AddDrivetimeZone(Center, Time)
Parameters
Part | Description |
---|---|
object | Required. An expression that returns a Shapes collection. |
Center | Required Location object. The point on the map around which the drivetime zone is created. |
Time | Required Double. A number representing the duration of the drivetime zone as a fraction of a 24–hour day. Range is up to 999 minutes. |
Remarks
You can use GeoTimeConstants values when setting the Time parameter.
To move the drivetime zone in front of or behind roads, use the ZOrder method on the Shape object.
To set the properties of the drivetime zone, see Shape object.
To learn more about drivetime zones, see the Create a drivetime zone procedural topic.
To learn more about drawing shapes on maps, see the About using shapes in MapPoint topic.
Example
Sub AddDrivetimeZoneToMap()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objLoc As MapPoint.Location
'Set up the application
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
'Get a location and zoom in
Set objLoc = objMap.FindResults("Seattle, WA").Item(1)
Set objMap.Location = objLoc
'Create a drivetime zone from this location
objMap.Shapes.AddDrivetimeZone objLoc, 15 * geoOneMinute
End Sub
Note This sample code is specifically for use in MapPoint North America; it is for illustration purposes only.