com.google.android.gms.maps.model.Marker.getId()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中com.google.android.gms.maps.model.Marker.getId()方法的一些代码示例,展示了Marker.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Marker.getId()方法的具体详情如下:
包路径:com.google.android.gms.maps.model.Marker
类名称:Marker
方法名:getId

Marker.getId介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

@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);
 }
}

代码示例来源:origin: square/assertj-android

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;
}

代码示例来源:origin: commonsguy/cw-omnibus

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);
}

代码示例来源:origin: commonsguy/cw-omnibus

@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);
}

代码示例来源:origin: commonsguy/cw-omnibus

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));
  }
 }
}

代码示例来源:origin: mg6maciej/android-maps-extensions

@Deprecated
public String getId() {
  createMarker();
  return marker.getId();
}

代码示例来源:origin: SkyTreasure/Airbnb-Android-Google-Map-View

flag = false;
mViewPager.setVisibility(View.VISIBLE);
String aid = marker.getId().substring(1, marker.getId().length());

相关文章