Custom Fields
Support Meta Box Geolocation Static Map Image (and/or watching for Geo changes)

  • Creator
  • #16784
    Resolved brandonjp

    I really love the Geo and Maps fields. There are a few places where showing the full interactive map is overkill, but we would still like to show the location on a map if the user selects/enters an address in the autocomplete field.

    Any suggestions on how to watch for a user to select a new address from the autocomplete? Like what js events the MB Map is using? -- Basically I'm wanting to mimic the behavior of the MB Google Map field, but only show a static image map instead of the full interactive map.

    I've tried watching for change events on the autocomplete address field and a number of other fields (like formatted_address etc) but change events don't seem to be recognized. And I've been reading through the Google Maps API docs, but getting a little lost. So far, I'm able to display a static image when a user is editing a post by using the previous address entry & a static map src such as: - But I'd like to refresh my image when the user selects a new address.

Viewing 1 replies (of 1 total)
  • Author
  • #16796

    This topic can be marked ✅Resolved

    I tracked down that I can watch the address input field for selected_address event:

    jQuery('input#address_job_site').on('selected_address', function(event) {
      // do stuff
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.