Place ID Finder

by Semih Muyaoğlu

HTML

<div id="map"></div>

<!-- Replace the value of the key parameter with your own API key. -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC3of1ok_Sn2A0jFbVrHCUTcrjRd8D1PFU&libraries=places&callback=initMap"
        async defer></script>

CSS

/* Always set the map height explicitly to define the size of the div
 * element that contains the map. */
#map {
  height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
.controls {
  background-color: #fff;
  border-radius: 2px;
  border: 1px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  font-family: Roboto;
  font-size: 15px;
  font-weight: 300;
  height: 29px;
  margin-left: 17px;
  margin-top: 10px;
  outline: none;
  padding: 0 11px 0 13px;
  text-overflow: ellipsis;
  width: 400px;
}

.controls:focus {
  border-color: #4d90fe;
}
.title {
  font-weight: bold;
}
#infowindow-content {
  display: none;
}
#map #infowindow-content {
  display: inline;
}

JavaScript

// This sample uses the Place Autocomplete widget to allow the user to search
// for and select a place. The sample then displays an info window containing
// the place ID and other information about the place that the user has
// selected.

// This example requires the Places library. Include the libraries=places
// parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">

function initMap() {
  var map = new google.maps.Map(document.getElementById('map'), {
    center: {lat: 38.438708, lng: 27.248679},
    zoom: 17
  });
  
  var adres = "Bornova";
  
  //console.log(map);
  
  
  var autocomplete = new google.maps.places.Autocomplete(adres);
  //autocomplete.bindTo('bounds', map);
  
  //autocomplete.bindTo('bounds', map);


   // infowindowContent.children['place-id'].textContent = place.place_id;
    
    //alert(place.geometry.location.lat());
    

  console.log(autocomplete);
  
  
  
}