C# Class GPSTD_RM.BingMapsViewer

Show file Open project: dideler/gps-tower-defense Class Usage Examples

Public Properties

Property Type Description
CenterGeoCoordinate GeoCoordinate
Offset Vector2
ScreenCenter Vector2

Public Methods

Method Description
BingMapsViewer ( string bingMapKey, Microsoft.Xna.Framework.Graphics.Texture2D defaultImage, Microsoft.Xna.Framework.Graphics.Texture2D unavailableImage, GeoCoordinate location, int gridSize, int zoomlevel, SpriteBatch spriteBatch ) : System

Initializes new Bing maps viewer.

CenterOnLocation ( GeoCoordinate location ) : void

Centers the view on a specified geo-coordinate.

ConvertGeoCoordinateToScreenPosition ( GeoCoordinate location ) : Vector2

Convert a geo-coordinate to a coordinate on the device's display.

ConvertScreenPositionToGeoCoordinate ( Vector2 screenPosition ) : GeoCoordinate

Convert a position on the device's display to the corresponding geo-coordinate.

Draw ( ) : void

Draw the map on the screen. Assumes that SpriteBatch.Begin has been called.

MoveByOffset ( Vector2 gestureOffset ) : void

Move the map by a specified offset, but prevent a move that would transition to a tile that is off the active tile set.

RefreshImages ( ) : void

Refreshes the displayed images by getting them again from the REST services.

Method Details

BingMapsViewer() public method

Initializes new Bing maps viewer.
public BingMapsViewer ( string bingMapKey, Microsoft.Xna.Framework.Graphics.Texture2D defaultImage, Microsoft.Xna.Framework.Graphics.Texture2D unavailableImage, GeoCoordinate location, int gridSize, int zoomlevel, SpriteBatch spriteBatch ) : System
bingMapKey string The key used to access the Bing maps service.
defaultImage Microsoft.Xna.Framework.Graphics.Texture2D The default image to show until actual image data is retrieved.
unavailableImage Microsoft.Xna.Framework.Graphics.Texture2D The image to use for tiles where an image is not available.
location GeoCoordinate The initial location to use.
gridSize int The size of the active tile grid around the desired location. For example, /// specifying 3 will retrieve a 3x3 set of images around the desired location. This number must be /// positive and odd.
zoomlevel int The zoom level (1 - 22).
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch A sprite batch that can be used to draw to the display.
return System

CenterOnLocation() public method

Centers the view on a specified geo-coordinate.
public CenterOnLocation ( GeoCoordinate location ) : void
location GeoCoordinate Geo-coordinate to center the view on.
return void

ConvertGeoCoordinateToScreenPosition() public method

Convert a geo-coordinate to a coordinate on the device's display.
public ConvertGeoCoordinateToScreenPosition ( GeoCoordinate location ) : Vector2
location GeoCoordinate Geo-coordinate to convert.
return Vector2

ConvertScreenPositionToGeoCoordinate() public method

Convert a position on the device's display to the corresponding geo-coordinate.
public ConvertScreenPositionToGeoCoordinate ( Vector2 screenPosition ) : GeoCoordinate
screenPosition Vector2 Screen position to convert.
return GeoCoordinate

Draw() public method

Draw the map on the screen. Assumes that SpriteBatch.Begin has been called.
public Draw ( ) : void
return void

MoveByOffset() public method

Move the map by a specified offset, but prevent a move that would transition to a tile that is off the active tile set.
public MoveByOffset ( Vector2 gestureOffset ) : void
gestureOffset Vector2 The offset to move the map by.
return void

RefreshImages() public method

Refreshes the displayed images by getting them again from the REST services.
public RefreshImages ( ) : void
return void

Property Details

CenterGeoCoordinate public property

The geo position at the center of the current center tile.
public GeoCoordinate CenterGeoCoordinate
return GeoCoordinate

Offset public property

Offset used for drawing the map tiles on the screen.
public Vector2 Offset
return Vector2

ScreenCenter public static property

The center pixel of the screen.
public static Vector2 ScreenCenter
return Vector2