Skip to content

Instantly share code, notes, and snippets.

@darrelmiller
Created February 11, 2013 01:50
Show Gist options
  • Save darrelmiller/4751934 to your computer and use it in GitHub Desktop.
Save darrelmiller/4751934 to your computer and use it in GitHub Desktop.
public class BingMapLink : Link
{
public BingMapLink()
{
Target = new Uri("http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/{lat},{long}/{level}?mapSize={mapsize}&key={apikey}");
SetParameter("level", 10);
SetParameter("mapsize", "500, 500");
}
public void SetCoordinates(double latitude, double longitude)
{
SetParameter("lat", latitude.ToString());
SetParameter("long", longitude.ToString());
}
public void SetMapSize(int height, int width)
{
SetParameter("mapsize", string.Format("{0},{1}",height,width));
}
public void SetApiKey(string key)
{
SetParameter("apikey", key);
}
public void SetLevel(int level)
{
SetParameter("level", level.ToString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment