Невозможно загрузить динамическую библиотеку 'zip.so' в Centos 7.6.1810 с помощью remi-php72 repo

# 1 Импортировать библиотеку

import CoreLocation
import GoogleMaps 

2 Установить делегат

CLLocationManagerDelegate

3 переменные

var locationManager = CLLocationManager()
var placePicker: GMSPlacePicker!
var lat: Double!
var long: Double!

4 Определить функцию для CLLoactionManager

func setUpCLLocationManager() {
            // cllocation mananger
        self.locationManager = CLLocationManager()

        self.locationManager.delegate = self

        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest

        self.locationManager.requestWhenInUseAuthorization()

        self.locationManager.startUpdatingLocation()

        self.locationManager.distanceFilter = 1000

        if (CLLocationManager.locationServicesEnabled())

        {

            self.locationManager.delegate = self

            self.locationManager.desiredAccuracy = kCLLocationAccuracyBest

            if ((UIDevice.current.systemVersion as NSString).floatValue >= 8)

            {

                self.locationManager.requestWhenInUseAuthorization()

            }



            self.locationManager.startUpdatingLocation()

        }

        else

        {
            self.showalertview(messagestring: "Location services are not enabled")
            #if debug

                println("Location services are not enabled");

            #endif

        }
    }

и вызвать его в методе ViewDidLoad

5 Способы делегирования вызовов

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
    let locValue:CLLocationCoordinate2D = manager.location!.coordinate
    long = (locValue.longitude)
    lat = (locValue.latitude)

    print (long , lat)

let coordinates = CLLocationCoordinate2DMake(self.latitude, self.longitude)
    let marker = GMSMarker(position: coordinates)
    marker.title = "I am here"
    marker.map = self.googleMapView
    self.googleMapView.animateToLocation(coordinates)

}





func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
    if status == .authorizedWhenInUse {
        locationManager.desiredAccuracy = kCLLocationAccuracyBest
        locationManager.startUpdatingLocation()
        let locValue: CLLocationCoordinate2D = (manager.location?.coordinate)!
        print("locations = \(locValue.latitude) \(locValue.longitude)")
        long = Float(locValue.longitude)
        lat = Float(locValue.latitude)
    }//if authorized
}//lo






func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
    print(error.localizedDescription)
    self.locationManager.stopUpdatingLocation()
}

6

****Dont Forget to Requesting authorization to use location services info.plist****

7 GMS place Picker

    @IBAction func pickPlace(sender: UIButton) {
    let northEast = CLLocationCoordinate2DMake(VIEWPORT_LATLNG.latitude + VIEWPORT_DELTA, VIEWPORT_LATLNG.longitude + VIEWPORT_DELTA)
    let southWest = CLLocationCoordinate2DMake(VIEWPORT_LATLNG.latitude - VIEWPORT_DELTA, VIEWPORT_LATLNG.longitude - VIEWPORT_DELTA)
    let viewport = GMSCoordinateBounds(coordinate: northEast, coordinate: southWest)
    let config = GMSPlacePickerConfig(viewport: viewport)
    placePicker = GMSPlacePicker(config: config)

    placePicker?.pickPlaceWithCallback({ (place: GMSPlace?,error: NSError?) -> Void in


      if error != nil {
        let error = error?.localizedDescription
       print(error)
        return
      }

      if place != nil {
        let coordinates = CLLocationCoordinate2DMake(place.coordinate.latitude, place.coordinate.longitude)
                let marker = GMSMarker(position: coordinates)
                marker.title = place.name
                marker.map = self.googleMapView
                self.googleMapView.animateToLocation(coordinates)
      } else {
        print("No place selected")
      }
    })
  }

#8 create path/route

func drawRectange(){  
   /* create the path */     
let path = GMSMutablePath()     
path.add(CLLocationCoordinate2D(latitude: lat, longitude: long)     path.add(CLLocationCoordinate2D(coordinates) 
/* show what you have drawn */     
let rectangle = GMSPolyline(path: path)     
rectangle.map = mapView 
}
1
задан Plastopian 19 January 2019 в 08:15
поделиться

1 ответ

Пожалуйста, убедитесь, что вы используете последнюю версию libzip5 1.5.1 из remi-safe репозитория (который является обязательным и включен по умолчанию)

0
ответ дан Remi Collet 19 January 2019 в 08:15
поделиться
Другие вопросы по тегам:

Похожие вопросы: