This bug should be reproducible easily.

I have a map with several WMS layers, and "Permalink+ArgParser" behaviors
When you open a permalink which contains non-default layers, the default layer is retrieved just before the one contained in the link. You don't see the default layer because the map is waiting for the last request, but in a production environment this cause double load time when using argument parser due to WMS server rendering 2 layers.

I think this happens because behaviors are loaded after map is called. If argparser behavior is active in the map, the map default layer should be changed before rendering by parsing the GET parameters.

Comments

FeBus982’s picture

I have used hook_openlayers_map_preprocess_alter() to parse $_GET variable, and using values to setup default_layer, zoom and center.

It's a little better but the client does double request of layers.

Anyway now the map appears on first request, so the final user don't see this bug ;)

It seems that Permalink behavior does argument parsing and layer switching even with ArgParse disabled. This is a bug from OL library,

Anyway i think this kind of parsing should be moved from behaviors to the phase where map is created.