GetLocation method

Returns a Location object for a given latitude and longitude coordinate. Does not change the map view.

Applies to

Objects:  Map

Syntax

object.GetLocation(Latitude, Longitude, [Altitude])

Parameters

Part Description
object Required. An expression that returns a Map object.
Latitude Required Double. A numerical coordinate that measures how far north (+) or south (-) of the Equator a place is located, measured in decimal degrees. Range is 0° to (+/-)90°. For example, "34.33896".
Longitude Required Double. A numerical coordinate that measures how far east (+) or west (-) of the Prime Meridian a place is located, measured in decimal degrees. Range is 0° to (+/-)180°. For example, "-79.43433".
Altitude Optional Double. The height above the earth's surface from which the map is viewed, in GeoUnits. If not specified, the resulting Location object will use the current altitude for the GoTo method.

Remarks

For more information on latitude and longitude, see the Help topic About latitude and longitude.

To return or set GeoUnits, use the Units property of an Application or MappointControl object.

Example

    Sub ZoomToLocation()

    Dim objApp As New MapPoint.Application     Dim objLoc As MapPoint.Location
    'Get the location of Los Angeles, CA, using latitude and longitude     Set objLoc = objApp.ActiveMap.GetLocation(47.75399, -121.97436, 100)     objLoc.GoTo
  End Sub

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