如何删除Google默认标记

时间:2018-09-11 19:14:17

标签: android google-maps

我有一个应用程序,我在其中使用自定义制造商显示出租车列表,但是我的默认标记仍显示在自定义标记上方,我该如何删除默认标记。我尝试对此进行研究,但没有结果

这是我在其中添加客户标记的代码:

for (DriverInfo driverInfo: result.getDriverInfos()) {

                    ((MainActivity) getActivity()).bottom_view_on_successful_pick_layout.setVisibility(View.GONE);

                    MarkerOptions markerOptions = new MarkerOptions();
                    markerOptions.position(new LatLng((Double.parseDouble(driverInfo.getfLat())), Double.parseDouble(driverInfo.getfLong())));
                    markerOptions.title(driverInfo.getvFirst() +" "+ driverInfo.getvLast());
                    markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.pullova_option_ride_map_pin));

                    Marker carMarker = mGoogleMap.addMarker(markerOptions);

                    carMarker.setTag(0);

                    mGoogleMap.addMarker(new MarkerOptions().position(carMarker.getPosition()));

                    mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(carMarker.getPosition(),2));

                    ((MainActivity) getActivity()).driverMakers.put(carMarker, driverInfo);

                }

这是视觉上的最终结果:

enter image description here

0 个答案:

没有答案