Google Maps API
Publush Google Maps in my site using API
The HTML file
<!DOCTYPE html>
<html>
<body>
<h1>My First Google Map</h1>
<div id="googleMap" style="width:100%;height:400px;"></div>
<script>
function myMap() {
var mapProp = {
center: new google.maps.LatLng(51.508742, -0.120850),
zoom: 15,
};
var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAnWvjCL8UdC7AwjKGz9bqy8-ac430jrk4&callback=myMap"></script>
</body>
</html>
Find my Google Maps API key
- Enter console.cloud.google.com-google-maps-api
- Press on "show key
- Then you see the key
- Place the "key" in the HTML code here
- To create credentials to access your enabled APIs (to allow API in a specific places, noy every where...) press on "API key1"
- then, limit API access only to a to websites and limit for a spesific websites
- In my site https://api.bone.co.il/