public GroundOverlayOptions PositionFromBounds([NotNull] LatLngBounds latLngBounds)
        {
            if (latLngBounds == null)
            {
                throw new ArgumentNullException("latLngBounds");
            }

            _setPositionMethodAndroid = SetPositionMethodAndroid.LatLngBounds;

            _latLngBounds = latLngBounds;
            return(this);
        }
Пример #2
0
        public void SetPositionFromBounds(LatLngBounds bounds)
        {
            if (GoogleMapUtils.IsPlatformNotSupported)
            {
                return;
            }

            CheckIfRemoved();

 #if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS
            _googleMapsViewOverlaySetBounds(_overlayPtr, Json.Serialize(bounds.ToDictionary()));
#endif

            SetValueIfAndroid("setPositionFromBounds", bounds.ToAJO());
        }
Пример #3
0
        public GoogleMapsOptions LatLngBoundsForCameraTarget(LatLngBounds llbounds)
        {
            if (GoogleMapUtils.IsPlatformNotSupported)
            {
                return(this);
            }

            if (GoogleMapUtils.IsAndroid)
            {
                _ajo.CallAJO(LatLngBoundForCameraTargetMethodName, llbounds.ToAJO());
            }
            else
            {
                _dic[LatLngBoundForCameraTargetMethodName] = llbounds.ToDictionary();
            }

            return(this);
        }
Пример #4
0
        public static CameraUpdate NewLatLngBounds(LatLngBounds bounds, int width, int height, int padding)
        {
            if (GoogleMapUtils.IsPlatformNotSupported)
            {
                return(DummyCameraUpdate);
            }

            if (GoogleMapUtils.IsAndroid)
            {
                return(new CameraUpdate(CreateCameraUpdateAJO(NewLatLngBoundsMethodName, bounds.ToAJO(), width, height, padding)));
            }

            return(new CameraUpdate(new Dictionary <string, object>
            {
                { CameraUpdateTypeKey, NewLatLngBoundsMethodName + "WithInsets" },
                { "bounds", bounds.ToDictionary() },
                { "padding", padding }
            }));
        }
Пример #5
0
        public static void ShowPlaceAutocomplete(
            [NotNull] Action <Place> onPlacePicked,
            [NotNull] Action <string> onFailure,
            [GoogleMapsAndroidOnly] Mode mode = Mode.Fullscreen, AutocompleteFilter filter = AutocompleteFilter.None,
            string countryCode = null, LatLngBounds boundsBias = null)
        {
            if (onPlacePicked == null)
            {
                throw new ArgumentNullException("onPlacePicked");
            }
            if (onFailure == null)
            {
                throw new ArgumentNullException("onFailure");
            }

            if (GoogleMapUtils.IsPlatformNotSupported)
            {
                return;
            }

            _onPlacePicked = onPlacePicked;
            _onFailure     = onFailure;

            GooglePlacesSceneHelper.Init();

            if (GoogleMapUtils.IsAndroid)
            {
                PlacePickerActivityUtils.LaunchPlaceAutocomplete(mode, filter, countryCode, boundsBias);
            }

#if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS
            string bounds = null;
            if (boundsBias != null)
            {
                bounds = Json.Serialize(boundsBias.ToDictionary());
            }

            _googleMapsShowPlaceAutocomplete((int)mode, (int)filter, countryCode, bounds);
#endif
        }
Пример #6
0
 public static void LaunchPlaceAutocomplete(PlaceAutocomplete.Mode mode, PlaceAutocomplete.AutocompleteFilter filter, string countryCode, LatLngBounds boundsBias)
 {
     Launch(AUTOCOMPLETE_PICKER_REQUEST, intent =>
     {
         intent.CallAJO(PutExtraMethod, EXTRAS_MODE, (int)mode);
         intent.CallAJO(PutExtraMethod, EXTRAS_FILTER, (int)filter);
         if (countryCode != null)
         {
             intent.CallAJO(PutExtraMethod, EXTRAS_COUNTRY_CODE, countryCode);
         }
         if (boundsBias != null)
         {
             intent.CallAJO(PutExtraMethod, EXTRAS_BOUNDS_BIAS, boundsBias.ToAJO());
         }
     });
 }