diff options
author | jmkiley <jordan.kiley@mapbox.com> | 2019-10-10 11:04:39 -0700 |
---|---|---|
committer | jmkiley <jordan.kiley@mapbox.com> | 2019-10-10 13:44:13 -0700 |
commit | 81aa9b63a7575fce825277639588b1c10fc31051 (patch) | |
tree | 66ea5ae85067ce2fbe727e904eca4a932f61f5d8 | |
parent | e7ad9f588d94485d7294bc5afcf6814d5b96349f (diff) | |
download | qtlocation-mapboxgl-81aa9b63a7575fce825277639588b1c10fc31051.tar.gz |
[ios] use options
-rw-r--r-- | platform/darwin/test/MGLDocumentationExampleTests.swift | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift index 9505b144d9..c049b8106e 100644 --- a/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/darwin/test/MGLDocumentationExampleTests.swift @@ -567,6 +567,27 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { let options : [MGLShapeSourceOption : Any] = [.clustered : true, .clusterProperties: clusterPropertiesDictionary] //#-end-example-code + let geoJSON: [String: Any] = [ + "type" : "Feature", + "geometry" : [ + "coordinates" : [ + -77.00896639534831, + 38.87031006108791, + 0.0 + ], + "type" : "Point" + ], + "properties" : [ + "cluster" : true, + "cluster_id" : 123, + "point_count" : 4567, + ] + ] + + let clusterShapeData = try! JSONSerialization.data(withJSONObject: geoJSON, options: []) + let shape = MGLShape(data: clusterShapeData, encoding: String.Encoding.utf8.rawValue) + let source = MGLShapeSource(identifier: "source", shape: shape, options: options) + mapView.style?.addSource(source) } // For testMGLMapView(). |