Adapted to new map plugin api