/** * Gets the rotation of the GeoJsonPoint in degrees clockwise about the marker's anchor point * * @return rotation of the GeoJsonPoint */ public float getRotation() { return mMarkerOptions.getRotation(); }
/** * Gets the rotation of a marker in degrees clockwise about the marker's anchor * * @return rotation of the Point */ public float getRotation() { return mMarkerOptions.getRotation(); }
public void testHeading() throws Exception { KmlStyle kmlStyle = new KmlStyle(); assertNotNull(kmlStyle); assertNotNull(kmlStyle.getMarkerOptions()); assertEquals(kmlStyle.getMarkerOptions().getRotation(), 0.0f); kmlStyle.setHeading(3); assertEquals(kmlStyle.getMarkerOptions().getRotation(), 3.0f); }
public void testRotation() throws Exception { pointStyle.setRotation(156.24f); assertEquals(156.24f, pointStyle.getRotation()); assertEquals(156.24f, pointStyle.toMarkerOptions().getRotation()); }
/** * 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()); 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 rotation of the GeoJsonPoint in degrees clockwise about the marker's anchor point * * @return rotation of the GeoJsonPoint */ public float getRotation() { return mMarkerOptions.getRotation(); }
public float getRotation() { return real.getRotation(); }
public float getRotation() { if (marker != null) { return marker.getRotation(); } else { return markerOptions.getRotation(); } }
/** * 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; } }