/** * Gets the Anchor V coordinate of the GeoJsonPoint. Normalized to [0, 1], of the anchor from * the top edge. This is equivalent to the same V value used in {@link * com.google.android.gms.maps.model.MarkerOptions#getAnchorV()}. * * @return Anchor V coordinate of the GeoJsonPoint */ public float getAnchorV() { return mMarkerOptions.getAnchorV(); }
/** * Creates a new marker option from given properties of an existing marker option * * @param originalMarkerOption An existing MarkerOption instance * @param iconRandomColorMode True if marker color mode is random, false otherwise * @param markerColor Color of the marker * @return A new MarkerOption */ private static MarkerOptions createMarkerOptions(MarkerOptions originalMarkerOption, boolean iconRandomColorMode, float markerColor) { MarkerOptions newMarkerOption = new MarkerOptions(); newMarkerOption.rotation(originalMarkerOption.getRotation()); newMarkerOption.anchor(originalMarkerOption.getAnchorU(), originalMarkerOption.getAnchorV()); if (iconRandomColorMode) { float hue = getHueValue(computeRandomColor((int) markerColor)); originalMarkerOption.icon(BitmapDescriptorFactory.defaultMarker(hue)); } newMarkerOption.icon(originalMarkerOption.getIcon()); return newMarkerOption; }
public void testAnchor() throws Exception { pointStyle.setAnchor(0.23f, 0.87f); assertEquals(0.23f, pointStyle.getAnchorU()); assertEquals(0.87f, pointStyle.getAnchorV()); assertEquals(0.23f, pointStyle.toMarkerOptions().getAnchorU()); assertEquals(0.87f, pointStyle.toMarkerOptions().getAnchorV()); }
/** * Sets the inline point style by copying over the styles that have been set * * @param markerOptions marker options object to add inline styles to * @param inlineStyle inline styles to apply * @param markerUrlIconUrl default marker icon URL from shared style */ private void setInlinePointStyle(MarkerOptions markerOptions, KmlStyle inlineStyle, String markerUrlIconUrl) { MarkerOptions inlineMarkerOptions = inlineStyle.getMarkerOptions(); if (inlineStyle.isStyleSet("heading")) { markerOptions.rotation(inlineMarkerOptions.getRotation()); } if (inlineStyle.isStyleSet("hotSpot")) { markerOptions .anchor(inlineMarkerOptions.getAnchorU(), inlineMarkerOptions.getAnchorV()); } if (inlineStyle.isStyleSet("markerColor")) { markerOptions.icon(inlineMarkerOptions.getIcon()); } if (inlineStyle.isStyleSet("iconUrl")) { addMarkerIcons(inlineStyle.getIconUrl(), markerOptions); } else if (markerUrlIconUrl != null) { // Inline style with no icon defined addMarkerIcons(markerUrlIconUrl, markerOptions); } }
/** * Gets a new MarkerOptions object containing styles for the GeoJsonPoint * * @return new MarkerOptions object */ public MarkerOptions toMarkerOptions() { MarkerOptions markerOptions = new MarkerOptions(); markerOptions.alpha(mMarkerOptions.getAlpha()); markerOptions.anchor(mMarkerOptions.getAnchorU(), mMarkerOptions.getAnchorV()); markerOptions.draggable(mMarkerOptions.isDraggable()); markerOptions.flat(mMarkerOptions.isFlat()); markerOptions.icon(mMarkerOptions.getIcon()); markerOptions.infoWindowAnchor(mMarkerOptions.getInfoWindowAnchorU(), mMarkerOptions.getInfoWindowAnchorV()); markerOptions.rotation(mMarkerOptions.getRotation()); markerOptions.snippet(mMarkerOptions.getSnippet()); markerOptions.title(mMarkerOptions.getTitle()); markerOptions.visible(mMarkerOptions.isVisible()); markerOptions.zIndex(mMarkerOptions.getZIndex()); return markerOptions; }
public Builder<T> toBuilder() { Builder<T> builder = new Builder<T>() .id(id) .object(object) .position(markerOptions.getPosition()) .alpha(markerOptions.getAlpha()) .anchor(markerOptions.getAnchorU(), markerOptions.getAnchorV()) .bitmapDescriptor(markerOptions.getIcon()) .infoWindowAnchor(markerOptions.getInfoWindowAnchorU(), markerOptions.getInfoWindowAnchorV()) .snippet(markerOptions.getSnippet()) .title(markerOptions.getTitle()) .draggable(markerOptions.isDraggable()) .visible(markerOptions.isVisible()) .alpha(markerOptions.getAlpha()) .rotation(markerOptions.getRotation()) .flat(markerOptions.isFlat()); if (divIcon != null) { builder.divIconHtml(divIcon.getHtml()) .divIconWidth(divIcon.getWidth()) .divIconHeight(divIcon.getHeight()); } return builder; }
public void testDefaultGetMarkerOptions() throws Exception { assertEquals(1.0f, pointStyle.toMarkerOptions().getAlpha()); assertEquals(0.5f, pointStyle.toMarkerOptions().getAnchorU()); assertEquals(1.0f, pointStyle.toMarkerOptions().getAnchorV()); assertFalse(pointStyle.toMarkerOptions().isDraggable()); assertFalse(pointStyle.toMarkerOptions().isFlat()); assertNull(pointStyle.toMarkerOptions().getIcon()); assertEquals(0.5f, pointStyle.toMarkerOptions().getInfoWindowAnchorU()); assertEquals(0.0f, pointStyle.toMarkerOptions().getInfoWindowAnchorV()); assertEquals(0.0f, pointStyle.toMarkerOptions().getRotation()); assertNull(pointStyle.toMarkerOptions().getSnippet()); assertNull(pointStyle.toMarkerOptions().getTitle()); assertTrue(pointStyle.toMarkerOptions().isVisible()); }
/** * Gets the Anchor V coordinate of the GeoJsonPoint. Normalized to [0, 1], of the anchor from * the top edge. This is equivalent to the same V value used in {@link * com.google.android.gms.maps.model.MarkerOptions#getAnchorV()}. * * @return Anchor V coordinate of the GeoJsonPoint */ public float getAnchorV() { return mMarkerOptions.getAnchorV(); }
public float getAnchorV() { return real.getAnchorV(); }
/** * Creates a new marker option from given properties of an existing marker option * * @param originalMarkerOption An existing MarkerOption instance * @param iconRandomColorMode True if marker color mode is random, false otherwise * @param markerColor Color of the marker * @return A new MarkerOption */ private static MarkerOptions createMarkerOptions(MarkerOptions originalMarkerOption, boolean iconRandomColorMode, float markerColor) { MarkerOptions newMarkerOption = new MarkerOptions(); newMarkerOption.rotation(originalMarkerOption.getRotation()); newMarkerOption.anchor(originalMarkerOption.getAnchorU(), originalMarkerOption.getAnchorV()); if (iconRandomColorMode) { float hue = getHueValue(computeRandomColor((int) markerColor)); originalMarkerOption.icon(BitmapDescriptorFactory.defaultMarker(hue)); } newMarkerOption.icon(originalMarkerOption.getIcon()); return newMarkerOption; }
/** * Sets the inline point style by copying over the styles that have been set * * @param markerOptions marker options object to add inline styles to * @param inlineStyle inline styles to apply * @param markerUrlIconUrl default marker icon URL from shared style */ private void setInlinePointStyle(MarkerOptions markerOptions, KmlStyle inlineStyle, String markerUrlIconUrl) { MarkerOptions inlineMarkerOptions = inlineStyle.getMarkerOptions(); if (inlineStyle.isStyleSet("heading")) { markerOptions.rotation(inlineMarkerOptions.getRotation()); } if (inlineStyle.isStyleSet("hotSpot")) { markerOptions .anchor(inlineMarkerOptions.getAnchorU(), inlineMarkerOptions.getAnchorV()); } if (inlineStyle.isStyleSet("markerColor")) { markerOptions.icon(inlineMarkerOptions.getIcon()); } if (inlineStyle.isStyleSet("iconUrl")) { addMarkerIcons(inlineStyle.getIconUrl(), markerOptions); } else if (markerUrlIconUrl != null) { // Inline style with no icon defined addMarkerIcons(markerUrlIconUrl, markerOptions); } }
/** * Gets a new MarkerOptions object containing styles for the GeoJsonPoint * * @return new MarkerOptions object */ public MarkerOptions toMarkerOptions() { MarkerOptions markerOptions = new MarkerOptions(); markerOptions.alpha(mMarkerOptions.getAlpha()); markerOptions.anchor(mMarkerOptions.getAnchorU(), mMarkerOptions.getAnchorV()); markerOptions.draggable(mMarkerOptions.isDraggable()); markerOptions.flat(mMarkerOptions.isFlat()); markerOptions.icon(mMarkerOptions.getIcon()); markerOptions.infoWindowAnchor(mMarkerOptions.getInfoWindowAnchorU(), mMarkerOptions.getInfoWindowAnchorV()); markerOptions.rotation(mMarkerOptions.getRotation()); markerOptions.snippet(mMarkerOptions.getSnippet()); markerOptions.title(mMarkerOptions.getTitle()); markerOptions.visible(mMarkerOptions.isVisible()); return markerOptions; }
private static MarkerOptions copy(MarkerOptions options) { MarkerOptions copy = new MarkerOptions(); if (GOOGLE_PLAY_SERVICES_4_0) { try { copy.alpha(options.getAlpha()); } catch (NoSuchMethodError error) { // not the cutest way to handle backward compatibility GOOGLE_PLAY_SERVICES_4_0 = false; } } copy.anchor(options.getAnchorU(), options.getAnchorV()); copy.draggable(options.isDraggable()); copy.flat(options.isFlat()); copy.icon(options.getIcon()); copy.infoWindowAnchor(options.getInfoWindowAnchorU(), options.getInfoWindowAnchorV()); copy.position(options.getPosition()); copy.rotation(options.getRotation()); copy.snippet(options.getSnippet()); copy.title(options.getTitle()); copy.visible(options.isVisible()); if (GOOGLE_PLAY_SERVICES_9_2) { try { copy.zIndex(options.getZIndex()); } catch (NoSuchMethodError error) { GOOGLE_PLAY_SERVICES_9_2 = false; } } return copy; } }
output.getAnchorV(),