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

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

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

Marker.setVisible介绍

暂无

代码示例

代码示例来源:origin: googlemaps/android-maps-utils

public void hideAll() {
  for (Marker marker : mMarkers) {
    marker.setVisible(false);
  }
}

代码示例来源:origin: googlemaps/android-maps-utils

public void showAll() {
  for (Marker marker : mMarkers) {
    marker.setVisible(true);
  }
}

代码示例来源:origin: googlemaps/android-maps-utils

public void addAll(java.util.Collection<MarkerOptions> opts, boolean defaultVisible) {
  for (MarkerOptions opt : opts) {
    addMarker(opt).setVisible(defaultVisible);
  }
}

代码示例来源:origin: googlemaps/android-maps-utils

marker.setVisible(isVisible);
setMarkerInfoWindow(style, marker, placemark);
if (hasDrawOrder) {

代码示例来源:origin: car2go/AnyMaps

@Override
public void setVisible(boolean visible) {
  marker.setVisible(visible);
}

代码示例来源:origin: owntracks/android

@Override
  protected void onPostExecute(BitmapDescriptor result) {
    Marker marker = target.get();
    if(marker != null) {
      marker.setIcon(result);
      marker.setVisible(true);
    }
  }
}

代码示例来源:origin: Phantast/smartnavi

public void setDestPosition(LatLng z) {
  destMarker.setPosition(z);
  destMarker.setVisible(true);
}

代码示例来源:origin: IndoorAtlas/android-sdk-examples

private void updateLocationCircleColor() {
  // If the user is on the floor that is visible on Google Maps, show a blue circle.
  // Otherwise show a gray circle
  if (mCircle != null) {
    if (mFloorLevelMatcher.isIALocationOnActiveLevel()) {
      mCircle.setFillColor(ACTIVE_LEVEL_BLUE_DOT_COLOR);
      mMarker.setVisible(true);
    } else {
      mCircle.setFillColor(OTHER_LEVEL_BLUE_DOT_COLOR);
      mMarker.setVisible(false);
    }
  }
}

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

public void setVisible(boolean visible) {
  if (marker != null) {
    marker.setVisible(visible);
  } else if (visible) {
    markerOptions.visible(true);
    createMarker();
  }
}

代码示例来源:origin: Phantast/smartnavi

@Override
public void onBackPressed() {
  if (routeHasBeenDrawn) {
    //Remove Route if drawn
    if (destMarker != null) {
      if (destMarker.isVisible()) {
        destMarker.setVisible(false);
      }
    }
    for (int a = 0; a <= routeParts; a++) {
      completeRoute[a].remove();
    }
    routeHasBeenDrawn = false;
    setFollowOn();
    View viewLine = findViewById(R.id.view156);
    if (viewLine != null) {
      viewLine.setVisibility(View.INVISIBLE);
    }
    TextView mapText = (TextView) findViewById(R.id.mapText);
    if (mapText != null) {
      mapText.setVisibility(View.INVISIBLE);
    }
  } else {
    super.onBackPressed();
  }
}

代码示例来源:origin: wiglenet/wigle-wifi-wardriving

/**
 * Adds a single geometry object to the map with its specified style
 *
 * @param geometry defines the type of object to add to the map
 * @param style    defines styling properties to add to the object when added to the map
 * @return the object that was added to the map, this is a Marker, Polyline, Polygon or an array
 * of either objects
 */
private Object addToMap(KmlPlacemark placemark, KmlGeometry geometry, KmlStyle style,
    KmlStyle inlineStyle, boolean isVisible) {
  String geometryType = geometry.getGeometryType();
  if (geometryType.equals("Point")) {
    Marker marker = addPointToMap(placemark, (KmlPoint) geometry, style, inlineStyle);
    marker.setVisible(isVisible);
    return marker;
  } else if (geometryType.equals("LineString")) {
    Polyline polyline = addLineStringToMap((KmlLineString) geometry, style, inlineStyle);
    polyline.setVisible(isVisible);
    return polyline;
  } else if (geometryType.equals("Polygon")) {
    Polygon polygon = addPolygonToMap((KmlPolygon) geometry, style, inlineStyle);
    polygon.setVisible(isVisible);
    return polygon;
  } else if (geometryType.equals("MultiGeometry")) {
    return addMultiGeometryToMap(placemark, (KmlMultiGeometry) geometry, style, inlineStyle,
        isVisible);
  }
  return null;
}

代码示例来源:origin: Phantast/smartnavi

public void createAllMarkersInvisible() {
  LatLng northPoleHideout = new LatLng(90.0D, 0.0D);
  destMarker = map.addMarker(new MarkerOptions().position(northPoleHideout).icon(BitmapDescriptorFactory.fromBitmap(drawableDest)));
  destMarker.setVisible(false);
  currentPosition = map.addMarker(new MarkerOptions().position(northPoleHideout)
      .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_maps_indicator_current_position_ohne)).anchor(0.5f, 0.5f));
  currentPosition.setVisible(false);
  current_position_anim_ohne = map.addMarker(new MarkerOptions().position(northPoleHideout)
      .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_maps_indicator_current_position_anim_ohne)).anchor(0.5f, 0.5f));
  current_position_anim_ohne.setVisible(false);
}

代码示例来源:origin: Phantast/smartnavi

oldZoomLevel = zoomLevel;
brightPoint = false;
actualMarker[0].setVisible(false);
currentPosition.setPosition(newPos);
currentPosition.setVisible(true);
actualMarker[0] = currentPosition;
stepCounterOld = Core.stepCounter;
actualMarker[0].setVisible(false);
  currentPosition.setVisible(true);
  actualMarker[0] = currentPosition;
  brightPoint = false;
} else {
  current_position_anim_ohne.setPosition(newPos);
  current_position_anim_ohne.setVisible(true);
  actualMarker[0] = current_position_anim_ohne;
  brightPoint = true;

代码示例来源:origin: ac-opensource/MarkerBuilder

.anchor(resizeDrawableAnchorU, resizeDrawableAnchorV)
    .draggable(isEnabled));
radiusMarker.setVisible(isEnabled);

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

marker.setVisible(false);

代码示例来源:origin: car2go/AnyMaps

@Test
public void testDelegateMethods() throws Exception {
  // Given
  Marker marker = mock(Marker.class);
  BitmapDescriptor descriptor = mock(BitmapDescriptor.class);
  BitmapDescriptorAdapter adapter = new BitmapDescriptorAdapter(descriptor);
  MarkerAdapter markerAdapter = new MarkerAdapter(marker);
  // When
  markerAdapter.setVisible(true);
  markerAdapter.setIcon(adapter);
  markerAdapter.getPosition();
  markerAdapter.showInfoWindow();
  markerAdapter.remove();
  // Then
  verify(marker).setVisible(eq(true));
  verify(marker).setIcon(refEq(descriptor));
  verify(marker).getPosition();
  verify(marker).showInfoWindow();
  verify(marker).remove();
}

代码示例来源:origin: Phantast/smartnavi

public void setFirstPosition() {
  startLatLng = new LatLng(Core.startLat, Core.startLon);
  currentPosition.setPosition(startLatLng);
  currentPosition.setVisible(true);
  actualMarker[0] = currentPosition;

相关文章