public void PanZoomTo(MapAnnotation ann, Motive.Core.Models.Vector span, float duration, Action onComplete = null) { PanZoomTo(ann.Coordinates, span, duration, () => { SelectAnnotation(ann); }); }
public void PanZoomTo(Coordinates coordinates, Motive.Core.Models.Vector span, float duration, Action onComplete = null) { // TODO: currently only works with 2D map double?targetZoom = null; var sw = m_mapScreenTopRight.x - m_mapScreenBottomLeft.x; var sh = m_mapScreenTopRight.y - m_mapScreenBottomLeft.y; var pw = Screen.width / sw; var ph = Screen.height / sh; var min = Math.Min(pw, ph); if (span != null) { targetZoom = MapView.TileDriver.GetZoomForDistanceSpan(span.X / min, span.Y / min); } CenterMap(coordinates, targetZoom, duration, onComplete); }