In the present paper, we theoretically study the transient electroosmotic flow of general Maxwell fluids through the polyelectrolyte grafted nanochannel with a layered distribution of charges. By applying the method of Laplace transform, we semi-analytically obtain the transient electroosmotic flow from the Cauchy momentum equation and the Maxwell constitutive equation. For the nanochannels grafted with polyelectrolyte layers having different layered distributions of charges, we consider the influence of the dimensionless relaxation time, the dimensionless polyelectrolyte layer thickness, and the dimensionless drag coefficient on the transient electroosmotic flow. We present the results for some particular cases. First, we unravel that for the case of polyzwitterionic brush that the sum of positive and negative structural charges is zero, the total electroosmotic flow is non-zero. In particular, depending on charge distribution within the end part of polyelectrolyte layers, the direction of the electroosmotic flow can be reversed critically. Second, in order to quantitatively evaluate a reversal of electroosmotic flow for two polyelectrolyte layers of opposite signs, we introduce a critical number ks as the ratio between the layered charge densities of two polyelectrolyte layers. Increasing ks allows the electroosmotic flow to be reversed easily. We verify that adjusting charge distributions of the layer can intentionally control the direction of the flows as well as the strength of electroosmotic flow.