private void initUserShakeData() { gUserShakeDataListFemale = new ArrayList<UserShakeData>(); gUserShakeDataListMale = new ArrayList<UserShakeData>(); for (int i = 0; i < gUserShakeDataList.size(); i++) { UserShakeData temp = gUserShakeDataList.get(i); if (temp.getSex().equals("male")) gUserShakeDataListMale.add(temp); else gUserShakeDataListFemale.add(temp); } }
private void locateOtherLocation(UserShakeData userShakeData, int index) { LatLng cenpt = new LatLng(userShakeData.getLatitude(), userShakeData.getLongitude()); String sex = userShakeData.getSex(); TextView view = new TextView(myContext); view.setTextColor(Color.WHITE); view.setTextSize(15); view.setGravity(Gravity.CENTER_HORIZONTAL); view.setText(String.valueOf(index + 1)); if (sex.equals("female")) view.setBackgroundResource(R.drawable.lj_map_female_location); else view.setBackgroundResource(R.drawable.lj_map_male_location); BitmapDescriptor markIcon = BitmapDescriptorFactory.fromBitmap(getBitmapFromView(view)); OverlayOptions option = new MarkerOptions().position(cenpt).icon(markIcon); Marker marker = (Marker) myContext.baiduMap.addOverlay(option); Bundle bundle = new Bundle(); bundle.putSerializable("index", index); marker.setExtraInfo(bundle); }