1

I have a Smart Map setup and installed it on a site.

The section averages 300 page views per day according to Google Analytics, but Google API is maxing out the 2500 requests on the free plan. I've bumped up to a paid plan, but does anyone know why there are so many requests?

  • Is this for Craft 2 or Craft 3? Which version of Smart Map are you running? – Lindsey D Feb 23 '18 at 16:21
  • I'm on Craft 2, Smart Map 2.4.0. Thanks! – jeremyhoover Feb 24 '18 at 22:32
  • Sounds like @SamC nailed it. I’ve also seen some recent indications that Google has adjusted how they are counting API calls, so that may be relevant as well. – Lindsey D Feb 26 '18 at 5:24
2

Drawing the map is multiple API calls. And interacting with the map uses additional API calls.

I opened the Inspector (in Firefox here), and you can see a ton of calls to maps.google.com - see all the file calls vt?pb... - each one is a block of the map background.

enter image description here

And then, as you drag the map around, zoom, etc, it's making additional calls to get the portions of the map it doesn't have. And you can see them pop-up in the inspector.

So, a bunch of calls to draw the map, and more as you change your view of the map.

You could try the static image map {{ craft.smartMap.img(locations, options) }} instead of the standard {{ craft.smartMap.map(locations, options) }}

Alternative ideas, disable 'zoomable' and/or 'scrollable' in your map settings (more about those options here) - less interaction = less api calls.

The static map loads a lot less API resources, but takes a longer to generate (and just isn't as good).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.