ichim / LeafletForBlazor-NuGet

LeafletForBlazor NuGet Package - You can quickly add a map control to your Blazor application - 2.2.2.2 version. #12 issue, StreamLegend customization
https://www.nuget.org/packages/LeafletForBlazor#versions-body-tab
74 stars 9 forks source link

First Initializing #10

Open gokhangumul opened 10 months ago

gokhangumul commented 10 months ago

Hi Laurentiu, First of all, thank you very much for this beautiful package but I have a problem initializing of the map takes a little long what can I do to speed it up? Thanks.

ichim commented 10 months ago

Hello sir, Are you using the Map or RealTimeMap control? The RealTimeMap control is optimized to make as few requests as possible!

gokhangumul commented 10 months ago

Thanks for reply,

When I checked, I observed that he entered the function named stream_points_update many times and kept it waiting here.I applied the example in the link I sent at the bottom.

Example

ichim commented 10 months ago

Thank you very much for the answer. I will check. The package (LeafletForBlazor) uses separate threads. Each distinct type (StramPoint) is allocated a thread. In Leaflet, each type is drawn on a separate layer. This to improve performance. You have many types? On the other hand, I also noticed a slowdown at more than 1000 - 3000 points, but the slowdown is due to the map display. After the points are drawn the map was incredibly hard to move.

Esri Map (ArcGIS API for JavaScript) can work with a large number of points.

gokhangumul commented 10 months ago

I'm just specifying a center on the map without adding any marker,polygon and other object.

Code example;

.razor

<Map 
    width="600px" 
    height="600px"
    Parameters="@parameters"
></Map>

.razor.cs

Map.LoadParameters parameters = new Map.LoadParameters()
    {
        location = new Map.Location()
        {
            longitude = 26.097133,
            latitude = 44.446165
        },
        zoom_level = 12
    };
ichim commented 10 months ago

Hello sir, I gave up to developing the Map control. Early in development I made a C# - JavaScript interoperability mistake that cannot be corrected. Because of this we had many interoperability calls. Instead, the RealTimeMap control is optimized to make as few C# JavaScript calls and requests as possible. RealTimeMap is in development, but it wants to be a kind of component for IoT (possible to integrate with Arduino or Raspberry Pi).

gokhangumul commented 10 months ago

I tried again on an empty project and got a faster result, so we can close this issue. Thank you very much for your answers.I'm going to try the real-time map.

ichim commented 10 months ago

Thanks a lot for using this package!