Guest User

Untitled

a guest
Nov 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. var twitterId = venue.contact.twitter;
  2. if (twitterId !== null && twitterId !== undefined) {
  3. self.foursquareInfo += 'twitter: @' +
  4. twitterId + '<br>';
  5. }
  6. })
  7. // Fail message for Foursquare API
  8. .fail(function(error){
  9. alert("Foursquare API has failed");
  10. });
  11. };
  12.  
  13. /*
  14. Function that will pan to the position and open an info window of an item clicked in the list.
  15. */
  16. self.clickMarker = function(place) {
  17. var marker;
  18.  
  19. for(var e = 0; e < markersArray.length; e++) {
  20. if(place.place_id === markersArray[e].place_id) {
  21. marker = markersArray[e];
  22. break;
  23. }
  24. }
  25. self.getFoursquareInfo(place);
  26. map.panTo(marker.position);
  27.  
  28. // waits 300 milliseconds for the getFoursquare async function to finish
  29. setTimeout(function() {
  30. var contentString = '<div style="font-weight: bold">' + place.name + '</div><div>' + place.address + '</div>' + self.foursquareInfo;
  31. infowindow.setContent(contentString);
  32. infowindow.open(map, marker);
  33. marker.setAnimation(google.maps.Animation.DROP);
  34. }, 300);
  35. }
  36.  
  37. }
  38.  
  39. google.maps.event.addDomListener(window, 'load', initialize);
Add Comment
Please, Sign In to add comment