Share via


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

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.