コード例 #1
0
        public void OnShow()
        {
            RemoveMapView();

            _map = new AppleMapsView(CreateMapOptions());
            _map.Show(AppleMapsDemoUtils.RectTransformToScreenSpace(rect));

            Debug.Log(_map.MapType);

            // Point annotations
            AddPointAnnotation();
            AppleMapsDemoUtils.AddRandomPointAnnotations(_map);

            // Circles
            AddCircle();
            AppleMapsDemoUtils.AddRandomPointCircles(_map);

            // Polylines & Polygons
            AddPolyline();
            AddPolygon();

            // Image overlay
            AddImageOverlay();

            SetMapListeners();
        }
コード例 #2
0
 public void RemoveMapView()
 {
     if (_map != null)
     {
         _map.Remove();
         _map = null;
     }
 }
コード例 #3
0
 public static void AddRandomPointCircles(AppleMapsView map)
 {
     for (int i = 0; i < 5; i++)
     {
         var location = new LocationCoordinate2D(i * -10, i * 10);
         var circle   = new Circle(location, 1000 * (i + 1));
         map.AddOverlay(circle);
     }
 }
コード例 #4
0
 public static void AddRandomPointAnnotations(AppleMapsView map)
 {
     for (int i = 0; i <= 5; i++)
     {
         var location        = new LocationCoordinate2D(i * 10, i * 10);
         var pointAnnotation = new PointAnnotation(location, "Title" + i, "Subtitle" + i)
         {
             PinTintColor = AppleMapsUtils.RandomColor()
         };
         map.AddAnnotation(pointAnnotation);
     }
 }
コード例 #5
0
        public static void UpdateMapOptions(AppleMapsView map)
        {
            map.MapType          = MapViewType.Satellite;
            map.CoordinateRegion = BerlinRegion;

            map.IsScrollEnabled       = true;
            map.IsRotateEnabled       = true;
            map.IsZoomEnabled         = true;
            map.IsPitchEnabled        = true;
            map.ShowsBuildings        = true;
            map.ShowsCompass          = true;
            map.ShowsPointsOfInterest = true;
            map.ShowsScale            = true;
            map.ShowsTraffic          = true;
        }