1
0
forked from MTSR/mapserver
mapserver/server/static/js/search/SearchStore.js

32 lines
471 B
JavaScript
Raw Normal View History

var SearchStore = {
2019-04-14 20:51:31 +03:00
query: "",
search: function(q){
this.query = q;
this.fetchData();
},
fetchData: debounce(function(){
console.log(this.query);
if (!this.query){
return;
}
api.getMapObjects({
pos1: { x:-2048, y:-2048, z:-2048 },
pos2: { x:2048, y:2048, z:2048 },
type: "shop"
})
.then(function(result){
console.log(result);
});
}, 400),
clear: function(){
this.query = "";
}
};