Hi
I know it's an older post but no valid answer has been made yet.
I guess you'll have to change your webpart as described in https://devnet.kentico.com/articles/google-maps-api-key
You could also create a custom settings module, and put the api key in the settings module.
You can then get your api key via macro. For example: {%Settings.GMapsApiKey|(identity)GlobalAdministrator%}