Esempio n. 1
0
        protected Annotation(LocationCoordinate2D locationCoordinate2D, string title, string subtitle)
        {
            Ptr = IntPtr.Zero;

            _location = locationCoordinate2D;
            _title    = title;
            _subtitle = subtitle;
        }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        // Input.location.Start();

        // if (Input.location.status == LocationServiceStatus.Failed)
        // {
        //     print("Unable to determine device location");
        //     yield break;
        // }
        // else
        // {
        //     // Access granted and location value could be retrieved
        //     print("Location: " + Input.location.lastData.latitude + " " + Input.location.lastData.longitude + " " + Input.location.lastData.altitude + " " + Input.location.lastData.horizontalAccuracy + " " + Input.location.lastData.timestamp);
        // }

        // int maxWait = 20;
        // while (Input.location.status == LocationServiceStatus.Initializing && maxWait > 0)
        // {
        //     yield return new WaitForSeconds(1);
        //     maxWait--;
        // }

        // // Service didn't initialize in 20 seconds
        // if (maxWait < 1)
        // {
        //     print("Timed out");
        //     yield break;
        // }

        // var locationInfo = Input.location.lastData;

        // Input.location.Stop();

        var location = new Map.LocationCoordinate2D(-37.5672953, 143.7827009);

#if !UNITY_EDITOR && UNITY_IOS
        var span = new Map.CoordinateSpan(.01, .01);

        var options = new Map.AppleMapOptions();
        options.Region(new Map.CoordinateRegion(location, span))
        .MapType(Map.MapViewType.Standard)
        .ScrollEnabled(true)
        .RotateEnabled(true)
        .ZoomEnabled(true)
        .PitchEnabled(true)
        .ShowBuildings(true)
        .ShowCompass(true)
        .ShowPointsOfInterest(true)
        .ShowScale(true)
        .ShowTraffic(true);
        _map = new Map.AppleMapsView(options);
        // _map.SetOnPinSelectedListener(HandleOnPinSelected);
        _map.Show(RectTransformToScreenSpace(mapTransform));

        AddTrashPins();
#endif
    }
Esempio n. 3
0
        public void SetCenter(LocationCoordinate2D coordinate, bool animated = true)
        {
            if (IsInvalid)
            {
                return;
            }

#if UNITY_IOS
            _appleMapsViewSetCenterCoordinateAnimated(_ptr, coordinate.Latitude, coordinate.Longitude, animated);
#endif
        }
Esempio n. 4
0
        public Circle(LocationCoordinate2D locationCoordinate2D, float radius)
        {
            if (radius <= 0)
            {
                throw new ArgumentOutOfRangeException("radius");
            }

            _locationCoordinate2D = locationCoordinate2D;
            _radius = radius;

            FillColor   = Color.black;
            StrokeColor = Color.black;
            LineWidth   = 10;
        }
Esempio n. 5
0
 public PointAnnotation(LocationCoordinate2D locationCoordinate2D, string tiltle, string subtitle, Color tintColor, bool animatesDrop = true)
     : base(locationCoordinate2D, tiltle, subtitle)
 {
     _tintColor    = tintColor;
     _animatesDrop = animatesDrop;
 }
Esempio n. 6
0
 public PointAnnotation(LocationCoordinate2D locationCoordinate2D, string tiltle, string subtitle)
     : base(locationCoordinate2D, tiltle, subtitle)
 {
 }
Esempio n. 7
0
 public PointAnnotation(LocationCoordinate2D locationCoordinate2D)
     : base(locationCoordinate2D)
 {
 }
Esempio n. 8
0
 protected Annotation(LocationCoordinate2D locationCoordinate2D)
 {
     _location = locationCoordinate2D;
 }
Esempio n. 9
0
 public CoordinateRegion(LocationCoordinate2D location, CoordinateSpan coordinateSpan)
 {
     _location       = location;
     _coordinateSpan = coordinateSpan;
 }