public void RemovePushpin(BingMapPushpin pushpin)
        {
            pushpin.OnMouseOver -= Pushpin_OnMouseOver;
            pushpin.OnMouseOut  -= Pushpin_OnMouseOut;
            pushpin.OnDragEnd   -= Pushpin_OnDragEnd;
            pushpin.OnDragStart -= Pushpin_OnDragStart;

            Entities.Remove(pushpin);
        }
        public void ToggleVisibility(BingMapPushpin pushpin)
        {
            var visible = !pushpin.OptionsSnapshot.Visible ?? false;

            pushpin.Options = new PushpinOptions
            {
                Visible = visible
            };

            StateHasChanged();
        }
Esempio n. 3
0
        public Task AddPushpin(string mapId, BingMapPushpin pushpin)
        {
            if (!pushpins.ContainsKey(mapId))
            {
                pushpins[mapId] = new HashSet <string>();
            }
            pushpins[mapId].Add(pushpin.Id);

            JSRuntime.Current.InvokeAsync <object>("rpedrettiBlazorComponents.bingMaps.pushpin.add", mapId, pushpin);
            return(Task.CompletedTask);
        }