public void UpdateMarker() { marker.setTitle( (isInvoln() ? "Powered up " : "") + PlayerType.getTypeString(type) + " " + (local ? "You" : name)); int drawableID = PlayerType.getDrawableID(type); Bitmap bmp = BitmapFactory.decodeResource(Game.getAppContext().getResources(), drawableID); if (bmp == null) { return; } double aspect = bmp.getWidth() / (double) bmp.getHeight(); marker.setIcon( BitmapDescriptorFactory.fromBitmap( Bitmap.createScaledBitmap(bmp, (int) (100 * aspect), 100, false))); marker.setAlpha(isCooldown() ? 0.5f : 1f); marker.setVisible(true); marker.setPosition(new LatLng(latitude, longitude)); marker.setSnippet("Score: " + score); accuracyCircle.setCenter(new LatLng(latitude, longitude)); accuracyCircle.setRadius(accuracy); }
private void removePlaces() { Log.d(TAG, "removePlaces"); for (Circle circle : placesOverlay) { circle.remove(); } placesOverlay.clear(); }
public void setMarkerLocation(LatLng latLng, Float zoom) { if (marker != null) { marker.remove(); radiusCircle.remove(); } marker = googleMap.addMarker(new MarkerOptions().position(latLng)); googleMap.setOnMarkerClickListener( new GoogleMap.OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker clickedMarker) { if (clickedMarker.equals(marker)) { Popup.showMarkerOptions(MapFragment.this.getActivity(), marker, radiusCircle); } return false; } }); centerOnLatLng(latLng, zoom); String strokeColor = SettingHelper.getSettingValue("mapCircleStrokeColor"); if (strokeColor == null) strokeColor = "FF425C97"; String fillColor = SettingHelper.getSettingValue("mapCircleFillColor"); if (fillColor == null) fillColor = "1E425C97"; radiusCircle = googleMap.addCircle( new CircleOptions() .center(latLng) .radius(radius) .strokeColor(Color.parseColor("#" + strokeColor)) .fillColor(Color.parseColor("#" + fillColor)) .strokeWidth(2)); }
public MapFragment changeRadius(double changechange) { if (radiusCircle != null) { if (radius + changechange < 0) radius = 0; else radius += changechange; radiusCircle.setRadius(radius); } return this; }
public void dibujarDistancia() { if (getMap() != null && getMap().isMyLocationEnabled() && getMap().getMyLocation() != null) { CircleOptions dOptions = new CircleOptions(); dOptions.center( new LatLng( getMap().getMyLocation().getLatitude(), getMap().getMyLocation().getLongitude())); dOptions.radius(DataStorage.filtro.getDistancia()); dOptions.strokeColor(0xFFFF0000); dOptions.fillColor(0x22FF0000); if (distanciaCirculo != null) { distanciaCirculo.remove(); } distanciaCirculo = getMap().addCircle(dOptions); } }
public double getRadius() { if (radiusCircle != null) return radiusCircle.getRadius(); return 0; }