Slow function in Zoom in and Zoom out on map

Hi Mr Christopher,

Please note that i integrated openchargemap to my app but unfortunately the function to zoom in and zoom out is so slowly?

Can I know the reason why ?! Or if there is other API code to resolve this issue ? Please advice ?!.



Hi Amer,

You’d need to share a link to your app to diagnose that but things to watch for:

  • Don’t try to query our API until your map has stopped moving, otherwise you could be trying to make many requests per second
  • Limit your search to the bounding rectangle of the map view
  • Don’t wait for our results before rendering your map, render the map first, then wait for our API to return the matching results and render those as required. A typical query takes about half a second, but you need to allow time for the data to be transferred over your internet connection
  • Consider using the API option for minimal data transfer: compact=true with remove reference data (such as connection type objects) and you can repopulate that in your app based on reference IDs, and verbose=false which will remove data field entries which are null from the results set. These options make the data transferred much smaller but require you to do more work in your app.