- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下多边形:
<Polygon><outerBoundaryIs><LinearRing><coordinates>-86.41182,32.4757 -86.41177,32.46599 -86.41167,32.45054 -86.41157,32.44245 -86.41154,32.43993 -86.41138,32.42573 -86.41135,32.42417 -86.41128,32.42185 -86.41117,32.41017 -86.41117,32.40994 -86.41615,32.4072 -86.43178,32.40132 -86.43926,32.40025 -86.44653,32.40036 -86.45876,32.40573 -86.4612,32.40285 -86.46247,32.38769 -86.46356,32.37729 -86.46836,32.37368 -86.47092,32.37136 -86.47306,32.36874 -86.47476,32.36588 -86.47777,32.36418 -86.48023,32.36497 -86.48342,32.36667 -86.4871,32.36674 -86.49047,32.36532 -86.49265,32.36286 -86.49263,32.36032 -86.49181,32.35787 -86.4908,32.35513 -86.48994,32.35264 -86.4899,32.34985 -86.49071,32.34705 -86.49308,32.34509 -86.49637,32.34451 -86.49677,32.34444 -86.49697,32.34441 -86.51978,32.34039 -86.54242,32.36286 -86.56658,32.37296 -86.58826,32.36775 -86.61646,32.38072 -86.61548,32.40307 -86.62671,32.40372 -86.64956,32.40055 -86.65426,32.37904 -86.66333,32.36937 -86.67726,32.35659 -86.68276,32.35356 -86.69448,32.35677 -86.71309,32.36186 -86.71624,32.36921 -86.71982,32.3884 -86.71721,32.40129 -86.73083,32.40061 -86.75543,32.38914 -86.78214,32.39047 -86.78238,32.37337 -86.7843,32.32449 -86.80352,32.30819 -86.82039,32.3184 -86.81563,32.3402 -86.81491,32.3408 -86.81229,32.34299 -86.81294,32.36582 -86.8318,32.38605 -86.8411,32.41849 -86.83652,32.4304 -86.85357,32.43893 -86.86242,32.43869 -86.86415,32.44592 -86.86997,32.4606 -86.87364,32.47188 -86.88497,32.48191 -86.88087,32.48886 -86.88465,32.49656 -86.89084,32.5124 -86.89979,32.52588 -86.90667,32.53685 -86.90521,32.54915 -86.90023,32.55933 -86.89905,32.57819 -86.90385,32.59242 -86.90759,32.60835 -86.91163,32.62085 -86.9119,32.63178 -86.9185,32.64452 -86.91827,32.65322 -86.91767,32.66411 -86.91759,32.66417 -86.91757,32.66417 -86.91241,32.66425 -86.8929,32.66343 -86.87358,32.66258 -86.84557,32.66137 -86.83382,32.66082 -86.81764,32.66016 -86.81319,32.66017 -86.78767,32.66052 -86.74998,32.66098 -86.72508,32.66159 -86.71349,32.66738 -86.71257,32.70574 -86.66704,32.70609 -86.63189,32.70633 -86.61778,32.70629 -86.60783,32.70632 -86.59515,32.70653 -86.57015,32.70678 -86.52944,32.70704 -86.4963,32.7073 -86.48468,32.7076 -86.47197,32.70778 -86.46803,32.70786 -86.45035,32.70809 -86.41583,32.70747 -86.41312,32.70739 -86.413,32.67818 -86.41298,32.67406 -86.41261,32.61636 -86.4125,32.58942 -86.41244,32.57816 -86.41234,32.55023 -86.41226,32.53344 -86.41223,32.52876 -86.4122,32.52668 -86.4123,32.52082 -86.41231,32.51273 -86.41234,32.50446 -86.4122,32.50006 -86.41212,32.49626 -86.41197,32.49065 -86.41197,32.48577 -86.41187,32.48112</coordinates></LinearRing></outerBoundaryIs></Polygon>
我想使用 Google Maps iOS SDK 在美国 map 上绘制它。我写了下面的代码:
import UIKit
import GoogleMaps
class ViewController: UIViewController {
// You don't need to modify the default init(nibName:bundle:) method.
override func loadView() {
let camera = GMSCameraPosition.cameraWithLatitude(37.0902, longitude: -95.7129, zoom: 3.0)
let mapView = GMSMapView.mapWithFrame(CGRect.zero, camera: camera)
mapView.myLocationEnabled = true
view = mapView
// Creates a marker in the center of the map.
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.20)
marker.title = "Sydney"
marker.snippet = "Australia"
marker.map = mapView
// Create a rectangular path
let rect = GMSMutablePath()
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41182, longitude: -32.4757))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41177, longitude: 32.46599))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41167, longitude: 32.45054))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41157, longitude: 32.44245))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41154, longitude: 32.43993))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41138, longitude: 32.42573))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41135, longitude: 32.42417))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41128, longitude: 32.42185))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41117, longitude: 32.41017))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41117, longitude: 32.40994))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41615, longitude: 32.4072))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.43178, longitude: 32.40132))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.43926, longitude: 32.40025))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.44653, longitude: 32.40036))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.45876, longitude: 32.40573))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.4612, longitude: 32.40285))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.46247, longitude: 32.38769))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.46356, longitude: 32.37729))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.46836, longitude: 32.37368))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.47092, longitude: 32.37136))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.47306, longitude: 32.36874))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.47476, longitude: 32.36588))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.47777, longitude: 32.36418))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.48023, longitude: 32.36497))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.48342, longitude: 32.36667))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.4871, longitude: 32.36674))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.49047, longitude: 32.36532))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.49265, longitude: 32.36286))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.49263, longitude: 32.36032))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.49181, longitude: 32.35787))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.4908, longitude: 32.35513))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.48994, longitude: 32.35264))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.4899, longitude: 32.34985))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.49071, longitude: 32.34705))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.49308, longitude: 32.34509))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.49637, longitude: 32.34451))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.49677, longitude: 32.34444))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.49697, longitude: 32.34441))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.51978, longitude: 32.34039))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.54242, longitude: 32.36286))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.56658, longitude: 32.37296))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.58826, longitude: 32.36775))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.61646, longitude: 32.38072))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.61548, longitude: 32.40307))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.62671, longitude: 32.40372))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.64956, longitude: 32.40055))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.65426, longitude: 32.37904))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.66333, longitude: 32.36937))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.67726, longitude: 32.35659))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.68276, longitude: 32.35356))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.69448, longitude: 32.35677))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.71309, longitude: 32.36186))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.71624, longitude: 32.36921))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.71982, longitude: 32.3884))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.71721, longitude: 32.40129))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.73083, longitude: 32.40061))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.75543, longitude: 32.38914))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.78214, longitude: 32.39047))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.78238, longitude: 32.37337))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.7843, longitude: 32.32449))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.80352, longitude: 32.30819))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.82039, longitude: 32.3184))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.81563, longitude: 32.3402))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.81491, longitude: 32.3408))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.81229, longitude: 32.34299))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.81294, longitude: 32.36582))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.8318, longitude: 32.38605))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.8411, longitude: 32.41849))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.83652, longitude: 32.4304))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.85357, longitude: 32.43893))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.86242, longitude: 32.43869))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.86415, longitude: 32.44592))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.86997, longitude: 32.4606))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.87364, longitude: 32.47188))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.88497, longitude: 32.48191))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.88087, longitude: 32.48886))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.88465, longitude: 32.49656))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.89084, longitude: 32.5124))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.89979, longitude: 32.52588))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.90667, longitude: 32.53685))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.90521, longitude: 32.54915))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.90023, longitude: 32.55933))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.89905, longitude: 32.57819))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.90385, longitude: 32.59242))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.90759, longitude: 32.60835))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.91163, longitude: 32.62085))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.9119, longitude: 32.63178))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.9185, longitude: 32.64452))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.91827, longitude: 32.65322))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.91767, longitude: 32.66411))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.91759, longitude: 32.66417))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.91757, longitude: 32.66417))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.91241, longitude: 32.66425))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.8929, longitude: 32.66343))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.87358, longitude: 32.66258))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.84557, longitude: 32.66137))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.83382, longitude: 32.66082))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.81764, longitude: 32.66016))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.81319, longitude: 32.66017))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.78767, longitude: 32.66052))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.74998, longitude: 32.66098))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.72508, longitude: 32.66159))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.71349, longitude: 32.66738))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.71257, longitude: 32.70574))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.66704, longitude: 32.70609))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.63189, longitude: 32.70633))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.61778, longitude: 32.70629))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.60783, longitude: 32.70632))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.59515, longitude: 32.70653))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.57015, longitude: 32.70678))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.52944, longitude: 32.70704))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.4963, longitude: 32.7073))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.48468, longitude: 32.7076))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.47197, longitude: 32.70778))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.46803, longitude: 32.70786))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.45035, longitude: 32.70809))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41583, longitude: 32.70747))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41312, longitude: 32.70739))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.413, longitude: 32.67818))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41298, longitude: 32.67406))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41261, longitude: 32.61636))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.4125, longitude: 32.58942))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41244, longitude: 32.57816))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41234, longitude: 32.55023))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41226, longitude: 32.53344))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41223, longitude: 32.52876))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.4122, longitude: 32.52668))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.4123, longitude: 32.52082))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41231, longitude: 32.51273))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41234, longitude: 32.50446))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.4122, longitude: 32.50006))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41212, longitude: 32.49626))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41197, longitude: 32.49065))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41197, longitude: 32.48577))
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41187, longitude: 32.48112))
// Create the polygon, and assign it to the map.
let polygon = GMSPolygon(path: rect)
polygon.fillColor = UIColor(red: 0.25, green: 0, blue: 0, alpha: 0.05);
polygon.strokeColor = UIColor.blackColor()
polygon.strokeWidth = 2
polygon.map = mapView
}
这似乎没有画出多边形。我做错了什么吗?
最佳答案
检查您的纬度/经度值。您在完全不同的位置绘制多边形。 (并且您的源多边形中的值不正确)
let camera = GMSCameraPosition.cameraWithLatitude(37.0902, longitude: -95.7129, zoom: 3.0)
rect.addCoordinate(CLLocationCoordinate2D(latitude: -86.41182, longitude: -32.4757))
您的代码似乎是正确的。
关于ios - 在 Swift 中绘制自定义多边形 Google Maps iOS SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39674901/
有没有办法在 .swift 文件(编译成 .swift 模块)中声明函数,如下所示: 你好.swift func hello_world() { println("hello world")
我正在尝试使用 xmpp_messenger_ios 和 XMPPFramework 在 iOS 上执行 MUC 这是加入房间的代码。 func createOrJoinRoomOnXMPP()
我想在我的应用程序上创建一个 3D Touch 快捷方式,我已经完成了有关快捷方式本身的所有操作,它显示正确,带有文本和图标。 当我运行这个快捷方式时,我的应用程序崩溃了,因为 AppDelegate
我的代码如下: let assetTag = Expression("asset_tag") let query2 = mdm.select(mdm[assetTag],os, mac, lastRe
我的 swift 代码如下所示 Family.arrayTuple:[(String,String)]? = [] Family.arrayTupleStorage:String? Family.ar
这是我的 JSON,当我读取 ord 和 uniq 数据时出现错误 let response2 : [String: Any] = ["Response":["status":"SUCCESS","
我想将 swift 扩展文件移动到 swift 包中。但是,将文件移动到 swift 包后,我遇到了这种错误: "Type 'NSAttributedString' has no member 'ma
使用CocoaPods,我们可以设置以下配置: pod 'SourceModel', :configurations => ['Debug'] 有什么方法可以用 Swift Package Manag
我正在 Xcode 中开发一个 swift 项目。我将其称为主要项目。我大部分都在工作。我在日期选择器、日期范围和日期数学方面遇到了麻烦,因此我开始了另一个名为 StarEndDate 的项目,其中只
这是 ObjectiveC 代码: CCSprite *progress = [CCSprite spriteWithImageNamed:@"progress.png"]; mProgressBar
我正在创建一个命令行工具,在 Xcode 中使用 Swift。我想使用一个类似于 grunt 的配置文件确实如此,但我希望它是像 Swift 包管理器的 package.swift 文件那样的快速代码
我假设这意味着使用系统上安装的任何 swift 运行脚本:#!/usr/bin/swift 如何指定脚本适用的解释器版本? 最佳答案 Cato可用于此: #!/usr/bin/env cato 1.2
代码说完全没问题,没有错误,但是当我去运行模拟器的时候,会出现这样的字样: (Swift.LazyMapCollection (_base:[ ] 我正在尝试创建一个显示报价的报价应用。 这是导入
是否可以在运行 Swift(例如 Perfect、Vapor、Kitura 等)的服务器上使用 RealmSwift 并使用它来存储数据? (我正在考虑尝试将其作为另一种解决方案的替代方案,例如 no
我刚开始学习编程,正在尝试完成 Swift 编程书中的实验。 它要求““编写一个函数,通过比较两个 Rank 值的原始值来比较它们。” enum Rank: Int { case Ace = 1 ca
在您将此问题标记为重复之前,我检查了 this question 它对我不起作用。 如何修复这个错误: error: SWIFT_VERSION '5.0' is unsupported, suppo
从 Xcode 9.3 开始,我在我的模型中使用“Swift.ImplicitlyUnwrappedOptional.some”包裹了我的字符串变量 我不知道这是怎么发生的,但它毁了我的应用程序! 我
这个问题在这里已经有了答案: How to include .swift file from other .swift file in an immediate mode? (2 个答案) 关闭 6
我正在使用 Swift Package Manager 创建一个应用程序,我需要知道构建项目的配置,即 Debug 或 Release。我试图避免使用 .xcodeproj 文件。请有人让我知道这是否
有一个带有函数定义的文件bar.swift: func bar() { println("bar") } 以及一个以立即模式运行的脚本foo.swift: #!/usr/bin/xcrun s
我是一名优秀的程序员,十分优秀!