【问题标题】:IOS Swift remove Capitals from Google MapsIOS Swift 从谷歌地图中删除大写字母
【发布时间】:2017-07-06 02:47:03
【问题描述】:

我正在构建一个包含欧洲首都的测验,地图将移动到特定国家,我不希望用户滚动并看到首都的名称。所以基本上我有 2 个选项需要帮助: 1. 不要让用户滚动 2.在谷歌地图上隐藏所有首都或城市

代码如下:

  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

【问题讨论】:

    标签: ios iphone swift xcode google-maps


    【解决方案1】:

    用于用户交互的类似 MapKit question

    要删除大写字母,您可以尝试 MapKit 的 Apple 文档:showsPointsOfInterest

    另外,您似乎使用的是 Apple 的 MapKit,而不是 Google 地图,仅供参考。

    【讨论】:

    • 谢谢,缩放问题解决了,如果可能的话,仍然找不到如何从谷歌地图中删除大写字母
    猜你喜欢
    • 1970-01-01
    • 2013-04-10
    • 1970-01-01
    • 2016-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-09
    • 1970-01-01
    相关资源
    最近更新 更多