jmelosegui / GooglemapMvc

The control wraps Google maps API simplifying the use of Google maps in ASP.NET MVC applications.
MIT License
117 stars 61 forks source link

trailing dots realtime and caching map layer high performance #125

Closed winecraft closed 2 years ago

winecraft commented 7 years ago

Hi @jmelosegui I saw recent hurricane matthew and wanted to do site with your lib, showing moving hirriance with trailing dots or path.

I was able to do signalr hub push updates, but when I try to show map with hirrance moving with icons, the web app froze. I try to do small lines, but it looks like strange polygon

Can you guide

Please share some of your thoughts, and which object to modify to cache the map, so I can only update icons. or am I doing the calls wrong 😨

Thanks Vino

jmelosegui commented 7 years ago

In order to do real-time updates on your map, you should, ideally, have the server code push content to client code, rather than having the server wait for a client to request data. Singnalr sounds like a good option in that scenario.

Now, if you think about the way this control is built, you should have noticed that once the view is rendered the job of this control is done. All you can do from javascript is get a reference to the map object and use a client side library to pull new data from the server or, as you suggested, use a server to client remote procedure calls that call JavaScript functions in client browsers (in Microsoft world Signalr). That function could then use the map object to, for instance, update the markers collection or anything allowed by Google Map APIs. But that is (IMO) out of the scope of this project.

Anyway if you can share a simple project (maybe here on Github) reproducing your scenario, I could try to help and in the process learn to use SignalR and maybe we can come up with a helper to address real-time scenarios over the map using this control (that would be awesome!!!).

jmelosegui commented 7 years ago

Related with #118

jmelosegui commented 2 years ago

feel free to reopen this if it is still relevant for you