@Override public View getInfoContents(Marker marker) { View popup=inflater.inflate(R.layout.popup, null); TextView tv=(TextView)popup.findViewById(R.id.title); tv.setText(models.get(marker.getId()).getTitle()); tv=(TextView)popup.findViewById(R.id.snippet); tv.setText(models.get(marker.getId()).getSnippet()); return(popup); } }
public MarkerAssert hasId(String id) { isNotNull(); String actualId = actual.getId(); assertThat(actualId) // .overridingErrorMessage("Expected id <%s> but was <%s>.", id, actualId) // .isEqualTo(id); return this; }
private void addMarkers(GoogleMap map) { Model model= new Model(this, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations); models.put(addMarkerForModel(map, model).getId(), model); model= new Model(this, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet); models.put(addMarkerForModel(map, model).getId(), model); model= new Model(this, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3); models.put(addMarkerForModel(map, model).getId(), model); model= new Model(this, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy); models.put(addMarkerForModel(map, model).getId(), model); }
@SuppressLint("InflateParams") @Override public View getInfoContents(Marker marker) { if (popup == null) { popup=inflater.inflate(R.layout.popup, null); } if (lastMarker == null || !lastMarker.getId().equals(marker.getId())) { lastMarker=marker; TextView tv=(TextView)popup.findViewById(R.id.title); tv.setText(marker.getTitle()); tv=(TextView)popup.findViewById(R.id.snippet); tv.setText(marker.getSnippet()); Uri image=images.get(marker.getId()); ImageView icon=(ImageView)popup.findViewById(R.id.icon); if (image == null) { icon.setVisibility(View.GONE); } else { icon.setVisibility(View.VISIBLE); Picasso.with(ctxt).load(image).resize(iconWidth, iconHeight) .centerCrop().noFade() .placeholder(R.drawable.placeholder) .into(icon, new MarkerCallback(marker)); } } return(popup); }
private void addMarker(GoogleMap map, double lat, double lon, int title, int snippet, String image) { Marker marker= map.addMarker(new MarkerOptions().position(new LatLng(lat, lon)) .title(getString(title)) .snippet(getString(snippet))); if (image != null) { images.put(marker.getId(), Uri.parse("http://misc.commonsware.com/mapsv2/" + image)); } } }
@Deprecated public String getId() { createMarker(); return marker.getId(); }