private void EndTapped()
{
var tappedPosition = (MapPoint)wm.ToGeographic(mLastKnownTapPoint);
Service.TriggerTapped(new TappedEventArgs { Content = Poi, Service = Service, TapPoint = new Point(tappedPosition.X, tappedPosition.Y) });
var tm = Poi.NEffectiveStyle.TapMode.Value;
if (tm == TapMode.CustomEvent) MessageBox.Show("Custom");
if (tm == TapMode.None) return;
if (tm == TapMode.Zoom)
{
if (Poi.Labels.ContainsKey("ZoomResolution"))
{
var r = double.Parse(Poi.Labels["ZoomResolution"]);
Execute.OnUIThread(delegate
{
var pos = (MapPoint)wm.FromGeographic(new MapPoint(Poi.Position.Longitude, Poi.Position.Latitude));
var w = (AppState.ViewDef.MapControl.ActualWidth / 2) * r;
var h = (AppState.ViewDef.MapControl.ActualHeight / 2) * r;
var env = new Envelope(pos.X - w, pos.Y - h, pos.X + w, pos.Y + h);
AppState.ViewDef.MapControl.Extent = env;
});
}
if (Poi.Labels.ContainsKey("ZoomRotation"))
{
AppState.ViewDef.MapControl.Rotation = double.Parse(Poi.Labels["ZoomRotation"]);
}
}
if (tm == TapMode.OpenMedia)
{
AddMediaToFloatingElements(mLastKnownTapPoint);
}
if (callOutVisible)
{
callOut.Close();
return;
}
if (tm == TapMode.Popup && GroupLayer != null)
{
GroupLayer.OpenPoiPopup(Poi);
}
switch (tm)
{
case TapMode.CallOutEdit:
case TapMode.CallOutPopup:
case TapMode.CallOut:
OpenPopup(mLastKnownTapPoint, tm);
break;
default: return;
}
}