From f9c5cbb2c369784fa2939df3940e440e36268f38 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 9 Apr 2023 18:02:38 +0200 Subject: [PATCH] Implemented the "centerMap(onLocation:)" function in the PlacesViewController view controller. --- Apps/Wikipedia/Wikipedia/Code/PlacesViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Apps/Wikipedia/Wikipedia/Code/PlacesViewController.swift b/Apps/Wikipedia/Wikipedia/Code/PlacesViewController.swift index c095c27..ff0b01d 100644 --- a/Apps/Wikipedia/Wikipedia/Code/PlacesViewController.swift +++ b/Apps/Wikipedia/Wikipedia/Code/PlacesViewController.swift @@ -1126,6 +1126,10 @@ class PlacesViewController: ViewController, UISearchBarDelegate, ArticlePopoverV viewMode = .map } + @objc func centerMap(onLocation location: CLLocation) { + zoomAndPanMapView(toLocation: location) + } + func selectArticlePlace(_ articlePlace: ArticlePlace) { mapView.selectAnnotation(articlePlace, animated: articlePlace.identifier != previouslySelectedArticlePlaceIdentifier) previouslySelectedArticlePlaceIdentifier = articlePlace.identifier