小编Rau*_* F.的帖子

Swift GoogleMaps fitBounds Zoom

在我看来,新的编码员尝试适应 GoogleMap。

我搜索了很多信息,得出了这个结论,但它对我不起作用。

覆盖 func loadView() {

    var markerList = [GMSMarker]()

    // Create a GMSCameraPosition
    let camera = GMSCameraPosition.camera(withLatitude: 4.390205, longitude: 2.154007, zoom: 8)
    let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
    mapView.isMyLocationEnabled = true
    view = mapView

    mapView.settings.myLocationButton = true
    //mapView.setMinZoom(10, maxZoom: 20)

    //create markers
    for loc in arrayOfMapStops {
        let marker = GMSMarker()
        marker.position = CLLocationCoordinate2D(latitude: loc.lat, longitude: loc.long)
        marker.title = loc.address
        marker.snippet = loc.type
        if loc.type == "Entrega" {marker.icon = GMSMarker.markerImage(with: .green)}
        else {marker.icon = GMSMarker.markerImage(with: .blue)}
        marker.map …
Run Code Online (Sandbox Code Playgroud)

google-maps markers zooming fitbounds swift

3
推荐指数
1
解决办法
3056
查看次数

标签 统计

fitbounds ×1

google-maps ×1

markers ×1

swift ×1

zooming ×1