up an new Algorithm about getGrid API

up an new Algorithm about getGrid API
add a new API to check the map size is able to put on any Grid