ios - 如何向图层添加个性化注释?地图盒 [斯威夫特]
问题描述
如何向图层添加个性化注释?
我的自定义类:
class PointCustom: NSObject, MGLAnnotation {
var coordinate: CLLocationCoordinate2D
var title: String?
var subtitle: String?
var imageURL: URL?
var typ: PointsType?
var reuseIdentifier: String?
init(coordinate: CLLocationCoordinate2D, title: String?, subtitle: String?, imageURL: URL?, reuseIdentifier: String?, typ: PointsType?) {
self.coordinate = coordinate
self.title = title
self.subtitle = subtitle
self.imageURL = imageURL
self.reuseIdentifier = reuseIdentifier
self.typ = typ
}
}
let points = parsePoints()
let source = MGLShapeSource(identifier: "points", features: points, options: nil)
问题:无法将类型“[PointCustom]”的值转换为预期的参数类型“MGLShape?”
解决方案
推荐阅读
- ansible - Ansible 嵌套列表到 jinja 模板
- python - 我在使用 beautifulsoup 解析来自 html 的数据时遇到问题
- python - 在 matplotlib 中的 savefig 期间引发 Python 类型错误
- java - 在@Transactional 测试期间了解@EntityListener 的行为
- reactjs - 我应该如何管理在 React JS 中动态添加的多个选择字段?
- r - R中的grepl()使用具有多个AND,OR的复杂模式
- python - AWS Lambda 错误(未安装 tesseract)
- android - React Native Expo (Android) 本地化 - 默认为 92(全部?)本地化
- c# - 对不使用 IDisposable 的框架组件使用 .NET 分析器规则 CA1001
- vue.js - 如何在引导 vue 中输入标签时显示建议列表?