Share via


Anchor property

Returns or sets the location of a waypoint (start point, stop, or end point for a route) on the map as a Location or Pushpin object. Read/write Object.

Applies to

Objects:  Waypoint

Syntax

object.Anchor

Parameters

Part Description
object Required. An expression that returns a Waypoint object.

Remarks

If the Pushpin to which a waypoint is anchored is subsequently moved or deleted, the waypoint is also moved or deleted.

Example

    Sub MoveWaypointLocation()

  Dim objApp As New MapPoint.Application   Dim objMap As MapPoint.Map   Dim objRoute As MapPoint.Route   Dim objLoc As MapPoint.Location
  'Set up the application   Set objMap = objApp.ActiveMap   Set objRoute = objMap.ActiveRoute   objApp.Visible = True   objApp.UserControl = True
  'Add one waypoint and get another location   objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)   Set objLoc = objMap.FindResults("Redmond, WA").Item(1)
  'Move the waypoint to a new location   Set objRoute.Waypoints.Item(1).Anchor = objLoc
  End Sub

Note  This sample code is specific for use in MapPoint North America; it is for illustration purposes only.