public Builder<T> flat(boolean flat) { markerOptions.flat(flat); return this; }
/** * Sets the GeoJsonPoint to be flat * * @param flat true if GeoJsonPoint is flat, false if not flat */ public void setFlat(boolean flat) { mMarkerOptions.flat(flat); styleChanged(); }
private void addMarker(GoogleMap map, double lat, double lon, int title, int snippet, boolean flat, float rotation) { map.addMarker(new MarkerOptions().position(new LatLng(lat, lon)) .title(getString(title)) .snippet(getString(snippet)) .flat(flat).rotation(rotation)); } }
/** * 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 MarkerOptions flat(boolean flat) { real.flat(flat); return this; }
public void setFlat(boolean flat) { if (marker != null) { marker.setFlat(flat); } else { markerOptions.flat(flat); } }
/** * Sets the GeoJsonPoint to be flat * * @param flat true if GeoJsonPoint is flat, false if not flat */ public void setFlat(boolean flat) { mMarkerOptions.flat(flat); styleChanged(); }
.title("Marker " + i) .icon(BitmapDescriptorFactory.defaultMarker(i * 360 / numMarkersInRainbow)) .flat(flat) .rotation(rotation)); mMarkerRainbow.add(marker);
public MarkerAreaWrapper(Context context, GoogleMap map, boolean isEnabled, LatLng center, int count, Boolean shouldExpand, ArrayList<Object> locationData, int centerDrawableId) { this.isEnabled = isEnabled; this.count = count; this.mapAreaType = DATA_POINT_WRAPPER; this.shouldExpand = shouldExpand; this.locationData = locationData; centerMarker = map.addMarker(new MarkerOptions() .position(center) .flat(true) .draggable(isEnabled)); if (centerDrawableId != -1) { BitmapDrawable bitmapDrawable = (BitmapDrawable) context.getResources().getDrawable(centerDrawableId); Bitmap bitmap = bitmapDrawable.getBitmap(); Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmap, bitmap.getWidth()/2, bitmap.getHeight()/2, false); centerMarker.setIcon(BitmapDescriptorFactory.fromBitmap(scaledBitmap)); } }
private void drawMalMarkers(ArrayList<Location> locationList, BitmapDescriptor descriptor){ for(Location location : locationList){ LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude()); Marker marker = map.addMarker(new MarkerOptions() .position(latLng) .flat(true) .anchor(0.5f, 0.5f) .icon(descriptor)); malMarkers.add(marker); } }
.flat(true) .draggable(isEnabled));
private void drawUserPositionMarker(Location location){ LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude()); if(this.userPositionMarkerBitmapDescriptor == null){ userPositionMarkerBitmapDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.user_position_point); } if (userPositionMarker == null) { userPositionMarker = map.addMarker(new MarkerOptions() .position(latLng) .flat(true) .anchor(0.5f, 0.5f) .icon(this.userPositionMarkerBitmapDescriptor)); } else { userPositionMarker.setPosition(latLng); } }
/** * Draws a marker at the given point. * <p/> * Should be called when the users touches the map and adds an entry to the * stacks * * @param center the point where the user clicked * @return the drawn Polygon */ private Marker drawMarker(final LatLng center) { return mMap.addMarker( new MarkerOptions().position(center).flat(true).anchor(0.5f, 0.5f).icon(marker)); }
if (emission == 1) { marker = mMap.addMarker(new MarkerOptions().position(latLngs.get(0)) .flat(true) .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_car)));
com.google.android.gms.maps.model.Marker createMarker(List<Marker> markers, LatLng position) { markerOptions.position(position); ClusterOptions opts = clusterOptionsProvider.getClusterOptions(markers); markerOptions.icon(opts.getIcon()); if (GOOGLE_PLAY_SERVICES_4_0) { try { markerOptions.alpha(opts.getAlpha()); } catch (NoSuchMethodError error) { // not the cutest way to handle backward compatibility GOOGLE_PLAY_SERVICES_4_0 = false; } } markerOptions.anchor(opts.getAnchorU(), opts.getAnchorV()); markerOptions.flat(opts.isFlat()); markerOptions.infoWindowAnchor(opts.getInfoWindowAnchorU(), opts.getInfoWindowAnchorV()); markerOptions.rotation(opts.getRotation()); if (GOOGLE_PLAY_SERVICES_9_2) { try { markerOptions.zIndex(opts.getZIndex()); } catch (NoSuchMethodError error) { GOOGLE_PLAY_SERVICES_9_2 = false; } } return map.addMarker(markerOptions); }
private void showLocationCircle(LatLng center, double accuracyRadius) { if (mCircle == null) { // location can received before map is initialized, ignoring those updates if (mMap != null) { mCircle = mMap.addCircle(new CircleOptions() .center(center) .radius(accuracyRadius) .fillColor(0x201681FB) .strokeColor(0x500A78DD) .zIndex(1.0f) .visible(true) .strokeWidth(5.0f)); mHeadingMarker = mMap.addMarker(new MarkerOptions() .position(center) .icon(BitmapDescriptorFactory.fromResource(R.drawable.map_blue_dot)) .anchor(0.5f, 0.5f) .flat(true)); } } else { // move existing markers position to received location mCircle.setCenter(center); mHeadingMarker.setPosition(center); mCircle.setRadius(accuracyRadius); } }
/** * 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 void showBlueDot(LatLng center, double accuracyRadius, double bearing) { if (mCircle == null) { // location can received before map is initialized, ignoring those updates if (mMap != null) { mCircle = mMap.addCircle(new CircleOptions() .center(center) .radius(accuracyRadius) .fillColor(0x201681FB) .strokeColor(0x500A78DD) .zIndex(1.0f) .visible(true) .strokeWidth(5.0f)); mMarker = mMap.addMarker(new MarkerOptions() .position(center) .icon(BitmapDescriptorFactory.fromResource(R.drawable.map_blue_dot)) .anchor(0.5f, 0.5f) .rotation((float)bearing) .flat(true)); } } else { // move existing markers position to received location mCircle.setCenter(center); mCircle.setRadius(accuracyRadius); mMarker.setPosition(center); mMarker.setRotation((float)bearing); } }
private void showBlueDot(LatLng center, double accuracyRadius, double bearing) { if (mCircle == null) { // location can received before map is initialized, ignoring those updates if (mMap != null) { mCircle = mMap.addCircle(new CircleOptions() .center(center) .radius(accuracyRadius) .fillColor(ACTIVE_LEVEL_BLUE_DOT_COLOR) .strokeColor(0x00000000) .zIndex(1.0f) .visible(true)); mMarker = mMap.addMarker(new MarkerOptions() .position(center) .icon(BitmapDescriptorFactory.fromResource(R.drawable.map_blue_dot)) .anchor(0.5f, 0.5f) .rotation((float)bearing) .flat(true)); mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(center, 17.0f)); } } else { mCircle.setCenter(center); mCircle.setRadius(accuracyRadius); mMarker.setPosition(center); mMarker.setRotation((float)bearing); } }
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; } }