private void positionChanged()
{
if (_myLatitude == 0.0 || _myLongitude == 0.0)
return;
if (Mymap.Layers.Contains(mypositionPoi))
{
Mymap.Layers.Remove(mypositionPoi);
mypositionPoi.Clear();
}
if (_trackmeCheck || _first)
{
DrawMyPosition(_myLatitude, _myLongitude);
if (_first)
{
// center map
Mymap.Center.Latitude = _myLatitude;
Mymap.Center.Longitude = _myLongitude;
Mymap.SetView(Mymap.Center, 19, MapAnimationKind.Parabolic);
}
}
if (Mymap.Layers.Contains(detailPois))
{
Mymap.Layers.Remove(detailPois);
detailPois.Clear();
}
// set map view
if (_first)
{
if (ContentPanel.Visibility != Visibility.Visible && gd_result.Visibility != Visibility.Visible
&& directions_grid.Visibility != Visibility.Visible)
ApplicationBar.IsVisible = true;
if (!isDownloading)
{
loading.Visibility = Visibility.Collapsed;
loading.IsIndeterminate = false;
}
//var settings1 = IsolatedStorageFile.GetUserStoreForApplication();
//if (!settings1.FileExists("WorldBuilding"))
//{
// var result = MessageBox.Show("You have to download the required maps to use all the features. Download now?", "Download Required Maps", MessageBoxButton.OKCancel);
// if (result == MessageBoxResult.OK)
// {
// var isNetwork = NetworkInterface.GetIsNetworkAvailable();
// if (isNetwork)
// {
// ApplicationBar.IsVisible = false;
// downloading.Visibility = Visibility.Visible;
// DownloadRequireStaff();
// }
// else
// MessageBox.Show("No Internet Connection. Please check your internet connection and try again!");
// }
//}
_first = false;
}
}