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

            _location = locationCoordinate2D;
            _title    = title;
            _subtitle = subtitle;
        }
Exemplo 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
    }
Exemplo 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
        }
Exemplo 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;
        }
Exemplo n.º 5
0
 public PointAnnotation(LocationCoordinate2D locationCoordinate2D, string tiltle, string subtitle, Color tintColor, bool animatesDrop = true)
     : base(locationCoordinate2D, tiltle, subtitle)
 {
     _tintColor    = tintColor;
     _animatesDrop = animatesDrop;
 }
Exemplo n.º 6
0
 public PointAnnotation(LocationCoordinate2D locationCoordinate2D, string tiltle, string subtitle)
     : base(locationCoordinate2D, tiltle, subtitle)
 {
 }
Exemplo n.º 7
0
 public PointAnnotation(LocationCoordinate2D locationCoordinate2D)
     : base(locationCoordinate2D)
 {
 }
Exemplo n.º 8
0
 protected Annotation(LocationCoordinate2D locationCoordinate2D)
 {
     _location = locationCoordinate2D;
 }
Exemplo n.º 9
0
 public CoordinateRegion(LocationCoordinate2D location, CoordinateSpan coordinateSpan)
 {
     _location       = location;
     _coordinateSpan = coordinateSpan;
 }