private void btn_poiscontrol_Click(object sender, RoutedEventArgs e)
{
var btn = sender as Button;
var context = btn.DataContext as GeoCoordinate;
if (Mymap.Layers.Contains(_sourceLayer))
Mymap.Layers.Remove(_sourceLayer);
_sourcePoi = false;
_externalSource = true;
_externalCoordinates = context;
if (Mymap.MapElements.Contains(_polyline))
{
Mymap.MapElements.Remove(_polyline);
NavigateToFloorPoi();
}
else
{
var imageMylocation = new Image
{
Source = new BitmapImage(new Uri("/Assets/source.png", UriKind.Relative))
};
_sourceOverlay = new MapOverlay();
_sourceLayer = new MapLayer();
_sourceOverlay.Content = imageMylocation;
_sourceOverlay.GeoCoordinate = context;
_sourceOverlay.PositionOrigin = new Point(0.5, 1);
_sourceLayer.Add(_sourceOverlay);
Mymap.Layers.Add(_sourceLayer);
}
}