Modified map drag code