Implement MapData and TileLayer using observer pattern so that the latter will be notified when the former changed.