Exemple #1
0
 /// <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);
        }
Exemple #3
0
 /// <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);
     }
 }
Exemple #4
0
 /// <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));
 }
Exemple #5
0
 /// <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));
 }
Exemple #6
0
 /// <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));
 }
Exemple #7
0
 /// <summary>
 /// Returns true if this bounds approximately equals the given bounds.
 /// </summary>
 public Task <bool> Equals(LatLngBoundsLiteral other)
 {
     return(_jsObjectRef.InvokeAsync <bool>("equals", other));
 }
Exemple #8
0
 /// <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));
 }
Exemple #9
0
 /// <summary>
 /// Sets the bounds of this rectangle.
 /// </summary>
 /// <param name="bounds"></param>
 public Task SetBounds(LatLngBoundsLiteral bounds)
 {
     return(_jsObjetRef.InvokeAsync(
                "setBounds",
                bounds));
 }
Exemple #10
0
        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);
        }