Custom Fields
Re-Envisioned
Support MB Frontend Submission Map field don't work in front office

This topic contains 4 replies, has 2 voices, and was last updated by  proyectohappyweb@gmail.com 4 months, 4 weeks ago.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #14235

    Anh Tran
    Keymaster

    Hi Sergo,

    Please check the browser dev console to see if there’s any message from Google Maps API. Usually, Google will tell you exactly why.

    Also check the page source to see if the API key is correct. Maybe other plugins enqueue a different JS file using different a API key.

    #14241

    Thanks,

    Whith the console web appears some errors:

    https://my.pcloud.com/publink/show?code=XZ3tmO7Zc35RjPUs2bzsgL0sfU9CekJlBfKy

    JQMIGRATE: Migrate is installed, version 1.4.1 jquery-migrate.min.js:2:542
    TypeError: google.maps.places is undefined[Saber más] mb-geo.js:67:4
    You have exceeded your request quota for this API. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors
    js:51:110
    Google Maps JavaScript API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys util.js:221:12

    And the source code is this:

    <a href="https://maps.google.com/maps/api/js?v=quarterly&#038;scu_version=21">https://maps.google.com/maps/api/js?v=quarterly&#038;scu_version=21</a>

    But the metabox is the same configuration:

           // GOOGLE MAPS 
        $meta_boxes[] = array (
            'id' => 'location',
            'title' => 'Mapa',
            'post_types' => 'local', //array( 'local' , 'negocio' ), //$post_types,
            'context' => 'after_title',
            'style'   => 'seamless',
            'priority' => 'high',
            // 'geo' => true,
            // Return only cities and business results
            'geo' => array(
                    'types' => array( 'establishment' )
            ),
                    'storage_type' => 'custom_table',    // Important
                    'table'        => 'locales', // Your custom table name
            'fields' => array(
                // Address field.
    ...
    ...
                array(
                    'id'            => 'mb_mapa_map',
                    'name'          => 'Mapa',
                    'type'          => 'map',
                    //'language'      => 'es',
                    // Default location: 'latitude,longitude[,zoom]' (zoom is optional)
                    // 'std'           => '-6.233406,-35.049906,15',
                    // Address field ID
                    'address_field' => 'address_location',
                    //'geo' => true,
                    'api_key'       => 'AIzaSyCjqt3G7n6brVxxxxxxxxx',
                ),

    Don’t understand why in the backoffice run and in the front office not… I’m doing anything wrong?

    Thanks,
    Sergio

    #14242

    Anh Tran
    Keymaster

    Hi Sergio,

    I guess you’re using another plugin that also enqueues Google Maps. The URL above is different from what Meta Box outputs. If that’s correct, it’s easy to explain 2 errors in the console: the API key is not provided and the limit exceeds.

    #14244

    Oh perfect!!

    I had another plugin installed;
    https://es.wordpress.org/plugins/wp-flexible-map/

    I desactivated this plugin and now it run perfect!!

    Many thanks for your tips!!!!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.