Search code examples
google-mapsgoogle-maps-api-3google-maps-markersgoogle-maps-api-2

Adding google maps to webpage


I want to create one webpage with one textbox, one button and one div containing the google map. My use case is whenever I enter some address in textbox and click on the button the google map for that place should get rendered in that div. Can anybody please help?


Solution

  • You want to use the Google Maps API: https://developers.google.com/maps/documentation/javascript/

    and either the geocoding service: https://developers.google.com/maps/documentation/javascript/geocoding

    or autocomplete: https://developers.google.com/maps/documentation/javascript/places#places_autocomplete

    The samples linked there should give you plenty of code to draw on.