Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there.

    Sorry for only getting back to you now.

    Unfortunately we don’t have any control over what the Google Maps API returns if the API key has not been entered.

    At the moment, you will need to enter an API key to make full use of the map. So sorry about that.

    Thread Starter Air.

    (@air-1)

    That is not what I am asking about.

    You know when API key was given, and you know that is now mandatory to use API key to use google maps. So couldn’t you just to not enqueue google scripts when you don’t have API key provided by user?

    Activating your plugin rises JavaScript error in certain circumstances now – that is not something that should be happening with plugin.

    Hi there

    I apologize for the confusion caused on my part.

    Please advise what sort of errors you are getting when activating our plugin?

    By not loading the Google Maps API on the page, that would cause a variety of additional JavaScript errors as Google Maps API functions would still be called.

    Thread Starter Air.

    (@air-1)

    I gave you error already, and scenario when it will happen.

    Like I said, problem is, that in certain conditions(mentioned above), plugin will cause JavaScript error, by loading library it uses.

    I thought that you could make such solution(for shortcodes, or places that asks your plugin for map):

    If there is API key provided – proceed as usual.

    If there is NO API key provided – don’t load anything external, don’t do anything fancy just display “Please provide map API key”.

    What problems do you see with such approach?

    If issues is with grandfathered maps, then you could add option to load API regardless of API key.

    I don’t know your plugin, I just thought it would be logic approach for current situation with google politics.

    With kind regards.

    Plugin Author NickDuncan

    (@nickduncan)

    Thanks Air
    Makes sense. I’ll add this to the road map and figure out how best we can move forward with this.

    Ultimately, what we would like to happen is to fall back to Open Street Maps as a fail-over when there is no API key. Additionally, OSM can be another option for users not wanting to go through the rigorous steps of getting an API key.

    Thank you for your suggestion!

    Thread Starter Air.

    (@air-1)

    Thanks for taking this in consideration.

    OSM approach feels like lot of additional work for this temporary situation, when people don’t know yet about need of API key. However it is very nice idea.

    Have a good day:-)

    Not a problem, Air. Thank you, and same to you ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘JavaScript Error when no API key is given’ is closed to new replies.