Google Maps API error “MissingKeyMapError” in PrestaShop

September 8, 2016 Alex Simonchik Prestashop
Google Maps API error “MissingKeyMapError” in PrestaShop

In case you are using Google Maps API on a localhost or your domain was not active prior to June 22nd, 2016, you’ll need to use the API Key for sending requests. Otherwise, you’ll get a gray error message instead of the map rendering. To fix this problem, please see the Google Maps APIs documentation to get a key and add it to your application.

How to fix Google Maps API error 'MissingKeyMapError' in PrestaShop

If you are facing with the above error, instead of a Google Maps render block, or you see these warning messages in the debug console:
How to fix Google Maps API error "MissingKeyMapError" in PrestaShop

Then you should take care of conforming to new requirements for Google Maps use.

If you have any troubles with getting a key, then you can take a look at the detailed instruction.

At the same time, we will show, what you should do, to make Google Maps work with PrestaShop correctly. Here is the list of files that should be updated.

Following to the Google requirements, your queries should look like:

Please note, that we are adding the &key=YOUR_API_KEY string. Eventually, we have to make the following corrections:

controllers/admin/AdminOrdersController.php
original:

and with the update:

controllers/front/StoresController.php
original:

should be:

themes/default-bootstrap/js/stores.js
original:

with the fix:

administration/themes/default/template/controllers/orders/helpers/view/view.tpl
original:

updated:

That’s it! Hope this helps. If you still have any problems our technical support is happy to solve them.



13 comments

  1. Спасибо ВАМ ОГРОМНОЕ !!! Все заработало !!!! СПАСИБО !!!!

  2. I followed your instructions too and still have the same error… How can i do to fix it ? Thanks

  3. Thanks man !

    Worked for me, but be carefull guys, there is a mistake @ “controllers/front/StoresController.php”, replace “&amp” by “&”

    Cheers.

  4. @JS, The current URL loading the Google Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key on the Google API Console.

    See API keys in the Google API Console. For more information, see Best practices for securely using API keys.

  5. Errors
    js?sensor=true:94 You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
    Ug @ js?sensor=true:94
    (anonymous) @ js?sensor=true:127
    google.maps.Load @ js?sensor=true:18
    (anonymous) @ js?sensor=true:127
    (anonymous) @ js?sensor=true:128
    js?sensor=true:34Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error
    _.kb @ js?sensor=true:34
    (anonymous) @ common.js:50
    (anonymous) @ common.js:203
    c @ common.js:44
    (anonymous) @ AuthenticationService.Authenticate?1shttps%3A%2F%2Fkultivator-tornado.by%2Fstores&callback=_xdc_._h…:1
    util.js:212 Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
    YA.j @ util.js:212
    (anonymous) @ js?sensor=true:127
    (anonymous) @ js?sensor=true:46
    (anonymous) @ js?sensor=true:43
    (anonymous) @ js?sensor=true:46
    _.F @ js?sensor=true:45
    (anonymous) @ js?sensor=true:46
    _.v @ js?sensor=true:31
    lc @ js?sensor=true:46
    (anonymous) @ js?sensor=true:127
    util.js:212 Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required
    YA.j @ util.js:212
    (anonymous) @ js?sensor=true:127
    (anonymous) @ js?sensor=true:46
    (anonymous) @ js?sensor=true:43
    (anonymous) @ js?sensor=true:46
    _.F @ js?sensor=true:45
    (anonymous) @ js?sensor=true:46
    _.v @ js?sensor=true:31
    lc @ js?sensor=true:46
    (anonymous) @ js?sensor=true:127

  6. Hello, how would I implement the api into Magento 1.9.2? I have a google map that shows up with your error and don’t know how to fix it. I was hoping that I could just add the api script in Magento, but I am not sure where or even if it’s possible. Thank you for a great post.

Post a new comment

top