Daniel Ardeleanu
Daniel Ardeleanu

Reputation: 255

IOS Swift remove Capitals from Google Maps

I'm building a Quiz with capitals of Europe, the map will move to the specific country, and I dont want the user to scroll and see the name of the capital. So basically I have 2 options that I need help with : 1. Not to let the user to scroll 2. Hide all capitals or cities from Google map

here is the code:

  switch(randomNumber) {

        case 1:

        let latitude:Double = 45.943161
        let longitude:Double = 24.966760000000022

        let span = MKCoordinateSpanMake(25, 25)
        let region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: latitude, longitude: longitude), span: span)

        mapView.setRegion(region, animated: true)

        let pinLocation: CLLocationCoordinate2D = CLLocationCoordinate2DMake(latitude, longitude)

        let objectAnn = MKPointAnnotation()
        objectAnn.coordinate = pinLocation

        self.mapView.addAnnotation(objectAnn)




        questionLabel.text = "Iceland"
        button1.setTitle("Copenhagen", for: UIControlState.normal)
        button2.setTitle("Reykiavik", for: UIControlState.normal)
        button3.setTitle("Oslo", for: UIControlState.normal)
        button4.setTitle("Ljubiana", for: UIControlState.normal)

        correctAnswer = "2"

        break

Upvotes: 0

Views: 121

Answers (1)

Daniel Legler
Daniel Legler

Reputation: 527

Similar MapKit question for user interactions

To remove capitals you could try the Apple documentation for MapKit: showsPointsOfInterest

Also, it looks like you are using Apple's MapKit, not Google Maps, just fyi.

Upvotes: 1

Related Questions