Skip to content

Commit

Permalink
Only fetch subsequent pages if features exist on this page
Browse files Browse the repository at this point in the history
  • Loading branch information
batpad authored Dec 4, 2023
1 parent 7662159 commit 4012639
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/chennai.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ function getDataSet(startID) {
});
features.features = data.features;

var lastFeatureID = data.features[data.features.length - 1].id;
getDataSet(lastFeatureID);
if (data.features.length > 0) {
var lastFeatureID = data.features[data.features.length - 1].id;
getDataSet(lastFeatureID);
}

SELECTED_ROADS_SOURCE.setData(features);

Expand Down

0 comments on commit 4012639

Please sign in to comment.