How To Prevent Google Maps From Using The Majority Of My Monthly Workload Units

My PWA has profiles for 20+ restaurants, some of which have multiple locations.

I set up Google Maps so a user can view all of the restaurants that are within 5 miles of their location.

This one feature is using up the majority of my monthly workload units and I’d like to keep the feature but it’s not working this way.

Does anyone have any tips/tricks to lower the workload unit impact when working with maps and a list of addresses?

These are my current settings:

On a side note, I’ll occasionally get an error saying my website doesn’t have access to the Geocode API. I haven’t detected a pattern or figured out why it stops working. I usually log into the Google Console look at the server and client APIs and then it’s fixed. I never actually do anything.

My billing information is also set up correctly. I saw this could cause an error as well.

If anyone has any ideas on how to get this to work constantly instead of intermittently, I would appreciate it!

The application restriction is set to websites and the API Restrictions are not restricted for both the server and client APIs

I wish I had time for such an interesting case.
Try to debug it step-by-step.
Look at how your data is returned from the server and how frequently it happens. Maybe your users make just a few swipes, and it results in over 100 requests.

Hey @Eugene_West,

I appreciate the response!

From my initial observations, it seems the reason it’s taking so many of my workload units is that I populate the map with the restaurant markers when the map is shown. - I think this is the best/only way to do this. I could possibly limit it to 10 addresses at a time, but I’m not 100% sure this is something I want to do yet.

I have my map set up so that when a marker is pressed on the map it shows the business name and the address in a small popup. The address can be pressed and this action takes the user to Google Maps which plans the route accordingly.

The problem is when the user leaves Google Maps and comes back to my app the map reloads all of the address markers. So, when one user is looking at restaurants near them and looking at where they are located they are potentially loading the map several times in one sitting.

For example, a user’s actions can look something like this:

  1. Open the map
  2. Choose Restaurant A
  3. Google Map Loads and they see it’s a bit further than they wanted
  4. Go back to the app
  5. The app reloads all of the address markers
  6. Choose Restaurant B
  7. And so on

If you have any recommendations or the time to respond, I’d really appreciate it!

Open in new window ?

This is the workflow that runs when a user presses the address on a map marker.

I believe the problem is when they come back from the Google Maps app on their phone because the map in my app is shown again which loads all of the map address markers.

Okay I have work to do now , but I am highly interested in this topic . I will come back and tell you things for you to test.Maybe by then someone would solve your problem.

I appreciate it and look forward to hearing from you!

This topic was automatically closed after 70 days. New replies are no longer allowed.