added functions in php, js addLayer()