public void SetOnCameraMoveStartedListener([CanBeNull] Action <CameraMoveReason> onCameraMoveStarted) { if (GoogleMapUtils.IsPlatformNotSupported) { return; } CheckIfDismissed(); if (GoogleMapUtils.IsAndroid) { GoogleMapAJO.MainThreadCall("setOnCameraMoveStartedListener", onCameraMoveStarted == null ? null : new setOnCameraMoveStartedListenerProxy(onCameraMoveStarted)); } #if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS Action <int> callbackWrapper = reason => { if (onCameraMoveStarted != null) { onCameraMoveStarted((CameraMoveReason)reason); } }; _googleMapsViewSetOnCameraMoveStartedListener(Callbacks.ActionIntCallback, callbackWrapper.GetPointer()); #endif }
void SetValueIfAndroid(string methodName, params object[] args) { CheckIfDismissed(); if (GoogleMapUtils.IsAndroid) { GoogleMapAJO.MainThreadCallNonBlocking(methodName, args); } }
public override string ToString() { if (GoogleMapUtils.IsAndroid && GoogleMapAJO.IsJavaNull()) { return("null"); } return(string.Format("[GoogleMapsView: UiSettings={0}, IsMyLocationEnabled={1}, IsVisible={2}, CameraPosition={3}, MapType={4}, IsTrafficEnabled={5}]", UiSettings, IsMyLocationEnabled, IsVisible, CameraPosition, MapType, IsTrafficEnabled)); }
public void SetPadding(int left, int top, int right, int bottom) { if (GoogleMapUtils.IsPlatformNotSupported) { return; } CheckIfDismissed(); if (GoogleMapUtils.IsAndroid) { GoogleMapAJO.MainThreadCall("setPadding", left, top, right, bottom); } #if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS _googleMapsViewSetPadding(_mapPtr, left, top, right, bottom); #endif }
public void SetOnLongMapClickListener([CanBeNull] Action <LatLng> onMapLongClicked) { if (GoogleMapUtils.IsPlatformNotSupported) { return; } CheckIfDismissed(); if (GoogleMapUtils.IsAndroid) { GoogleMapAJO.MainThreadCall("setOnMapLongClickListener", onMapLongClicked == null ? null : new OnMapLongClickListenerProxy(onMapLongClicked)); } #if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS _googleMapsViewSetOnMapLongClickListener(Callbacks.OnLocationSelectedCallback, onMapLongClicked.GetPointer()); #endif }
public void SetOnInfoWindowClickListener([CanBeNull] Action <Marker> listener) { if (GoogleMapUtils.IsPlatformNotSupported) { return; } CheckIfDismissed(); if (GoogleMapUtils.IsAndroid) { GoogleMapAJO.MainThreadCall("setOnInfoWindowClickListener", listener == null ? null : new OnMarkerInfoWindowClickListenerProxy(listener)); } #if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS _googleMapsViewSetOnMarkerInfoWindowClickListener(Callbacks.OnMarkerClickedCallback, listener.GetPointer()); #endif }
public void SetOnMarkerClickListener(Action <Marker> listener, bool defaultClickBehaviour = true) { if (GoogleMapUtils.IsPlatformNotSupported) { return; } CheckIfDismissed(); if (GoogleMapUtils.IsAndroid) { GoogleMapAJO.MainThreadCall("setOnMarkerClickListener", listener == null ? null : new OnMarkerClickListenerProxy(listener, defaultClickBehaviour)); } #if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS _googleMapsViewSetOnMarkerClickListener(Callbacks.OnMarkerClickedCallback, listener.GetPointer(), defaultClickBehaviour); #endif }
public void TakeSnapshot([NotNull] Action <Texture2D> listener) { if (listener == null) { throw new ArgumentNullException("listener"); } if (GoogleMapUtils.IsPlatformNotSupported) { return; } if (GoogleMapUtils.IsAndroid) { GoogleMapAJO.MainThreadCall("snapshot", new SnapshotReadyCallbackProxy(listener)); } #if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS _googleMapsViewTakeSnapshot(_mapPtr, Callbacks.ImageResultCallback, listener.GetPointer()); #endif }
public void MoveCamera([NotNull] CameraUpdate cameraUpdate) { if (cameraUpdate == null) { throw new ArgumentNullException("cameraUpdate"); } if (GoogleMapUtils.IsPlatformNotSupported) { return; } CheckIfDismissed(); #if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS _googleMapsViewAnimateCamera(_mapPtr, Json.Serialize(cameraUpdate.ToDictionary()), false); #endif if (GoogleMapUtils.IsAndroid) { GoogleMapAJO.MainThreadCall("moveCamera", cameraUpdate.ToAJO()); } }
public bool SetMapStyle([CanBeNull] string styleJson) { if (GoogleMapUtils.IsPlatformNotSupported) { return(false); } CheckIfDismissed(); if (GoogleMapUtils.IsAndroid) { return(GoogleMapAJO.MainThreadCall <bool>("setMapStyle", styleJson == null ? null : new AndroidJavaObject("com.google.android.gms.maps.model.MapStyleOptions", styleJson))); } #if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS return(_googleMapsViewSetStyle(_mapPtr, styleJson)); #endif #pragma warning disable 0162 return(false); #pragma warning restore 0162 }
T GetValueIfAndroid <T>(string methodName) { CheckIfDismissed(); return(GoogleMapUtils.IsAndroid ? GoogleMapAJO.MainThreadCall <T>(methodName) : default(T)); }