How to add Google map in content fragment modal | Community
Skip to main content
January 31, 2023
Solved

How to add Google map in content fragment modal

  • January 31, 2023
  • 1 reply
  • 638 views

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

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 B_Sravan

Hi @ashutoshs255199 ,

 

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

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

1 reply

B_Sravan
Community Advisor
B_SravanCommunity AdvisorAccepted solution
Community Advisor
January 31, 2023

Hi @ashutoshs255199 ,

 

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

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