Exemplo n.º 1
0
        public async Task InitAsync(string id, MapOptions options)
        {
            DivId = id;

            await JsFunctionInterop.Init(id, options);

            MapComponentInstances.Add(id, this);
        }
Exemplo n.º 2
0
        public async Task InitAsync(ElementRef element, MapOptions options)
        {
            DivId = Guid.NewGuid().ToString();

            var optionsJson = JsonConvert.SerializeObject(options,
                                                          Formatting.None,
                                                          new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore,
                ContractResolver  = new CamelCasePropertyNamesContractResolver()
            });

            await JsRuntime.JsonNetInvokeAsync <bool>(
                "googleMapJsFunctions.init",
                DivId,
                element,
                optionsJson);

            MapComponentInstances.Add(DivId, this);
        }
        public override MapComponent ReadJson(JsonReader reader, Type objectType, MapComponent existingValue, bool hasExistingValue, JsonSerializer serializer)
        {
            var mapId = reader.ReadAsString();

            return(MapComponentInstances.GetInstance(mapId));
        }
Exemplo n.º 4
0
 public void Dispose()
 {
     ClearListeners();
     JsFunctionInterop.Dispose(DivId);
     MapComponentInstances.Remove(DivId);
 }