Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanocudini committed Nov 28, 2016
1 parent abd18aa commit 82045e9
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/leaflet-search.js
Expand Up @@ -32,6 +32,27 @@
return Object.prototype.toString.call(obj) === "[object Object]";
}

//TODO implement can do research on multiple sources layers and remote
//TODO history: false, //show latest searches in tooltip
//FIXME option condition problem {autoCollapse: true, markerLocation: true} not show location
//FIXME option condition problem {autoCollapse: false }
//
//TODO here insert function that search inputText FIRST in _recordsCache keys and if not find results..
// run one of callbacks search(sourceData,jsonpUrl or options.layer) and run this.showTooltip
//
//TODO change structure of _recordsCache
// like this: _recordsCache = {"text-key1": {loc:[lat,lng], ..other attributes.. }, {"text-key2": {loc:[lat,lng]}...}, ...}
// in this mode every record can have a free structure of attributes, only 'loc' is required
//TODO important optimization!!! always append data in this._recordsCache
// now _recordsCache content is emptied and replaced with new data founded
// always appending data on _recordsCache give the possibility of caching ajax, jsonp and layersearch!
//
//TODO here insert function that search inputText FIRST in _recordsCache keys and if not find results..
// run one of callbacks search(sourceData,jsonpUrl or options.layer) and run this.showTooltip
//
//TODO change structure of _recordsCache
// like this: _recordsCache = {"text-key1": {loc:[lat,lng], ..other attributes.. }, {"text-key2": {loc:[lat,lng]}...}, ...}
// in this way every record can have a free structure of attributes, only 'loc' is required

L.Control.Search = L.Control.extend({
includes: L.Mixin.Events,
Expand Down Expand Up @@ -90,19 +111,8 @@ L.Control.Search = L.Control.extend({
fill: false
}
}
//TODO implement can do research on multiple sources layers and remote
//TODO history: false, //show latest searches in tooltip
},
//FIXME option condition problem {autoCollapse: true, markerLocation: true} not show location
//FIXME option condition problem {autoCollapse: false }
//
//TODO here insert function that search inputText FIRST in _recordsCache keys and if not find results..
// run one of callbacks search(sourceData,jsonpUrl or options.layer) and run this.showTooltip
//
//TODO change structure of _recordsCache
// like this: _recordsCache = {"text-key1": {loc:[lat,lng], ..other attributes.. }, {"text-key2": {loc:[lat,lng]}...}, ...}
// in this mode every record can have a free structure of attributes, only 'loc' is required


initialize: function(options) {
L.Util.setOptions(this, options || {});
this._inputMinSize = this.options.textPlaceholder ? this.options.textPlaceholder.length : 10;
Expand Down Expand Up @@ -257,7 +267,7 @@ L.Control.Search = L.Control.extend({
return this;
},

////start DOM creations
////start DOM creations
_createAlert: function(className) {
var alert = L.DomUtil.create('div', className, this._container);
alert.style.display = 'none';
Expand Down Expand Up @@ -379,7 +389,7 @@ L.Control.Search = L.Control.extend({
return tip;
},

//////end DOM creations
//////end DOM creations

_getUrl: function(text) {
return (typeof this.options.url === 'function') ? this.options.url(text) : this.options.url;
Expand Down Expand Up @@ -689,17 +699,7 @@ L.Control.Search = L.Control.extend({
},

_fillRecordsCache: function() {
//TODO important optimization!!! always append data in this._recordsCache
// now _recordsCache content is emptied and replaced with new data founded
// always appending data on _recordsCache give the possibility of caching ajax, jsonp and layersearch!
//
//TODO here insert function that search inputText FIRST in _recordsCache keys and if not find results..
// run one of callbacks search(sourceData,jsonpUrl or options.layer) and run this.showTooltip
//
//TODO change structure of _recordsCache
// like this: _recordsCache = {"text-key1": {loc:[lat,lng], ..other attributes.. }, {"text-key2": {loc:[lat,lng]}...}, ...}
// in this way every record can have a free structure of attributes, only 'loc' is required


var inputText = this._input.value,
that = this, records;

Expand Down

0 comments on commit 82045e9

Please sign in to comment.