Enhance map updates and component performance
- Updated API documentation to clarify the initial data message structure for real-time tile updates. - Modified MapView component to load configuration and user data in parallel, improving map loading speed. - Implemented asynchronous loading for markers after the map is visible, enhancing user experience. - Introduced batching for tile updates to optimize rendering performance during map updates. - Refactored character and marker creation functions to utilize dynamic Leaflet imports, improving modularity.
This commit is contained in:
@@ -50,13 +50,13 @@ func (h *Handlers) WatchGridUpdates(rw http.ResponseWriter, req *http.Request) {
|
||||
c := h.Map.WatchTiles()
|
||||
mc := h.Map.WatchMerges()
|
||||
|
||||
tileCache := h.Map.GetAllTileCache(ctx)
|
||||
|
||||
// Option 1A: do not send full cache on connect; client requests tiles with cache=0 when missing.
|
||||
// This avoids a huge JSON dump and slow parse on connect when the DB has many tiles.
|
||||
tileCache := []services.TileCache{}
|
||||
raw, _ := json.Marshal(tileCache)
|
||||
fmt.Fprint(rw, "data: ")
|
||||
rw.Write(raw)
|
||||
fmt.Fprint(rw, "\n\n")
|
||||
tileCache = tileCache[:0]
|
||||
flusher.Flush()
|
||||
|
||||
ticker := time.NewTicker(app.SSETickInterval)
|
||||
|
||||
Reference in New Issue
Block a user