Google Maps - Dynamic Markers disappear on page refresh

I have some simple dynamic markers displayed on a page. If I refresh the browser then the markers disappear.

By opening a brand new browser window and reopening the page then all is OK until I refresh the page again when they again disappear.

This has to be a browser session started after closing the original window - if I just open on incognito window using the original windows then the markers are not displayed.

Any thoughts ?

Maybe you can explain a little more detailed how are your dynamic markers/data source set up and what are you doing on the page exactly?

Hi Teodor, my application has two pages. Page 1 displays a table of users. Each row of users has a anchor button that uses a dynamic attribute link together with a URL attribute - view_person_detail.php?id={{PersonID}}

Page 2 uses the URL parameter in a single record query. The results of the query are the address details of the user selected on page 1.

Page 2 has a Google map. It is using a dynamic attribute using the full address to center the map. It then has a marker using the full address to display (via a dynamic attribute & address) the default marker.

Page 2 displays correctly with the centered map and the marker. If the page is refreshed then the marker is no longer shown.

I can send you the page addresses if this would be helpful.

So you are not using sessions nowhere? I thought you were using sessions, based on your first post.

Can you send a link to this page so we can check this?

No sessions used this time - it is all with URL parameters.

https://cromarcc.org.uk/view_person.php

Use the record with surname = Ellis

I would not advice using addresses in google maps, Since 2018 they have a pay-as-you-go pricing plan and you have to page depending on the number of requests. It is better to just get the coordinates once and then store them in your database. The marker not appearing could be a rate limit from google since you do the same query multiple times in a short time.

More info at: https://developers.google.com/maps/documentation/javascript/geocoding

1 Like

Hi Patrick, yes that has solved the problem. I has tested with lat and long earlier so I already had a table setup but with only some coordinates.

I’ll plan to use the “map coordinated changed” option to capture updated coordinate when the pin is dragged to a more accurate location

Thanks for your help.