Map field don't work in front office

Support MB Frontend Submission Map field don't work in front officeResolved

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #14227
    proyectohappyweb@gmail.com[email protected]
    Participant

    Hello,

    I use the metabox
    'type' => 'map',
    and I get the api from google.

    In the back office it run well and I can search and get places:
    https://my.pcloud.com/publink/show?code=XZXB8O7ZK2W6kKdctnR4zEs7MN8tDFp1wKkX

    But in the fron office it doesn't work:
    https://my.pcloud.com/publink/show?code=XZpB8O7Z9c3uxoqUoOzeGB6JYt0cOuTSaQk7

    Do you have any idea?

    Thanks,
    Sergio

    #14235
    Anh TranAnh 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
    proyectohappyweb@gmail.com[email protected]
    Participant

    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 TranAnh 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
    proyectohappyweb@gmail.com[email protected]
    Participant

    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 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.