Skip to content

Instantly share code, notes, and snippets.

@audiocommander
audiocommander / centerMapViewFromBBox.swift
Last active October 26, 2023 13:48 — forked from aaronpk/gist:6693579
Center a MKMapView given a GeoJSON bounding box
// prepare bbox
struct BoundingBox {
// latitudes range from -90 .. +90
// longitudes range from -180 .. +180
var latmin = 90.0
var latmax = -90.0
var lngmin = 180.0
var lngmax = -180.0
}
var bbox = BoundingBox()