4

Attempting to fiddle with Lightning Components I ran into Lightning's super restrictive static resources limits.

Any attempt to load the Google Maps API fails with the following error:

Refused to load the script 'https://maps.gstatic.com/maps-api-v3/api/js/21/9a/visualization.js' because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension: 'unsafe-eval' 'unsafe-inline' https://ssl.gstatic.com/accessibility/".'

After doing some of my own research, it appears no matter what you do, Lightning will not let you load any external JS libraries.

Has anyone else run into this issue and been able to overcome it?

1

2 Answers 2

1

Google maps (or any library that loads its dependencies similarly) is currently not supported inside of lightning

1
  • 1
    Have you tried using <ltng:require> to load your external JS libraries? See this doc for details. Aug 18, 2015 at 0:36
0

Good news! lightning:map component is present in Winter19 release plan which is using Google Maps: http://releasenotes.docs.salesforce.com/en-us/winter19/release-notes/rn_lc_components.htm

Cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.