Advertisement
multiarts

passToView

Mar 12th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. initMap(lat, lng) {
  2.     let mapOptions = {
  3.       center: { lat, lng },
  4.       zoom: 16,
  5.       mapTypeId: google.maps.MapTypeId.ROADMAP,
  6.       disableDefaultUI: true,
  7.       zoomControl: true,
  8.       scaleControl: true,
  9.     }
  10.    
  11.     this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
  12.  
  13.     let service = new google.maps.places.PlacesService(this.map);
  14.  
  15.     let infowindow = new google.maps.InfoWindow();
  16.  
  17.     service.getDetails({
  18.       placeId: this.placeId
  19.     }, (place, status) => {
  20.       this.callback(place, status);
  21.     });
  22.   }
  23. callback(place, status) {
  24.     if (status === google.maps.places.PlacesServiceStatus.OK) {
  25.       // this.createMarker(place)
  26.       let divinfo = document.getElementById("info");
  27.       let dados = '';
  28.  
  29.       dados += '<div style="color:red">';
  30.       dados += this.util.photo(place) + '<br />'
  31.       dados += '<strong>' + place.name + '</strong><br />';
  32.       dados += 'Endereço: ' + place.formatted_address + '<br />';
  33.       dados += 'Telefone: ' + place.formatted_phone_number + '<br />';
  34.       dados += 'Site: ' + place.website + '<br />';
  35.       dados += 'Rua: ' + place.address_components['0'].long_name + ', ' + place.address_components['1'].long_name + '<br />';
  36.       dados += 'Aberto: ' + this.util.isOpen(place) + '<br />' + '<br />'
  37.         + this.util.weekday(place);
  38.       dados += '</div>'
  39.       divinfo.innerHTML = dados;
  40.     }
  41.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement