Google map implementation in Sightly | Community
Skip to main content
girishk14
Level 2
May 28, 2018 5:02 PM UTC
Solved

Google map implementation in Sightly

Hi All,

I am implementing the Google map component in aem 6.3 ,The plain HTML code is working as expected, when I added the HTML in sightly and js in clientlibs the <sciprt> tag throws an error in js console, . Uncaught type error <   in js .

      Is their any other way to implement the Google map component in Sightly , any docs or links would be helpful

Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
May 28, 2018 6:25 PM UTC

You can use any JS/JQuery/Bootstrap lib in a HTL component. BTW - its not called Sightly. This is very straightforward. See this example -- Adobe Experience Manager Help | Creating an Adobe Experience Manager HTML Template Language component that uses JavaScri…

8 replies

girishk14
girishk14Author
Level 2
May 29, 2018 5:07 AM UTC

Thanks Scott ,It was helpful

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
May 28, 2018 6:25 PM UTC

You can use any JS/JQuery/Bootstrap lib in a HTL component. BTW - its not called Sightly. This is very straightforward. See this example -- Adobe Experience Manager Help | Creating an Adobe Experience Manager HTML Template Language component that uses JavaScri…

Translate
girishk14
girishk14Author
Level 2
May 28, 2018 6:02 PM UTC

We will try thanks for your quick response.

Translate
arunpatidar
New Participant
May 28, 2018 5:52 PM UTC

Without script tag , how would you add external Javascript.

though you can add external javascript from clientlibs using below:

$(document).ready(function(){
  $
('body').append($('<script src="/path/to/script/foo.min.js"></script>'));
});

OR

You can directly add <SCRIPT> tag in HTL

It is a simple javascript call, In your code there might be some syntax error.

Thanks

Arun

Translate
Arun Patidar
girishk14
girishk14Author
Level 2
May 28, 2018 5:45 PM UTC

Is there any other way to implement the map component without using script tag in js and sightly

Translate
arunpatidar
New Participant
May 28, 2018 5:42 PM UTC

where are you adding this SCRIPT tag? in .html page or in clientlibs?

Translate
Arun Patidar
girishk14
girishk14Author
Level 2
May 28, 2018 5:40 PM UTC

Hi Arun

I have to add the source url for Google map api

I.e  <script src=https://googlemapapi.com > to load the map which I was not able to add.

Translate
arunpatidar
New Participant
May 28, 2018 5:37 PM UTC

Hi,

you don't need to wrap your Javascript code in <script> tag, if you using clientLibs.

Thanks

Arun Patidar

Translate
Arun Patidar