Completed porting from PJ. php to js. OL2 to Leaflet