Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void addMarker(LatLng latLng, String gametitle, String privacy) {
- if (privacy.matches("Public")){
- MarkerOptions Eventsmarkers = new MarkerOptions();
- Eventsmarkers.position(latLng);
- Eventsmarkers.title(gametitle);
- int px = getActivity().getResources().getDimensionPixelSize(R.dimen.map_marker_diameter);
- View markerView = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.map_marker_card, null);
- markerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
- markerView.layout(0, 0, px, px);
- markerView.buildDrawingCache();
- TextView eventTitle = (TextView)markerView.findViewById(R.id.editTextEventName);
- Bitmap mDotMarkerBitmap = Bitmap.createBitmap(px, px, Bitmap.Config.ARGB_8888);
- Canvas canvas = new Canvas(mDotMarkerBitmap);
- eventTitle.setText(gametitle);
- markerView.draw(canvas);
- Eventsmarkers.icon(BitmapDescriptorFactory.fromBitmap(mDotMarkerBitmap));
- Eventmarker= mMap.addMarker(Eventsmarkers);
- }
- }
Add Comment
Please, Sign In to add comment