Example #1
0
 public void PanZoomTo(MapAnnotation ann, Motive.Core.Models.Vector span, float duration, Action onComplete = null)
 {
     PanZoomTo(ann.Coordinates, span, duration, () =>
     {
         SelectAnnotation(ann);
     });
 }
Example #2
0
        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);
        }