/// <summary> /// The opacity of the overlay, expressed as a number between 0 and 1. Optional. Defaults to 1. /// </summary> /// <param name="opacity"></param> /// <returns></returns> public async Task SetOpacity(double opacity) { if (opacity > 1) { return; } if (opacity < 0) { return; } await _jsObjectRef.InvokeAsync("setOpacity", opacity); }
/// <summary> /// Issue a directions search request. /// </summary> /// <param name="request"></param> /// <param name="callback"></param> public async Task <DirectionResponse> Route(DirectionsRequest request) { await _jsObjectRef.InvokeAsync( $"{jsObjectName}.route", request); return(null); }
/// <summary> /// Issue a directions search request. /// </summary> /// <param name="request"></param> /// <param name="callback"></param> public async Task <DirectionResponse> Route(DirectionsRequest request) { var json = await _jsObjectRef.InvokeAsync <string>( $"{jsObjectName}.route", request); var directionResponse = JsonConvert.DeserializeObject <DirectionResponse>(json); return(directionResponse); }
public virtual async Task ClearListeners(string eventName) { if (EventListeners.ContainsKey(eventName)) { await _jsObjectRef.InvokeAsync("clearListeners", eventName); //IMHO is better preserving the knowledge that Marker had some EventListeners attached to "eventName" in the past //so, instead to clear the list and remove the key from dictionary, I prefer to leave the key with an empty list EventListeners[eventName].Clear(); } }
public async Task <DirectionsResult> Route(DirectionsRequest request) { var response = await _jsObjectRef.InvokeAsync <string>( "googleMapDirectionServiceFunctions.route", request); try { var DirResult = JsonConvert.DeserializeObject <DirectionsResult>(response); return(DirResult); } catch (Exception e) { Console.WriteLine("Error parsing DirectionsResult Object. Message: " + e.Message); return(null); } }
/// <summary> /// Returns the data points currently displayed by this heatmap. /// </summary> /// <returns></returns> public Task <IEnumerable <object> > GetData() { return(_jsObjectRef.InvokeAsync <IEnumerable <object> >( "getData")); }
/// <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> /// Returns whether this shape can be dragged by the user. /// </summary> /// <returns></returns> public Task <bool> GetDraggble() { return(_jsObjectRef.InvokeAsync <bool>( "getDraggble")); }
/// <summary> /// Returns true if the given lat/lng is in this bounds. /// </summary> public Task <bool> Contains(LatLngLiteral other) { return(_jsObjectRef.InvokeAsync <bool>("contains", other)); }
/// <summary> /// Returns the DrawingManager's drawing mode. /// </summary> /// <returns></returns> public async Task <OverlayType> GetDrawingMode() { var result = await _jsObjectRef.InvokeAsync <string>("getDrawingMode"); return(Helper.ToEnum <OverlayType>(result)); }
public Task Push(LatLngLiteral coordinate) { return(_jsObjectRef.InvokeAsync("push", coordinate)); }
public async Task <Animation> GetAnimation() { var animation = await _jsObjectRef.InvokeAsync <string>( "getAnimation"); return(Helper.ToEnum <Animation>(animation)); }
/// <summary> /// Adds a feature to the collection, and returns the added feature. /// If the feature has an ID, it will replace any existing feature in the collection with the same ID.If no feature is given, a new feature will be created with null geometry and no properties.If FeatureOptions are given, a new feature will be created with the specified properties. /// Note that the IDs 1234 and '1234' are equivalent. Adding a feature with ID 1234 will replace a feature with ID '1234', and vice versa. /// </summary> /// <param name="feature"></param> /// <returns></returns> public Task <Data.Feature> Add(OneOf <Data.Feature, Data.FeatureOptions> feature) { return(_jsObjectRef.InvokeAsync <Data.Feature>( "add", feature)); }
public async Task RemoveAsync() { await _jsObjectRef.InvokeAsync("remove"); await _jsObjectRef.DisposeAsync(); }
/// <summary> /// Prevents this event from propagating further. /// </summary> public Task Stop() { return(JsObjectRef.InvokeAsync("stop")); }
/// <summary> /// Closes this InfoWindow by removing it from the DOM structure. /// </summary> public Task Close() { return(_jsObjectRef.InvokeAsync("close")); }
/// <summary> /// Gets the LatLngBounds of this Circle. /// </summary> /// <returns></returns> public Task <LatLngBoundsLiteral> GetBounds() { return(_jsObjectRef.InvokeAsync <LatLngBoundsLiteral>("getBounds")); }
public virtual Task <Map> GetMap() { return(_jsObjectRef.InvokeAsync <Map>( "getMap")); }
public virtual async Task SetMap(Map map) { await _jsObjectRef.InvokeAsync("setMap", map); }
public async Task <Point> FromLatLngToPoint(LatLngLiteral literal) { var result = await _jsObjectRef.InvokeAsync <Point>("fromLatLngToPoint", literal); return(result); }