|
// Houssem Dellai
// houssem.dellai@ieee.org
// +216 95 325 964
// Studying Software Engineering
// in the National Engineering School of Sfax (ENIS)
using System;
using System.Windows.Media;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Controls.Maps;
using System.Device.Location;
namespace BingMapsDemoV1
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
map1.CredentialsProvider = new ApplicationIdCredentialsProvider("Asa2x7ZzhYIHauji6TzIkcf3TIDznTgBaPKQehsyE4taOz19Mx4fP4lyihqbTj7D");
}
private void zoomIn_click(object sender, EventArgs e)
{
map1.ZoomLevel++;
}
private void zoomOut_click(object sender, EventArgs e)
{
map1.ZoomLevel--;
}
private void chooseMyPosition_click(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/ChooseMyPosition.xaml", UriKind.Relative));
}
private void Aerial_click(object sender, EventArgs e)
{
map1.Mode = new AerialMode(true);
}
private void Road_click(object sender, EventArgs e)
{
map1.Mode = new RoadMode();
}
private void locateMe_click(object sender, EventArgs e)
{
Pushpin p = new Pushpin();
p.Background = new SolidColorBrush(Colors.Yellow);
p.Foreground = new SolidColorBrush(Colors.Black);
p.Location = new GeoCoordinate(SharedInformation.myLatitude, SharedInformation.myLongitude);
p.Content = "I'm here";
map1.Children.Add(p);
map1.SetView(new GeoCoordinate(SharedInformation.myLatitude, SharedInformation.myLongitude, 200), 9);
}
private void setPin_click(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/PushpinProperties.xaml", UriKind.Relative));
}
private void addPin_click(object sender, EventArgs e)
{
Pushpin p = new Pushpin();
p.Background = new SolidColorBrush(Colors.Blue);
p.Foreground = new SolidColorBrush(Colors.White);
p.Location = new GeoCoordinate(SharedInformation.pinLat, SharedInformation.pinLong);
p.Content = SharedInformation.pinContent;
map1.Children.Add(p);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.