Maps API Callback error

Support MB Geolocation Maps API Callback error

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43514
    leebazCDSleebazCDS
    Participant

    I'm getting the following warning when using the Metabox Geolocation plug in and the MetaBox builder plug in.

    Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading

    I've tried using one input field called 'address', which works for known addresses but doesn't seem to support Lat/Long values.

    So I have two other fields: Lat and Lng and my Maps input has 'address, lat, lng' in the Address Field box.

    I have another instance of google maps running through <script>, however, I'm only loading the Google maps API conditionally when I'm on that page. And I don't see the same Google maps warning on that page. In that instance the callback is '&callback=initMap' at the end of the API key.

    How can I add the callback through the map field in the builder?

    #43515
    leebazCDSleebazCDS
    Participant

    I think I found the error, and it links to another issue that I found elsewhere to do with the maximum number of fields groups: when you exceed it the settings get lost, e.g Post_type reverts to 'post' from whatever else it was set to... and similarly the custom setting geo.api_key get's lost too!

    #43519
    PeterPeter
    Moderator

    Hello,

    Regarding the issue with maximum number of fields, please try to increase the PHP setting max_input_vars and see if it helps. Read more about the PHP setting in the documentation https://metabox.io/wordpress-custom-fields-not-saving-increase-max-input-vars/

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.