Answers for "embed google maps"

2

get directions google maps html

//saddr = blank input field for entering START address
//daddr = hard-coded END address
//Enter an address and press button and a popup window opens with directions.
//Enter no address, and just a map of the END address opens.
//in angular add ngNoForm attribute in form tag and method as GET

<form action="http://maps.google.com/maps" method="get" target="_blank">
   <label for="saddr">Enter your location</label>
   <input type="text" name="saddr" />
   <input type="hidden" name="daddr" value="350 5th Ave New York, NY 10018 (Empire State Building)" />
   <input type="submit" value="Get directions" />
</form>
Posted by: Guest on January-02-2021
0

import google maps libraries html

You will need to generate an API key or leave blank during development

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

Get a key following this intructions:
https://developers.google.com/maps/documentation/javascript/get-api-key

Quick link to Google Cloud Platform Console:
https://console.cloud.google.com/
Posted by: Guest on November-25-2020

Browse Popular Code Answers by Language