1function lpinitMapPlaces() { 2 var myElem = document.getElementById('lp_listing_map'); 3 if (myElem === null) {} else { 4 var map = new google.maps.Map(document.getElementById('lp_listing_map'), { 5 center: { 6 lat: -33.8688, 7 lng: 151.2195 8 }, 9 zoom: 13 10 }); 11 var input = document.getElementById('lptitleGoogle'); 12 var autocomplete = new google.maps.places.Autocomplete(input); 13 var service = new google.maps.places.PlacesService(map); 14 google.maps.event.addListener(autocomplete, 'place_changed', function() { 15 var place = autocomplete.getPlace(); 16 if (!place.geometry) { 17 window.alert("No details available for input: '" + place.name + "'"); 18 return 19 } 20 place_id = place.place_id; 21 service.getDetails({ 22 placeId: place_id 23 }, function(place, status) { 24 jQuery('input[name="postTitle"]').val(place.name); 25 26 /* console.log(place.geometry.location.lat()); 27 console.log(place.geometry.location.lng()); */ 28 /* console.log(place.name); 29 console.log(place); */ 30 if (status === google.maps.places.PlacesServiceStatus.OK) { 31 var marker = new google.maps.Marker({ 32 map: map, 33 position: place.geometry.location 34 }); 35 if (!place.formatted_phone_number) {} else { 36 jQuery('input[name=phone]').val(place.formatted_phone_number) 37 } 38 var arrAddress = place.address_components; 39 var arrayLength = arrAddress.length; 40 if (arrAddress[1]) { 41 for (var i = 0; i < arrayLength; i++) { 42 if (arrAddress[i].types[0] === "locality") { 43 var city = arrAddress[i].short_name; 44 jQuery('input[name=locationn]').val(city); 45 jQuery('input[name=location]').val(city); 46 jQuery('input[name=locationn]').data('isseleted', true); 47 } 48 } 49 } 50 if (!place.formatted_address) {} else { 51 jQuery('input[name=gAddress]').val(place.formatted_address); 52 jQuery('input[name=latitude]').val(place.geometry.location.lat()); 53 jQuery('input[name=longitude]').val(place.geometry.location.lng()); 54 55 } 56 if (!place.website) {} else { 57 jQuery('input[name=website]').val(place.website) 58 } 59 if (!place.types) {} else { 60 for (var i = 0, len = place.types.length; i < len; i++) { 61 var option = document.createElement("option"); 62 if (place.types[i] == "point_of_interest") {} else if (place.types[i] == "establishment") {} else { 63 option.text = place.types[i]; 64 option.value = place.types[i]; 65 var attSelected = document.createAttribute("selected"); 66 attSelected.value = "selected"; 67 option.setAttributeNode(attSelected); 68 var select = document.getElementById("inputCategory"); 69 select.appendChild(option) 70 } 71 } 72 } 73 if (!place.photos) {} else { 74 for (var i = 0, len = place.photos.length; i < len; i++) { 75 var imgURL = place.photos[i].getUrl({ 76 'maxWidth': 500, 77 'maxHeight': 500 78 }); 79 var output = document.getElementById("filediv"); 80 var div = document.createElement("ul"); 81 div.className = 'jFiler-items-list jFiler-items-grid grid' + i; 82 div.innerHTML = '<li class="jFiler-item">\ 83 <div class="jFiler-item-container">\ 84 <div class="jFiler-item-inner">\ 85 <div class="jFiler-item-thumb">\ 86 <img class="thumbnail" src="' + imgURL + '" title="' + place.name + '"/>\ 87 </div>\ 88 </div>\ 89 </div><a class="icon-jfi-trash jFiler-item-trash-action">
89<i class="fa fa-trash"></i></a>\ 90 </li>'; 91 //output.insertBefore(div, null) 92 } 93 } 94 } 95 }) 96 }) 97 } 98} 99lpinitMapPlaces()
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.