Пример #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);
        }
        /// <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();
            }
        }
        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
 /// <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
        /// <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
        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
 /// <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
 /// <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);
        }