Making the map update when a shape is drawn or edited