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

GeoJson on Realtimemap #21

Closed condairteam closed 3 months ago

condairteam commented 8 months ago

Hi Sir!

Your package is so amazing so thank you for your hard work! Just a quick question. Is there a chance to use/import geojson data into Realtimemap instead/beside of regular MAP? Also i have noticed that on realtimemap there is no way to disable the zoomin function when i doubleclicking on the map. Could you help me out how to disable this behavior in an event?

Thank you Sir!

Alex

ichim commented 8 months ago

Hello sir,

Both functionalities will be available: disable zoom in as well as loading GeoJSON files.

RealTimeMap control is optimized to work with a large number of points whose position is updated in real time.

Thank you

condairteam commented 8 months ago

Thank you so much!

condairteam commented 7 months ago

Hi Sir! It's me again with just a quick one. Is there an option to change the name of layers and the color of the lines, polygons etc. on the map? So far everything is blue for me. (and maybe just for me, but there is a symbol in Bucharest that i can't remove it.)

Thank you for your hard work Sir! Alex image

ichim commented 7 months ago

Hello sir, I gave up on the development of the Map control because of a design mistake. It was hard to debug. I will look into the map control though.

ichim commented 7 months ago

To display the names of the layers in the Layer Control, you must set the property:

Map.LoadParameters parameters = new Map.LoadParameters()
{
    anyway_overlay_layers_control = true
}
condairteam commented 7 months ago

To display the names of the layers in the Layer Control, you must set the property:

Map.LoadParameters parameters = new Map.LoadParameters()
{
    anyway_overlay_layers_control = true
}

Yes I have already done that. i am trying to figure it out where that guid comes from.

condairteam commented 7 months ago

Hello sir, I gave up on the development of the Map control because of a design mistake. It was hard to debug. I will look into the map control though.

yes, it would be so much better if we can load geojson into RTM :)

ichim commented 7 months ago

I will try to do it as soon as possible, sir.

MichaelHochriegl commented 6 months ago

I'm currently evaluating some solutions for a work project I have where I have to render GeoJSON and pretty much only GeoJSON, so I don't have to render a "real" map, only a hodgepodge of points, lines and curved lines.

Is there a rough ETA on when GeoJSON drawing is available on the RTM? Or is there any help I can offer?

ichim commented 6 months ago

Hello sir,

Probably the next version of RealTimeMap will also have GeoJSON data loading

ichim commented 5 months ago

Hello sir,

The new version of the package, 2.0.6.4, provides DataFromGeoJSON. With this new class, you can add spatial data from GeoJSON file.

https://github.com/ichim/LeafletForBlazor-NuGet/tree/main/RTM%20and%20GeoJSON

condairteam commented 5 months ago

Hi Sir,

Thank you sir, awesome job! 👍

The LeafletForBlazor.RealTime.data.geojson.FromGeoJSON(string[] urls) function works only in webassembly mode, but doesnt in server-side rendering mode. There is no error, but the map is empty. Your sample is working fine, but that is webassembly. Could you look after why is that?

Thank you so much, Alex

ichim commented 5 months ago

Hello,

It must work!

Here is a similar case: https://github.com/ichim/LeafletForBlazor-NuGet/issues/32

condairteam commented 5 months ago

Hi, Yeah i know you're right, but my project's rendermode is InteractiveServer only and cant use webassembly (or InteractiveWebassembly), because of policy issues. Right now i am trying figure out, how i can make it works in Serverside mode. All of your previous codes are working as intended but the FromGeoJSON(string[] urls) function.

Apologies for the inconvenience and thanks advance all of your help , Alex

ichim commented 5 months ago

Sorry sir,

I think it is:

Geometric.DataFromGeoJSON.addFromFiles(new string[1]{"https://..."});

https://github.com/ichim/LeafletForBlazor-NuGet/blob/main/RTM%20and%20GeoJSON%2Fworking%20with%20Files%2FGeoJSON%20from%20file%2FGeoJSON%20from%20file%2FPages%2FHome.razor#L20

Missing addFromFiles method...

Laurentiu

ichim commented 5 months ago

New example code:

https://github.com/ichim/LeafletForBlazor-NuGet/tree/main/RTM%20and%20GeoJSON/config%20tooltip%20from%20file

and very short description:

https://github.com/ichim/LeafletForBlazor-NuGet/blob/main/RTM%20and%20GeoJSON/README.md

condairteam commented 5 months ago

It is working In webassembly, but isnt in serverside.

I think this code doesnt work in serverside mode in your FromGeoJSON class.

 public async Task addFromFiles(string[] urls)
    {
      HttpClient client = new HttpClient();
      string raw = "";
    ...
       raw = await client.GetStringAsync(url);   //this line doesnt fire in serverside mode, only in webassembly, therefore that is why the map is empty for me
     }

I think maybe you should use this

 public async Task addFromFiles(string[] urls)
    {
        using var httpClientHandler = new HttpClientHandler();
        httpClientHandler.ServerCertificateCustomValidationCallback =
            (_, _, _, _) => true;
        using var client = new HttpClient(httpClientHandler);
        raw = client.GetStringAsync(url).Result;
    ...
}

Thank you sir all of your work! 👍

ichim commented 5 months ago

Hello sir,

Thank you very much for what you told me!