Skip to content

Commit

Permalink
fix setLayer, pr 262
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanocudini committed Dec 1, 2020
1 parent 56ddb58 commit b3868be
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -2,4 +2,4 @@
packages/*
node_modules/*
npm-debug.log

package-lock.json
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -114,7 +114,7 @@ require(["leaflet", "leafletSearch"],function(L, LeafletSearch) {
Therefore the deployment require **npm** installed in your system.
```bash
npm install
grunt
npx grunt
```


Expand Down
22 changes: 12 additions & 10 deletions TODO
@@ -1,3 +1,5 @@
Tasks found in: src/leaflet-search-geocoder.js
[Line: 61] [low] //TODO refact resp data
Tasks found in: src/leaflet-search.js
[Line: 16] [low] //TODO implement can do research on multiple sources layers and remote
[Line: 17] [low] //TODO history: false, //show latest searches in tooltip
Expand All @@ -7,15 +9,15 @@ Tasks found in: src/leaflet-search.js
[Line: 31] [low] //TODO here insert function search inputText FIRST in _recordsCache keys and if not find results..
[Line: 34] [low] //TODO change structure of _recordsCache
[Line: 62] [low] //TODO implements uniq option 'sourceData' to recognizes source type: url,array,callback or layer
[Line: 423] [low] //TODO use .filter or .map
[Line: 487] [low] //TODO throw new Error("propertyName '"+propName+"' not found in JSON data");
[Line: 496] [low] //TODO add rnd param or randomize callback name! in recordsFromJsonp
[Line: 517] [low] //TODO add rnd param or randomize callback name! in recordsFromAjax
[Line: 621] [low] //TODO implements autype without selection(useful for mobile device)
[Line: 752] [low] //TODO _recordsFromLayer must return array of objects, formatted from _formatData
[Line: 773] [low] //TODO refact!
[Line: 963] [low] //TODO refact animate() more smooth! like this: http://goo.gl/DDlRs
[Line: 987] [low] //TODO use create event 'animateEnd' in L.Control.Search.Marker
[Line: 428] [low] //TODO use .filter or .map
[Line: 492] [low] //TODO throw new Error("propertyName '"+propName+"' not found in JSON data");
[Line: 501] [low] //TODO add rnd param or randomize callback name! in recordsFromJsonp
[Line: 522] [low] //TODO add rnd param or randomize callback name! in recordsFromAjax
[Line: 626] [low] //TODO implements autype without selection(useful for mobile device)
[Line: 757] [low] //TODO _recordsFromLayer must return array of objects, formatted from _formatData
[Line: 778] [low] //TODO refact!
[Line: 968] [low] //TODO refact animate() more smooth! like this: http://goo.gl/DDlRs
[Line: 992] [low] //TODO use create event 'animateEnd' in L.Control.Search.Marker
[Line: 18] [med] //FIXME option condition problem {autoCollapse: true, markerLocation: true} not show location
[Line: 19] [med] //FIXME option condition problem {autoCollapse: false }
[Line: 894] [med] //FIXME autoCollapse option hide self._markerSearch before visualized!!
[Line: 899] [med] //FIXME autoCollapse option hide self._markerSearch before visualized!!
4 changes: 2 additions & 2 deletions dist/leaflet-search.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions dist/leaflet-search.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/leaflet-search.mobile.min.css
@@ -1,7 +1,7 @@
/*
* Leaflet Control Search v2.9.7 - 2019-01-14
* Leaflet Control Search v2.9.9 - 2020-12-01
*
* Copyright 2019 Stefano Cudini
* Copyright 2020 Stefano Cudini
* stefano.cudini@gmail.com
* http://labs.easyblog.it/
*
Expand Down
4 changes: 2 additions & 2 deletions dist/leaflet-search.mobile.src.css
@@ -1,7 +1,7 @@
/*
* Leaflet Control Search v2.9.7 - 2019-01-14
* Leaflet Control Search v2.9.9 - 2020-12-01
*
* Copyright 2019 Stefano Cudini
* Copyright 2020 Stefano Cudini
* stefano.cudini@gmail.com
* http://labs.easyblog.it/
*
Expand Down
4 changes: 2 additions & 2 deletions dist/leaflet-search.src.css
@@ -1,7 +1,7 @@
/*
* Leaflet Control Search v2.9.7 - 2019-01-14
* Leaflet Control Search v2.9.9 - 2020-12-01
*
* Copyright 2019 Stefano Cudini
* Copyright 2020 Stefano Cudini
* stefano.cudini@gmail.com
* http://labs.easyblog.it/
*
Expand Down
14 changes: 7 additions & 7 deletions dist/leaflet-search.src.js
@@ -1,7 +1,7 @@
/*
* Leaflet Control Search v2.9.7 - 2019-01-14
* Leaflet Control Search v2.9.9 - 2020-12-01
*
* Copyright 2019 Stefano Cudini
* Copyright 2020 Stefano Cudini
* stefano.cudini@gmail.com
* http://labs.easyblog.it/
*
Expand Down Expand Up @@ -574,7 +574,7 @@ L.Control.Search = L.Control.extend({
}
else {
//throw new Error("propertyName '"+propName+"' not found in marker");
console.warn("propertyName '"+propName+"' not found in marker");

}
}
else if(layer instanceof L.Path || layer instanceof L.Polyline || layer instanceof L.Polygon)
Expand All @@ -593,7 +593,7 @@ L.Control.Search = L.Control.extend({
}
else {
//throw new Error("propertyName '"+propName+"' not found in shape");
console.warn("propertyName '"+propName+"' not found in shape");

}
}
else if(layer.hasOwnProperty('feature'))//GeoJSON
Expand All @@ -609,12 +609,12 @@ L.Control.Search = L.Control.extend({
loc.layer = layer;
retRecords[ layer.feature.properties[propName] ] = loc;
} else {
console.warn("Unknown type of Layer");

}
}
else {
//throw new Error("propertyName '"+propName+"' not found in feature");
console.warn("propertyName '"+propName+"' not found in feature");

}
}
else if(layer instanceof L.LayerGroup)
Expand Down Expand Up @@ -768,7 +768,7 @@ L.Control.Search = L.Control.extend({

L.DomUtil.addClass(this._container, 'search-load');

if(this.options.layer)

This comment has been minimized.

Copy link
@tassoman

tassoman Jan 26, 2021

Looks like a regression, see #266 and #265
Version v.2.9.8 (on the left) works flawless

This comment has been minimized.

Copy link
@stefanocudini

stefanocudini Aug 18, 2021

Author Owner

solved from vesion 3.0.0 many thanks @tassoman

if(this._layer)
{
//TODO _recordsFromLayer must return array of objects, formatted from _formatData
this._recordsCache = this._recordsFromLayer();
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "leaflet-search",
"version": "2.9.8",
"version": "2.9.9",
"description": "Leaflet Control for searching markers/features by attribute on map or remote searching in jsonp/ajax",
"repository": {
"type": "git",
Expand Down

0 comments on commit b3868be

Please sign in to comment.