public async Task InitAsync(string id, MapOptions options) { DivId = id; await JsFunctionInterop.Init(id, options); MapComponentInstances.Add(id, this); }
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)); }
public void Dispose() { ClearListeners(); JsFunctionInterop.Dispose(DivId); MapComponentInstances.Remove(DivId); }