1

I'm new to Google Map API and after a lot of tutorials I have a question about performance. In my application, on startup, I need to retrieve several marker position from the server, which is written in nodejs. It can be 1, 2, 10, 100 or 150000 positions. These positions can be all over the world.

I know how to make some pagination in a basic web page with a tab but I don't think that it's relevant to get 150 000 positions in one time from the server. So I think I need some "Google Map API pagination" but i can't figure out how to do it in my case.

Do you have any idea?

Thanks you very much for your reply.

xavatic
  • 185
  • 1
  • 2
  • 10
  • Hello, I found the following information https://developers.google.com/maps/documentation/javascript/examples/place-search-pagination. I hope this help you. – Xepe Aug 16 '16 at 15:43

1 Answers1

0

The pagination parameter has a boolean property that verifies if result has nextpage or not

function processResults(results, status, pagination) {
  if (status !== google.maps.places.PlacesServiceStatus.OK) {
    return;
  } else {
    createMarkers(results);

    if (pagination.hasNextPage) {
      //logic to display next page button
      //method to call to get nextPage results
        pagination.nextPage();
      });
    }
  }
}

Check out these links Maps Documentation Similar Question

Community
  • 1
  • 1
Joshua Leigh
  • 340
  • 1
  • 3
  • 8