Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- initMap(lat, lng) {
- let mapOptions = {
- center: { lat, lng },
- zoom: 16,
- mapTypeId: google.maps.MapTypeId.ROADMAP,
- disableDefaultUI: true,
- zoomControl: true,
- scaleControl: true,
- }
- this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
- let service = new google.maps.places.PlacesService(this.map);
- let infowindow = new google.maps.InfoWindow();
- service.getDetails({
- placeId: this.placeId
- }, (place, status) => {
- this.callback(place, status);
- });
- }
- callback(place, status) {
- if (status === google.maps.places.PlacesServiceStatus.OK) {
- // this.createMarker(place)
- let divinfo = document.getElementById("info");
- let dados = '';
- dados += '<div style="color:red">';
- dados += this.util.photo(place) + '<br />'
- dados += '<strong>' + place.name + '</strong><br />';
- dados += 'Endereço: ' + place.formatted_address + '<br />';
- dados += 'Telefone: ' + place.formatted_phone_number + '<br />';
- dados += 'Site: ' + place.website + '<br />';
- dados += 'Rua: ' + place.address_components['0'].long_name + ', ' + place.address_components['1'].long_name + '<br />';
- dados += 'Aberto: ' + this.util.isOpen(place) + '<br />' + '<br />'
- + this.util.weekday(place);
- dados += '</div>'
- divinfo.innerHTML = dados;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement