refactored js in to leaflet_lib.js