Custom google map plugin?

Hi, i am trying to make a custom google maps plugin. Following are two problems i am facing.

  1. Google maps js script gets loaded multiple times.
  2. The Google maps js does not get loaded at all.

following are some snaps of my plugin showing how the script is being included and how the map is loaded.

I have also included the google maps api key in the general tab of my app as well.

Also is there a way to access the map object from the map element pre-installed in the app builder?