Expand my Community achievements bar.

SOLVED

How to add Google map in content fragment modal

Avatar

Level 1

Hi All,

 

There is a requirement where we need to add google map in content fragment modal so authors can search locations and google prompts suggestions by default and upon save of content fragment , it should save longitude, latitude and location name (whatever author has entered).

Below URL for google map reference which we need to integrate in CF modal.

 

developers.google.com/maps/documentation/javascript/examples/places-searchbox#try-sample

 

Kindly help me on this.

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @ashutoshs255199 ,

 

https://developers.google.com/maps/documentation/javascript/examples/places-searchbox#maps_places_se... 

the URL mentioned above has everything that you need (Typescript, JS, HTML, and CSS). All you need to do here is:

1. convert those into a component and add it to your content fragment modal.

2. On save of the modal (as per your requirement), capture the location details and 
3. trigger a servlet that saves the details in nodes or in any other data format.

Thank you.

Regards,
Sravan

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @ashutoshs255199 ,

 

https://developers.google.com/maps/documentation/javascript/examples/places-searchbox#maps_places_se... 

the URL mentioned above has everything that you need (Typescript, JS, HTML, and CSS). All you need to do here is:

1. convert those into a component and add it to your content fragment modal.

2. On save of the modal (as per your requirement), capture the location details and 
3. trigger a servlet that saves the details in nodes or in any other data format.

Thank you.

Regards,
Sravan