The best solution would depend on the following factors:
- The size and complexity of your data. If you are working with a couple thousand individual points, then it's fairly easy, but if you are working with a lot of points (more than a few MB in size) then you will likely find the data download to be big and slow loading and need a more optimized loading/rendering method.
- Frequency of updates to the map. 5 minutes in your case is fairly easy to achieve.
If you are working with a smaller set of data (< a few MB), a simple webservice that grabs and converts the data on the fly and sends the response to the client would work fine. You can poll this service on a timer from the client. You could setup a caching mechanism if you plan on having a lot of end users.
If you want to support higher frequency updates, then using something like SignalR would be a good option. Here is an example that shows real time updates of flights on a map. https://davetheunissen.github.io/Real_Time_Flight_Map/
If you have large datasets (tens of MB or more), you will need to optimize the data for rendering. A common method used is to only load the data needed for the users viewport (area they are looking at on the map). This can be achieved in a couple of ways:
- Create a webservice that takes in a bounding box and query all data within that bounding box. Get the map's bounding box view. Query every time the user moves the map. This is an OK solution for lower used apps, but not as optimized as it could be.
- Break the data into tiles and load them in that way. Azure Maps supports both vector and raster tiles. Vector tiles are a newer format that is now widely being adopted. They are small and easy to load into the map, however, creating them can be a bit complex if you are new to it. Vector tiles can be generated on the fly as needed quickly, are easily cached, and can support crazy large data sets (Azure Maps serves all the base map road data globally in this format). Also, if you set an expires header on the tiles (say 5 minutes), the Azure Maps web SDK will automatically request new data when the tile expires. Here is some more information on vector tiles:
https://learn.microsoft.com/en-us/azure/azure-maps/create-data-source-web-sdk#vector-tile-source http://richorama.github.io/2019/02/05/roll-your-own-vector-tile-service/