Class Veery
getBoundingBox(data : Data)
getBoundingBox(geojson: NSDictionary)
getBoundingBox(loc: CLLocation)
static functions
Get the bounding box of the passed object. Useful for zooming a Map to the right zoom level.
Parameters
Data (GeoJSON), NSDictionary (GeoJSON) or CLLocation
Returns
[CLLocationCoordinate2D]? [southwest,northest]
Usage / Example
let prediction = veery.getNextTrip() if (prediction?.isOk())! { if let geojs = prediction?.toGeoJson(){ let boundingbox = Veery.getBoundingBox(geojson: geojs) let southwest : CLLocationCoordinate2D = boundingbox![0] let northest : CLLocationCoordinate2D = boundingbox![1] let camera = GMSCameraUpdate.fit(GMSCoordinateBounds.init(coordinate:northest, coordinate:southwest ), withPadding:10.0) mapView.animate(with: camera) } }
User interaction
none