I've got a strange issue with zooming via mouse scroll. After every change in marker and center (I need both of them, so I didn't test it separately) the zoom is running faster and faster, but only when using mouse scroll. Am I doing something wrong or it's a bug?
You can test it with the code below and clicking the Random button on top a few times and than trying to mouse scroll. It's not a critical issue but quite annoyance. Using `MapRef.Refresh()` instead of `StateHasChanged()`seems to not fix the issue.
You can test it with the code below and clicking the Random button on top a few times and than trying to mouse scroll. It's not a critical issue but quite annoyance. Using `MapRef.Refresh()` instead of `StateHasChanged()`seems to not fix the issue.
<TelerikButton OnClick="() => Random()">Random</TelerikButton>
<TelerikMap Center="@Center" Zoom="17">
<MapLayers>
<MapLayer Type="@MapLayersType.Marker"
Data="@MarkerData1"
LocationField="@nameof(MarkerModel.LatLng)"
TitleField="@nameof(MarkerModel.Title)" Shape="MapMarkersShape.Pin">
</MapLayer>
<MapLayer Type="@MapLayersType.Tile"
Attribution="@Attribution"
Subdomains="@Subdomains"
UrlTemplate="@UrlTemplate">
</MapLayer>
</MapLayers>
</TelerikMap>
@code {
public string[] Subdomains { get; set; } = new string[] { "a", "b", "c" };
public string UrlTemplate { get; set; } = "https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png";
public string Attribution { get; set; } = "© <a href='https://osm.org/copyright'>OpenStreetMap contributors</a>";
public double[] Center { get; set; } = new double[] { 60.268107, 97.744821 };
public List<MarkerModel> MarkerData1 { get; set; } = new List<MarkerModel>()
{
new MarkerModel()
{
LatLng = new double[] { 60.268107, 97.744821 },
Title = "Austin, TX"
}
};
public void Random() {
var marker = MarkerData1.First();
Random random = new Random();
var lat = random.NextDouble() * 90;
var lng = random.NextDouble() * 90;
marker.LatLng = new double[] { lat, lng };
Center = new double[] { lat, lng };
StateHasChanged();
}
public class MarkerModel
{
public double[] LatLng { get; set; }
public string Title { get; set; }
}
}