Blame view

controllets/providers-utility-controllet/openDataSoft.js 707 Bytes
89558a41   Renato De Donato   datatype, provide...
1
  function openDataSoft_Provider () {}
9fd4ca8a   Renato De Donato   new data table
2
  
89558a41   Renato De Donato   datatype, provide...
3
4
  openDataSoft_Provider.prototype.selectData = function(data) {
      var selectedData = [];
706288a2   Renato De Donato   geojson incoming
5
6
7
      for(var i=0; i<data.records.length; i++) {
          if(data.records[i].geometry)
              data.records[i].fields["geometry"] = data.records[i].geometry;
89558a41   Renato De Donato   datatype, provide...
8
          selectedData.push(data.records[i].fields);
706288a2   Renato De Donato   geojson incoming
9
      }
89558a41   Renato De Donato   datatype, provide...
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
      return selectedData;
  };
  
  openDataSoft_Provider.prototype.addLimit = function(url) {
      if(url.indexOf("&rows=") > -1)
          return url;
      return url + "&rows=10000";
  };
  
  //openDataSoft_Provider.prototype.getFields = function(data) {
  //    var fields = [];
  //    for (var key in data.records[0].fields)
  //        fields.push(key);
  //    return fields;
  //};