Google map implementation in Sightly | Community
Skip to main content
girishk14
May 28, 2018
Solved

Google map implementation in Sightly

  • May 28, 2018
  • 8 replies
  • 3497 views

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.
Best answer by smacdonald2008

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

arunpatidar
Community Advisor
Community Advisor
May 28, 2018

Hi,

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

Thanks

Arun Patidar

Arun Patidar
girishk14
girishk14Author
May 28, 2018

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.

arunpatidar
Community Advisor
Community Advisor
May 28, 2018

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

Arun Patidar
girishk14
girishk14Author
May 28, 2018

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

arunpatidar
Community Advisor
Community Advisor
May 28, 2018

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

Arun Patidar
girishk14
girishk14Author
May 28, 2018

We will try thanks for your quick response.

smacdonald2008
smacdonald2008Accepted solution
May 28, 2018

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…

girishk14
girishk14Author
May 29, 2018

Thanks Scott ,It was helpful