Add miidWay fuction to maps.js