Results 1 to 7 of 7

Thread: Google Maps API error: MissingKeyMapError

  1. #1
    Sencha User
    Join Date
    Apr 2014
    Posts
    9
    Answers
    2
    Vote Rating
    0
      0  

    Default Answered: Google Maps API error: MissingKeyMapError

    Hello,

    I am getting this error in the console when using the map:

    "Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error"

    in my current project, I have added the map to one of the containers, and in resources there's a resource called "GoogleMapsAPI" with the url value: http://maps.google.com/maps/api/js?sensor=true

  2. I fixed it by simply adding a key to the url

  3. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506
    Vote Rating
    292
      0  

    Default

    Here's a thread that should help:
    https://www.sencha.com/forum/showthread.php?328469

    The bug in modern is being tracked as EXTJS-22725. Still unresolved at this time.

  4. #3
    Sencha User
    Join Date
    Apr 2014
    Posts
    9
    Answers
    2
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by Gary Schlosberg View Post
    Here's a thread that should help:
    https://www.sencha.com/forum/showthread.php?328469

    The bug in modern is being tracked as EXTJS-22725. Still unresolved at this time.
    unfortunately I am unable to access the link you sent => "[..]you do not have permission to access this page"

  5. #4
    Sencha User
    Join Date
    Apr 2014
    Posts
    9
    Answers
    2
    Vote Rating
    0
      0  

    Default

    I fixed it by simply adding a key to the url

  6. #5
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506
    Vote Rating
    292
      0  

    Default

    Oh, sorry, that thread is only visible to Support subscribers. It's a simple override which allows one to add the key to the URL, so it sounds like you created the same thing.

  7. #6
    Sencha User
    Join Date
    Jul 2017
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by qualtech View Post
    I fixed it by simply adding a key to the url
    Can you give an example?
    The views of provillus are good.

  8. #7
    Sencha Premium Member richardvd's Avatar
    Join Date
    Jun 2011
    Location
    NL
    Posts
    251
    Answers
    21
    Vote Rating
    70
      0  

    Default

    This is what I wrote in that other thread, hope it will help you:

    Quote Originally Posted by richardvd View Post
    The Google Maps API gets loaded by Ext.mixin.Mashup, and mixins happen first. So the override need to be done earlier and on the mixin instead of on the Map component.

    Code:
    Ext.define('Override.mixin.Mashup', {
        override: 'Ext.mixin.Mashup',
        
        onClassMixedIn: function (targetClass) {
            if (targetClass.$className === 'Ext.ux.google.Map') {
                targetClass.prototype.requiredScripts = [
                    '//maps.googleapis.com/maps/api/js?key=MY_APIKEY'
                ]
            }
            this.callParent([targetClass]);
        } 
    });
    Quote Originally Posted by richardvd View Post
    Under your project directory, there is an overrides folder. In that folder, create a file named Override.mixin.Mashup.js and paste the code in there. Replace MY_APIKEY by your own Google Maps API key.

    After dragging the Ext.Map component to your canvas in Sencha Architect, you may notice that the Google Maps API gets added as a resource. This is a bug, because as of Ext 6.2 (Modern) the Ext.Map component already loads the Google Maps API on its own. So you should delete the Google Maps API resource in the Project Inspector.

    If all is set up correctly you should not see any warnings in your browser's Javascript console while displaying a Google Map in your Modern app.

Similar Threads

  1. Google Maps Error
    By info@ferraresegroup.com in forum Sencha Architect 4.x: Bugs
    Replies: 10
    Last Post: 7 Jan 2017, 3:10 AM
  2. Replies: 2
    Last Post: 19 May 2014, 8:54 PM
  3. google.maps.MapTypeId Error with GMapPanel3
    By europe72 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 28 Sep 2011, 1:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •