Export (0) Print
Expand All

Location class

Bing

Contains the coordinate values of a location on the map.

Constructors

Definition Description

Location()

Initializes a new instance of the Location class with latitude and longitude values set to 0,0.

Location(double latitude, double longitude)

Initializes a new instance of the Location class using the specified latitude and longitude values.

Location( Location other)

Creates a copy of the specified Location.

Public Properties

Name Type Description

Latitude

double

Gets or sets the latitude of the location as degrees of latitude.

Longitude

double

Gets or sets the longitude of the location as degrees of longitude.

Public Methods

Name Definition Return Type Description

NormalizeLongitude

NormalizeLongitude(double longitude)

double

Converts a longitude value in degrees to be in the range [-180,180].

Code Examples

Set the center of the map.

<bm:Map>
  <bm:Map.Center>
    <bm:Location Latitude="46.227480" Longitude="-122.192955" />
  </bm:Map.Center>
</bm:Map>
myMap.Center = new Location(46.227480,-122.192955);

See Also

Show:
© 2014 Microsoft