/// <summary> /// Sets the bounds of this rectangle. /// </summary> /// <param name="bounds"></param> public Task SetBounds(LatLngBoundsLiteral bounds) { return(_jsRuntime.InvokeWithDefinedGuidAndMethodAsync <bool>( "googleMapRectangleJsFunctions.invoke", _guid.ToString(), "setBounds", bounds)); }
public virtual async Task FitMapToMarkers(int padding) { var newBounds = new LatLngBoundsLiteral(await _originalMarkers.First().GetPosition()); foreach (var marker in _originalMarkers) { newBounds.Extend(await marker.GetPosition()); } await _map.FitBounds(newBounds, padding); }
/// <summary> /// Create or extend a LatLngBoundsLiteral with a given coordinate point. /// Using this method you can initialize a LatLngBoundsLiteral reference with null and call /// subsequently this method to extend the boundaries by given points. /// </summary> public static void CreateOrExtend(ref LatLngBoundsLiteral latLngBoundsLiteral, LatLngLiteral latLng) { if (latLngBoundsLiteral == null) { latLngBoundsLiteral = new LatLngBoundsLiteral(latLng); } else { latLngBoundsLiteral.Extend(latLng); } }
/// <summary> /// Sets the viewport to contain the given bounds. /// </summary> /// <param name="bounds"></param> /// <returns></returns> public Task FitBounds(LatLngBoundsLiteral bounds, OneOf <int, Padding>?padding = null) { return(_jsObjectRef.InvokeAsync("fitBounds", bounds, padding)); }
/// <summary> /// Pans the map by the minimum amount necessary to contain the given LatLngBounds. /// It makes no guarantee where on the map the bounds will be, except that the map will be panned to show as much of the bounds as possible inside {currentMapSizeInPx} - {padding}. /// </summary> /// <param name="latLngBounds"></param> /// <returns></returns> public Task PanToBounds(LatLngBoundsLiteral latLngBounds) { return(_jsObjectRef.InvokeAsync("panToBounds", latLngBounds)); }
/// <summary> /// Returns true if this bounds shares any points with the other bounds. /// </summary> public Task <bool> Intersects(LatLngBoundsLiteral other) { return(_jsObjectRef.InvokeAsync <bool>("intersects", other)); }
/// <summary> /// Returns true if this bounds approximately equals the given bounds. /// </summary> public Task <bool> Equals(LatLngBoundsLiteral other) { return(_jsObjectRef.InvokeAsync <bool>("equals", other)); }
/// <summary> /// Extends this bounds to contain the union of this and the given bounds. /// </summary> public Task Union(LatLngBoundsLiteral other) { return(_jsObjectRef.InvokeAsync("union", other)); }
/// <summary> /// Sets the bounds of this rectangle. /// </summary> /// <param name="bounds"></param> public Task SetBounds(LatLngBoundsLiteral bounds) { return(_jsObjetRef.InvokeAsync( "setBounds", bounds)); }
public async static Task <GroundOverlay> CreateAsync(IJSRuntime jsRuntime, string url, LatLngBoundsLiteral bounds, GroundOverlayOptions opts = null) { var jsObjectRef = await JsObjectRef.CreateAsync(jsRuntime, "google.maps.GroundOverlay", url, bounds, opts); var obj = new GroundOverlay(jsObjectRef); return(obj); }