refactored onclick html function to OpenLayers en