예제 #1
0
 /**
  * Method to populate the VenueList with venues
  *
  * @param responseObject: An object representing response from server
  */
 private void populateData(ResponseObject responseObject) {
   List<Group> groups = responseObject.getResponse().getGroups();
   List<Venue> venues = new ArrayList<Venue>();
   for (Group group : groups) {
     for (Item item : group.getItems()) {
       venues.add(item.getVenue());
     }
   }
   VenueList.getInstance().setVenues(venues);
 }
예제 #2
0
 /** Populate map with nearby venues we obtain from network call */
 private void populateMap() {
   mMap.setOnInfoWindowClickListener(this);
   List<Venue> venues = VenueList.getInstance().getVenues();
   if (venues != null && venues.size() > 0) {
     for (int i = 0; i < venues.size(); i++) {
       Venue venue = venues.get(i);
       String markerId =
           mMap.addMarker(
                   new MarkerOptions() // adding markers for each location
                       .title(venue.getName())
                       .position(
                           new LatLng(venue.getLocation().getLat(), venue.getLocation().getLng())))
               .getId();
       markerVenueMap.put(markerId, venue);
     }
   }
 }