Last Updated: 01 Mar 2023 09:51 by ADMIN
Created on: 23 Feb 2023 03:55
Category: Map
Type: Feature Request
Implement observable data for Map Layers

Ability to refresh data for specific Map Layers. Currently the only way to update markers on Map is by calling Refresh on the Map component or issuing a StateHasChanged call.

Currently Maps does not support observable data, according to documentation: Databind to Observable Collection - Telerik UI for Blazor

Purpose: Ability to have "live" updating markers and/or shapes without calling MapRef.Refresh() which causes a full component "blink" and refresh in Edge, and to avoid StateHasChanged.

Example/Pseduo-Razor code:
<TelerikMap @ref="MapRef">
    <MapLayer Type="@MapLayersType.Marker" Data=@MyData" @ref="LayerRef" />

Example/Pseudo C# example
@code {
  TelerikMap MapRef {get; set; }
  TelerikMapLayer LayerRef { get; set; }

  MyData = new List<MapMarker>() {
    // Data in here

  private void WholeComponentRefresh() {
    MapRef.Refresh(); // Existing functionality

  private void AddMarker() {
    MyData.Add(new MapMarker()); // Map ignores this because it does not treat as observable

  private void MyLayerRefresh() {
    LayerRef.Refresh(); // If we don't have observable, could we at least get per-layer Refresh?