user1186050 user1186050 - 11 days ago 5
HTML Question

How to reference google maps and google maps places on the same page

I need to use both google maps and google maps places on the same page.
The script tag for maps is

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
async defer></script>


and the script tag for places is

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script>


Do I need to use both these calls on my page or can I just remove the libraries=places part of the tag so that it works for both places and regular maps?

Answer

try

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap&libraries=places"
async defer></script>
Comments