简体   繁体   中英

How to remove default marker from GMSMapView

I used GMSMapView for iOS app. I want to remove default marker/annotation from GMSMapView but it's not removed. I use maptype property to remove it which is working perfect in Android but in iOS it's not working. Let me share code sample here.

let camera = GMSCameraPosition.camera(withLatitude: lat, longitude: long, zoom: zoom)
mapView = GMSMapView.map(withFrame: rect, camera: camera)
mapView.mapType = .terrain //<--- it's not working somehow in code i have tried all options.

Is there any other way to remove all default marker/annotation from GMSMapView in iOS? Let me attached image for visibility. screen shot of issue

Please Refer this ans i have tested its working

iOS Google Maps SDK - Hide / remove labels

first add myStyle.json file in your project and then call the do catch

You need to customize the map's style and you can do that with a JSON file in the app's bundle. Those markers are POI markers and you can remove them entirely with the following:

[
  {
    "featureType": "poi",
    "stylers": [
      {
        "visibility": "off"
      }
    ]
  }
]

JSON generator: https://mapstyle.withgoogle.com/

API reference: https://developers.google.com/maps/documentation/ios-sdk/style-reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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