Closed MC-dragon closed 9 months ago
Actually, when you use Blazor Server then json should be passed to the browser when calling java interop. I have not tested this myself. And custom styles for geo json are not support yet, also no SLD files. Maybe we can introduce a callback via interop to set the style on demand. But in Blazor Server hosting mode, this would kill performance. So, to dynamically define the style, either the component can pass a complex style definition, which is not easy to implement or you adjust openlayer_interop.js for your needs. And sorry for the late respond, job, family, the usual suspects.
Thank you for your response and the insights you provided. I understand the challenges with Blazor Server and handling GeoJSON.
Regarding loading the JSON, just to clarify, is it possible to load the JSON data directly from a service or a generated string in memory rather than having to save it to a file and then retrieve it via HTTP? This approach would be more efficient for my application's use case.
As for custom styles and SLD files, I appreciate your thoughts on introducing a callback via interop for dynamic styling. However, I'm also concerned about potential performance issues in Blazor Server hosting mode. It seems like finding the right balance between flexibility and performance could be a key consideration.
I completely understand the delay in your response; life's responsibilities can indeed keep us busy. Thanks for taking the time to discuss this. Your insights are greatly appreciated.
Best regards, Mehme
I have verified the Blazor Server behavior and can confirm when calling map.LoadGeoJson server-sided, it will transport the data to the client. So no need to implement any loading on the client. Also, the method has a JsonElement as a parameter which can be constructed in memory.
Thanks for checking that out! It's great to know that Blazor Server can handle the data transfer to the client with map.LoadGeoJson. Being able to create a JsonElement in memory is a big help for me.
I'll dive into this a bit more to see how it fits my project. Your input is much appreciated!
Best, Mehmet
Hi , Great work ! You have an example on how to load a GeoJson layer on top of the Swiss map using a Json file or a URL to get the Json . I Have an application that generates the GeoJson layer in memory and I 'm using Blazor.Server , can we load these features without having to save to file and retrieving these using Http on to a background map of osm ? How to handle styles , is there an option to include an SLD file to the layer .
thanks in advance ! With kind regards, Mehmet