Getting a handle on the Google Map object for an autocomplete form (jQuery)

By: Rob LeVine | Asked: 07/31/2023
ForumsCategory: How-toGetting a handle on the Google Map object for an autocomplete form (jQuery)
Rob LeVineRob LeVine asked 9 months ago
Using jQuery, I would like to get access to the Google map object of the Google map created by the Formidable Geolocation Addon by using the "Show Map" option on the autocomplete address field. I've pored over the frm-google-geo.js code and can't find a way to get that object. I need to get the object to set a click listener on it. It's not sufficient to just use a selector to get the div that the map sits in, I have to get the Map object itself. I reached out to S11 support and though I disagree with their argument that it's custom code, in the end, they're not going to help.

The only alternative I see is to turn off the "Show Map" option and write jQuery code to create the map.

1 Answers
Victor Font answered 9 months ago
The map is created in the JavaScript FrmGeoShowEntryMap function. The map object is scoped to that function, so it will require custom code. If you look at FrmGeoAppController.php at line 447, you can see the code.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community