4 Replies Latest reply: Nov 3, 2014 9:07 AM by Erik Wetterberg RSS

    Automatically retrieve all data rows

    Luke Sartain

      Hi all

       

      I am currently putting together my first extension - a mapping extension that will draw a polyline from the latitude and longitude coordinates taken from a GPX file.   I'm using the leaflet JS library (http://leafletjs.com/) in order to do this.  I have hit a bit of a stumbling block due to the fact that the initial data fetch (qHeight) is limited to 1000 which will only plot part of the route - a 3 hour ride could result in up to 10800 points, for example.  I have this currently:

       

      return {

             initialProperties : {

             version: 1.0,

             qHyperCubeDef : {

             qDimensions : [],

             qMeasures : [],

             qInitialDataFetch : [{

                  qWidth : 2,

                  qHeight : 1000

             }]

        }

      },

       

      The values retrieved are then being added to a JavaScript array ready to plot using the following code:

       

      var dimensions = layout.qHyperCube.qDimensionsInfo,

           qData = layout.qHyperCube.qDataPages[0].qMatrix;

       

      var coords = [];

             $.each(qData, function(rownum, column){

                  coords.push(L.latLng(column[0].qText,column[1].qText));

      });

       

      A colleague has worked on an algorithm that will reduce the number of data points to be plotted (to speed up the visualisation by removing points when stopped at traffic lights, etc) once the selections are passed to the extension but, as before, I can't figure out how to get +1000 rows.  I notice that the SimpleTable example extension is using the backendApi.getData to get any additional 50 rows each time the more button is clicked so it certainly seems possible.

       

      So, would it be possible to automatically (without the user having to click a more button) retrieve all data points (latitude and longitude coordinates) to add to the JavaScript array ready for creating the polyline using the backendApi?  If so, any hints on how I could do so?

       

      My thanks in advance for any assistance - any input will be greatly appreciated.