private void my_locabtnclick(object sender, RoutedEventArgs e)
{
if (Mymap.Layers.Contains(_sourceLayer))
Mymap.Layers.Remove(_sourceLayer);
_externalSource = false;
_sourcePoi = false;
if (_routePoi != null)
{
if (_routePoi.pois != null)
{
if (_routePoi.pois.Count > 0)
{
if (Mymap.Layers.Contains(indoorLayer))
Mymap.Layers.Remove(indoorLayer);
_routePoi.pois.Clear();
// clear directions
if (GetRoute.Count != 0)
{
GetRoute.Clear();
if (_myMapRoute != null)
{
routedetails_layer.Clear();
Mymap.RemoveRoute(_myMapRoute);
Mymap.Layers.Remove(routedetails_layer);
routeNavDetails.Clear();
}
}
}
}
}
if (_floorPoiTo != null)
if (Mymap.MapElements.Contains(_polyline))
{
// if we are into the building and no source poi set get navigations route from location to poi
if (_tileLoaded && !_sourcePoi)
{
Mymap.MapElements.Clear();
GetNavigationRoutesBuilding(_selectedBuild, _floorPoiTo, _selectedFloor, _myLatitude.ToString(CultureInfo.InvariantCulture),
_myLongitude.ToString(CultureInfo.InvariantCulture));
}
else
{
// if we set source poi get navigations route from source poi else get all routes
if (_sourcePoi)
BuildingSourcePoi();
else
{
NavigateToFloorPoi();
}
}
}
}