Guest User

Untitled

a guest
Jan 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. createMap(pyrmont)
  2. CurrentPositionMarker(pyrmont);
  3.  
  4. map = new google.maps.Map(document.getElementById('map'), {
  5. center: pyrmont,
  6. zoom: 16
  7. });
  8.  
  9. document.getElementById('getCafeLocation').onclick = function () {
  10. nearbySearchCafe(pyrmont)
  11. }
  12.  
  13. let placename = place.name;
  14. // 吹き出しにカフェの名前を埋め込む
  15. let contentString = `<div class="sample"><p id="place_name">${placename}</p></div>`;
  16.  
  17. // 吹き出し
  18. let infoWindow = new google.maps.InfoWindow({ // 吹き出しの追加
  19. content: contentString // 吹き出しに表示する内容
  20. });
  21.  
  22.  
  23. marker.addListener('click', function () { // マーカーをクリックしたとき
  24. infoWindow.open(map, marker); // 吹き出しの表示
  25. });
  26.  
  27. function callback(results, status) {
  28. if (status == google.maps.places.PlacesServiceStatus.OK) {
  29. for (let i = 0; i < results.length; i++) {
  30. place = results[i];
  31. let latlng = place.geometry.location;
  32. let icn = place.icon;
  33. placeId = place.place_id;
  34. createMarker(latlng, icn, place);
  35. getDetails();
  36. };
  37. };
  38. };
Add Comment
Please, Sign In to add comment