Google地图原始标记图像与所选标记重叠

时间:2019-06-13 04:24:51

标签: ios swift google-maps location google-maps-markers

在这里,我上传了我的问题的图片,您可以在其中检查我选择的标记是否与原始标记重叠。我不知道原因这是我选择标记的代码

 func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {

            //Here I am checking that selected marker is not my current location marker
            if marker != currentLocationMarker{

                if let selectedMarker = mapView.selectedMarker {
                    selectedMarker.icon = UIImage(named : "scooterPin")
                }

                mapView.selectedMarker = marker
                selectedScooterLocation = CLLocation(latitude: marker.position.latitude, longitude: marker.position.longitude)
                marker.icon = UIImage(named : "selectedScooterPin")

                currentLocationMarker.icon = UIImage(named : "currentLocationMarker")

                mapView.animate(to: GMSCameraPosition.camera(withLatitude: marker.position.latitude, longitude: marker.position.longitude, zoom: mapView.camera.zoom))

            }

            return true
    }

Overlapping marker image

0 个答案:

没有答案