public partial class MainPage : PhoneApplicationPage {
private const double DefaultZoomLevel = 17.0;
private readonly CredentialsProvider _credentialsProvider = new ApplicationIdCredentialsProvider(App.Id);
private static readonly GeoCoordinate DefaultLocation = new GeoCoordinate(38.3744951212275, 26.8655549034000);
public MainPage() {
InitializeComponent();
Loaded += MainPage_Loaded;
}
private void MainPage_Loaded(object sender, RoutedEventArgs e) {
myMap.CredentialsProvider = _credentialsProvider;
Pushpin myPushpin_1 = new Pushpin();
myPushpin_1.Location = new GeoCoordinate(38.3744951212275, 26.8655549034000);
myPushpin_1.Content = "Günlük taze balık alınabilir..";
myPushpin_1.Background = new SolidColorBrush(Colors.Red);
myMap.Children.Add(myPushpin_1);
myMap.Center = DefaultLocation;
myMap.ZoomLevel = DefaultZoomLevel;
}
private void changeMapMode() {
if (myMap.Mode is AerialMode) {
myMap.Mode = new RoadMode();
}
else {
myMap.Mode = new AerialMode(true);
}
}
private void btnChangeMode_Click(object sender, EventArgs e) {
changeMapMode();
}
private void btnZoomIn_Click(object sender, EventArgs e) {
myMap.ZoomLevel = myMap.ZoomLevel + 1;
}
private void btnZoomOut_Click(object sender, EventArgs e) {
myMap.ZoomLevel = myMap.ZoomLevel - 1;
}
private void btnCenter_Click(object sender, EventArgs e) {
myMap.Center = DefaultLocation;
myMap.ZoomLevel = DefaultZoomLevel;
}
private void myMap_TargetViewChanged(object sender, MapEventArgs e) {
// Enlem ve Boylam
PageTitle.Text = string.Format("{0} : {1}", myMap.Mode.TargetCenter.Latitude, myMap.Mode.TargetCenter.Longitude);
}
}