Bit of an issue with Google Maps not showing dynamic markers properly

Not sure if this is a bug or not, however I have a google map with dynamic markers.
I would assume that the markers would just show, however it seems that it take 3 refreshes for them to show property.
Would anyone have any ideas about this?

url: https://sulunarmsanz.com.au/

What browser are you using and do you see errors in the browser console? I tested locally on Chrome and they appear after each page load/refresh.

The problem seems to be not ALL of them show up on the first load, for example the ones I am noticing are in the state of Victoria.
I’ve tried multiple browsers and it seems to be the same issue.
not getting any errors to do with the maps.

I’ll try on a different machine, give me a min.

That’s what i see after each refresh:

Ok that looks right, but I’ve just tested it on another machine here and I get:

Initial Load

First refresh:

Second Refresh:

As you can see they are all different.

Just also just tried it on my iPad through a mobile connection and I get the same problem, it take 3 refresh’s to make them all show

And do you see the data source loading properly with all the data?

the site loads a bit slower than other websites, but that’s because it’s hosted in Australia, but anyway everything loads fine on the map.

Yep all the data shows up but as you can see below not all the pins show up. There are 26 entries in the DB and all of them return, but not all of them show on first load.

Do you see any difference (new markers) if you paste this and hit enter in the browser console?

dmx.parse("dmx.app.data.content.maps1.refresh()")

or if you add a button on the page and add map refresh dynamic event on click?

get the error: ReferenceError: Can’t find variable: dmx
when I add the to the console

Are you sure you are entering exactly this on this place and hit enter?

Screenshot 2021-12-16 at 9.04.21

If you are not sure how to do this then please try:

question could it be because the video is quite large that this could be causing a delay on it?

Just managed to confirm this issue, not all markers appeared on first page load.

This line is logged on console:
googleMaps.js:597: “Geocode was not successful for the following reason: OVER_QUERY_LIMIT”

First page load had like 16 lines of these (and less markers), 2nd refresh had like 4 lines (and more markers). May be the cause for the markers not appearing

Edit: Also, doing the line Teodor posted did nothing for the markers

Aha! So that is the issue then. That is why i asked @gunnery to check for errors in the console.
The error is pretty much self explanatory. Too many geocode queries are made and in Google Maps API there is a quota, its not unlimited use.
Google API throws a OVER_QUERY_LIMIT exception after sending more than 10 geocoding requests in a loop.

I'd suggest converting your addresses to geo-coordinates (lat/lon) to fix this problem.

The question is why then it works for me and i see no errors? :slight_smile:

Just seen that, must of missed that error, any suggestions for creating the lat/lon easily ?

You could go on Google Maps and type each location, and then look at Google Maps’ URL and there you can find coordinates :slight_smile:

https://www.google.com/maps/place/Karratha+Shooting+Supplies/@-20.7681393,116.8329313,13z/(…)

(almost sure those are coordinates)

Limit is 100 requests per second (QPS), per user. The costs are 5.00 USD per 1000. So with 25 addresses it costs 5.00 USD per 40 page views.

There was a time it was all free, now it became really expensive if you don’t watch out. So it is always a good idea to use the lat/lon coordinates.

2 Likes