Skip to content

Commit

Permalink
Merge pull request #377 from IGNF/fix/param-resources-searchengine
Browse files Browse the repository at this point in the history
Correction du paramétrage des ressources à utiliser avec le SearchEngine (Ol + Leaflet)
  • Loading branch information
elias75015 authored May 28, 2024
2 parents 8098d52 + 223bf42 commit 01ba4d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Common/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var Utils = {
* @param {Boolean} replace - replace destination value by source if exists or not (true by default)
*/
mergeParams : function (dest, source, replace) {
if (!dest || !source) {
if (typeof dest === "undefined" || typeof source === "undefined") {
return;
}
if (typeof replace === "undefined") {
Expand Down
4 changes: 2 additions & 2 deletions src/OpenLayers/Controls/SearchEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ var SearchEngine = (function (Control) {
collapsed : true,
zoomTo : "",
resources : {
geocode : "",
geocode : [],
autocomplete : []
},
displayAdvancedSearch : true,
Expand All @@ -227,7 +227,7 @@ var SearchEngine = (function (Control) {
// merge with user options
Utils.mergeParams(this.options, options);
if (this.options.resources.geocode === "") {
this.options.resources.geocode = "address,poi";
this.options.resources.geocode = ["PositionOfInterest", "StreetAddress"];
}
if (this.options.resources.autocomplete.length === 0) {
this.options.resources.autocomplete = ["PositionOfInterest", "StreetAddress"];
Expand Down

0 comments on commit 01ba4d2

Please sign in to comment.