Skip to content

Commit

Permalink
Extendable map parameters for redirection after authentication
Browse files Browse the repository at this point in the history
Funded by [SDEC énergie](https://www.sdec-energie.fr/)
  • Loading branch information
rldhont authored and github-actions[bot] committed Dec 5, 2023
1 parent eb67edb commit de28a07
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions lizmap/modules/view/controllers/map.classic.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,22 @@ public function index()
'project' => $project,
);
// other map params
if ($this->param('layers')) {
$url_params['layers'] = $this->param('layers');
}
if ($this->param('bbox')) {
$url_params['bbox'] = $this->param('bbox');
}
if ($this->param('crs')) {
$url_params['crs'] = $this->param('crs');
}
if ($this->param('filter')) {
$url_params['filter'] = $this->param('filter');
}
if ($this->param('layerStyles')) {
$url_params['layerStyles'] = $this->param('layerStyles');
}
if ($this->param('layerOpacities')) {
$url_params['layerOpacities'] = $this->param('layerOpacities');
$knownKeyParams = array(
'layers',
'bbox',
'crs',
'filter',
'layerStyles',
'layerOpacities',
);
// Get redirection parameters
$redirectKeyParams = jEvent::notify('getRedirectKeyParams', array('repository' => $repository, 'project' => $project))->getResponse();
$keyParams = array_unique(array_merge($knownKeyParams, $redirectKeyParams), SORT_REGULAR);
$params = $this->params();
foreach ($keyParams as $key) {
if (array_key_exists($key, $params)) {
$url_params[$key] = $params[$key];
}
}

if ($rep->getType() === 'html') {
Expand Down

0 comments on commit de28a07

Please sign in to comment.