简体   繁体   English

如何删除Google默认标记

[英]How can i remover google default marker

I have an app where i am displaying list of taxis around using a custom maker, but my default marker still appears over the custom marker, how do i remove the default marker. 我有一个应用程序,使用自定义制造商在其中显示出租车列表,但我的默认标记仍显示在自定义标记上方,我该如何删除默认标记。 I tried research on this, but nothing came 我尝试对此进行研究,但没有任何结果

Here is my code where i added the customer marker: 这是我添加客户标记的代码:

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);

                }

and this is the end result visually : 这是视觉上的最终结果:

在此处输入图片说明

删除此行:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM