Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections #174 #24

Merged
merged 3 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1695,12 +1695,12 @@ <h5 class="modal-title" i18n="modal.layer.new.searchdata">Ajouter une donnée</h
<div class="modal-body">
<ul class="nav nav-pills mb-4" id="pills-tab-layers" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" data-bs-toggle="pill" data-bs-target="#newlayer-catalog" type="button" role="tab" aria-controls="pills-newlayer-catalog" aria-selected="true">
<a class="nav-link active" data-bs-toggle="pill" data-bs-target="#newlayer-catalog" type="button" role="tab" aria-controls="pills-newlayer-catalog" aria-selected="true" onclick="mv.resetConfLayer(); ">
<span i18n="modal.layer.new.catalog">Depuis un catalogue</span>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" data-bs-toggle="pill" data-bs-target="#newlayer-param" type="button" role="tab" aria-controls="pills-newlayer-param" aria-selected="false">
<a class="nav-link" data-bs-toggle="pill" data-bs-target="#newlayer-param" type="button" role="tab" aria-controls="pills-newlayer-param" aria-selected="false" onclick="mv.resetSearch();">
<span i18n="modal.layer.new.param">Via des paramètres</span>
</a>
</li>
Expand Down
28 changes: 18 additions & 10 deletions lib/mv.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ var mv = (function () {
} else {
$("#search-message").text("Aucun résultat pour cette recherche.");
}
},
},

getConfLayers: function () {
// CAS 2 : Ajout d'une couche via ces paramètres
Expand Down Expand Up @@ -411,14 +411,18 @@ var mv = (function () {
.attr("data-layerid", layerid)
.attr("data-title", layername)
.attr("visible", true)
.attr("tiled", true)
.attr("queryable", true)
.find(".layer-name").text(layername);
var layer = {
"id": layerid,
"title": layername,
"name": layername,
"type": layertype,
"url": layerurl,
"visible": true
"visible": true,
"tiled": true,
"queryable": true
};

// Paramètres supplémentaires si Vector-TMS
Expand All @@ -434,14 +438,7 @@ var mv = (function () {
$("#mod-layerNew").modal('hide');
$("#mod-themeOptions").modal('show');

// Reset input
document.getElementById('newlayer-type').value = '';
[...document.querySelectorAll(".param-type")].forEach(e => e.classList.add("d-none"));
[...document.querySelectorAll("#commonParamType >div")].forEach(e => e.classList.add("d-none"));
[...newLayerByParam.querySelectorAll("input")].forEach(function(x){
x.value = "";
x.classList.remove("is-invalid");
});
mv.resetConfLayer();
return
}
// CAS 1 : Ajout d'une couche via un catalogue
Expand Down Expand Up @@ -491,6 +488,17 @@ var mv = (function () {
$("#mod-themeOptions").modal('show');
//remove selection from results
$(".ogc-result input[type='checkbox']:checked").prop("checked", false);
},

resetConfLayer: function () {
// Reset input
document.getElementById('newlayer-type').value = '';
[...document.querySelectorAll(".param-type")].forEach(e => e.classList.add("d-none"));
[...document.querySelectorAll("#commonParamType >div")].forEach(e => e.classList.add("d-none"));
[...newLayerByParam.querySelectorAll("input")].forEach(function(x){
x.value = "";
x.classList.remove("is-invalid");
});
},

resetSearch: function () {
Expand Down