How to update my map automatically when the data changes