コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
 /// <summary>
 /// Returns the data points currently displayed by this heatmap.
 /// </summary>
 /// <returns></returns>
 public Task <IEnumerable <object> > GetData()
 {
     return(_jsObjectRef.InvokeAsync <IEnumerable <object> >(
                "getData"));
 }
コード例 #7
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));
 }
コード例 #8
0
ファイル: Polygon.cs プロジェクト: emiliszrc/TAVISfe
 /// <summary>
 /// Returns whether this shape can be dragged by the user.
 /// </summary>
 /// <returns></returns>
 public Task <bool> GetDraggble()
 {
     return(_jsObjectRef.InvokeAsync <bool>(
                "getDraggble"));
 }
コード例 #9
0
 /// <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));
 }
コード例 #10
0
ファイル: DrawingManager.cs プロジェクト: emiliszrc/TAVISfe
        /// <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));
        }
コード例 #11
0
 public Task Push(LatLngLiteral coordinate)
 {
     return(_jsObjectRef.InvokeAsync("push", coordinate));
 }
コード例 #12
0
ファイル: Marker.cs プロジェクト: rezasfl/BlazorGoogleMaps
        public async Task <Animation> GetAnimation()
        {
            var animation = await _jsObjectRef.InvokeAsync <string>(
                "getAnimation");

            return(Helper.ToEnum <Animation>(animation));
        }
コード例 #13
0
 /// <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));
 }
コード例 #14
0
        public async Task RemoveAsync()
        {
            await _jsObjectRef.InvokeAsync("remove");

            await _jsObjectRef.DisposeAsync();
        }
コード例 #15
0
ファイル: MouseEvent.cs プロジェクト: emiliszrc/TAVISfe
 /// <summary>
 /// Prevents this event from propagating further.
 /// </summary>
 public Task Stop()
 {
     return(JsObjectRef.InvokeAsync("stop"));
 }
コード例 #16
0
 /// <summary>
 /// Closes this InfoWindow by removing it from the DOM structure.
 /// </summary>
 public Task Close()
 {
     return(_jsObjectRef.InvokeAsync("close"));
 }
コード例 #17
0
ファイル: Circle.cs プロジェクト: willapp/BlazorGoogleMaps
 /// <summary>
 /// Gets the LatLngBounds of this Circle.
 /// </summary>
 /// <returns></returns>
 public Task <LatLngBoundsLiteral> GetBounds()
 {
     return(_jsObjectRef.InvokeAsync <LatLngBoundsLiteral>("getBounds"));
 }
コード例 #18
0
 public virtual Task <Map> GetMap()
 {
     return(_jsObjectRef.InvokeAsync <Map>(
                "getMap"));
 }
コード例 #19
0
 public virtual async Task SetMap(Map map)
 {
     await _jsObjectRef.InvokeAsync("setMap", map);
 }
コード例 #20
0
        public async Task <Point> FromLatLngToPoint(LatLngLiteral literal)
        {
            var result = await _jsObjectRef.InvokeAsync <Point>("fromLatLngToPoint", literal);

            return(result);
        }