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 61 for (var i = 0, len = place.types.length; i < len; i++) { 62 var option = document.createElement("option"); 63 if (place.types[i] == "point_of_interest") {} else if (place.types[i] == "establishment") {} else { 64 option.text = place.types[i]; 65 option.value = place.types[i]; 66 var attSelected = document.createAttribute("selected"); 67 attSelected.value = "selected"; 68 option.setAttributeNode(attSelected); 69 var select = document.getElementById("inputCategory"); 70 select.appendChild(option); 71 jQuery("#inputCategory").change(); 72 jQuery("#inputCategory").select2(); 73 } 74 } 75 } 76 if (!place.photos) {} else { 77 for (var i = 0, len = place.photos.length; i < len; i++) { 78 var imgURL = place.photos[i].getUrl({ 79 'maxWidth': 500, 80 'maxHeight': 500 81 }); 82 var output = document.getElementById("filediv"); 83 var div = document.createElement("ul"); 84 div.className = 'jFiler-items-list jFiler-items-grid grid' + i; 85 div.innerHTML = '<li class="jFiler-item">\ 86 <div class="jFiler-item-container">\ 87 <div class="jFiler-item-inner">\ 88 <div class="jFiler-item-thumb">\ 89 <img class="thumbnail" alt="image" src="' + imgURL + '" title="' + place.name + '"/>\ 90 </div>\ 91 </div>\ 92 </div><a class="icon-jfi-trash jFiler-item-trash-action">
92<i class="fa fa-trash"></i></a>\ 93 </li>'; 94 //output.insertBefore(div, null) 95 } 96 } 97 } 98 }) 99 }) 100 } 101} 102lpinitMapPlaces()
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.