From f360603d706b12c4559a084885208230a51116da Mon Sep 17 00:00:00 2001 From: Zandor Smith Date: Mon, 29 Nov 2021 09:43:29 +0100 Subject: [PATCH] Allow specifying a custom Coordinate Span instead of zoomlevel. --- src/lib/AppleMaps.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/AppleMaps.js b/src/lib/AppleMaps.js index 3597875..97cd749 100644 --- a/src/lib/AppleMaps.js +++ b/src/lib/AppleMaps.js @@ -179,10 +179,10 @@ class AppleMaps extends Component { } setMainCoords() { - const { longitude, latitude } = this.props + const { longitude, latitude, spanLat, spanLong } = this.props const mainCoords = new mapkit.CoordinateRegion( new mapkit.Coordinate(latitude, longitude), - new mapkit.CoordinateSpan(this.zoomLevel(), this.zoomLevel()) + new mapkit.CoordinateSpan(spanLat ? spanLat : this.zoomLevel(), spanLong ? spanLong : this.zoomLevel()) ) this.map.region = mainCoords }