summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@mapbox.com>2018-11-22 00:55:02 -0500
committerJulian Rex <julian.rex@mapbox.com>2019-01-12 14:36:51 -0500
commitdba896ce2ded8df7c8fc4f66aa7bd7dd8f8c4aa0 (patch)
tree7d0d78d9703003f4b0e4201f49d3dc0cb97396fd
parentda5fdf642bae1fd5dc5928fc2627ed3047a8d657 (diff)
downloadqtlocation-mapboxgl-dba896ce2ded8df7c8fc4f66aa7bd7dd8f8c4aa0.tar.gz
Compile fixes following rebase
-rw-r--r--include/mbgl/style/sources/geojson_source.hpp4
-rw-r--r--platform/darwin/src/MGLCluster.mm (renamed from platform/darwin/src/MGLCluster.m)1
-rw-r--r--platform/darwin/src/MGLFoundation_Private.h6
-rw-r--r--platform/darwin/src/MGLShapeSource.mm3
-rw-r--r--platform/darwin/test/MGLCodingTests.mm (renamed from platform/darwin/test/MGLCodingTests.m)1
-rw-r--r--platform/darwin/test/MGLFeatureTests.mm1
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj20
-rw-r--r--src/mbgl/style/sources/geojson_source.cpp4
-rw-r--r--src/mbgl/style/sources/geojson_source_impl.cpp8
-rw-r--r--src/mbgl/style/sources/geojson_source_impl.hpp4
10 files changed, 31 insertions, 21 deletions
diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp
index 36cc9bb4bb..a2c3c8f7d7 100644
--- a/include/mbgl/style/sources/geojson_source.hpp
+++ b/include/mbgl/style/sources/geojson_source.hpp
@@ -35,8 +35,8 @@ public:
void setGeoJSON(const GeoJSON&);
optional<std::string> getURL() const;
- mapbox::geometry::feature_collection<double> getChildren(const std::uint32_t) const;
- mapbox::geometry::feature_collection<double> getLeaves(const std::uint32_t, const std::uint32_t, const std::uint32_t) const;
+ mapbox::feature::feature_collection<double> getChildren(const std::uint32_t) const;
+ mapbox::feature::feature_collection<double> getLeaves(const std::uint32_t, const std::uint32_t, const std::uint32_t) const;
std::uint8_t getClusterExpansionZoom(std::uint32_t) const;
class Impl;
diff --git a/platform/darwin/src/MGLCluster.m b/platform/darwin/src/MGLCluster.mm
index 46c7420cd6..5126c56af6 100644
--- a/platform/darwin/src/MGLCluster.m
+++ b/platform/darwin/src/MGLCluster.mm
@@ -1,3 +1,4 @@
+#import "MGLFoundation_Private.h"
#import "MGLCluster_Private.h"
#import "MGLFeature.h"
#import <objc/runtime.h>
diff --git a/platform/darwin/src/MGLFoundation_Private.h b/platform/darwin/src/MGLFoundation_Private.h
index 71737c2cf9..db81bde3de 100644
--- a/platform/darwin/src/MGLFoundation_Private.h
+++ b/platform/darwin/src/MGLFoundation_Private.h
@@ -11,3 +11,9 @@ void MGLInitializeRunLoop();
(type *)([temp##__LINE__ isKindOfClass:[type class]] ? temp##__LINE__ : nil); \
})
+#define MGL_OBJC_DYNAMIC_CAST_AS_PROTOCOL(object, proto) \
+ ({ \
+ __typeof__( object ) temp##__LINE__ = (object); \
+ (id< proto >)([temp##__LINE__ conformsToProtocol:@protocol( proto )] ? temp##__LINE__ : nil); \
+ })
+
diff --git a/platform/darwin/src/MGLShapeSource.mm b/platform/darwin/src/MGLShapeSource.mm
index c9130d6481..04bd7efde7 100644
--- a/platform/darwin/src/MGLShapeSource.mm
+++ b/platform/darwin/src/MGLShapeSource.mm
@@ -1,3 +1,4 @@
+#import "MGLFoundation_Private.h"
#import "MGLShapeSource_Private.h"
#import "MGLStyle_Private.h"
@@ -233,7 +234,7 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NSDictionary<MGLShap
range:NSMakeRange(0, description.length)];
printf("%*s%s\n", (int)indent, "", log.UTF8String);
-
+
id<MGLCluster> cluster = MGL_OBJC_DYNAMIC_CAST_AS_PROTOCOL(feature, MGLCluster);
if (cluster) {
diff --git a/platform/darwin/test/MGLCodingTests.m b/platform/darwin/test/MGLCodingTests.mm
index 46778f51c9..e8fd0ddf27 100644
--- a/platform/darwin/test/MGLCodingTests.m
+++ b/platform/darwin/test/MGLCodingTests.mm
@@ -1,6 +1,7 @@
#import <Mapbox/Mapbox.h>
#import <XCTest/XCTest.h>
+#import "MGLFoundation_Private.h"
#import "MGLCluster_Private.h"
#if TARGET_OS_IPHONE
diff --git a/platform/darwin/test/MGLFeatureTests.mm b/platform/darwin/test/MGLFeatureTests.mm
index 31150cb565..0d6f4af29d 100644
--- a/platform/darwin/test/MGLFeatureTests.mm
+++ b/platform/darwin/test/MGLFeatureTests.mm
@@ -2,6 +2,7 @@
#import <XCTest/XCTest.h>
#import <mbgl/util/geometry.hpp>
+#import "MGLFoundation_Private.h"
#import "../../darwin/src/MGLFeature_Private.h"
@interface MGLFeatureTests : XCTestCase
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index 94f14ab907..ed803fe107 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -170,7 +170,7 @@
35D13AC61D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35D13AC21D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm */; };
35D3A1E61E9BE7EB002B38EE /* MGLScaleBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 355ADFFB1E9281DA00F3939D /* MGLScaleBar.h */; };
35D3A1E71E9BE7EC002B38EE /* MGLScaleBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 355ADFFB1E9281DA00F3939D /* MGLScaleBar.h */; };
- 35D9DDE21DA25EEC00DAAD69 /* MGLCodingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 35D9DDE11DA25EEC00DAAD69 /* MGLCodingTests.m */; };
+ 35D9DDE21DA25EEC00DAAD69 /* MGLCodingTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35D9DDE11DA25EEC00DAAD69 /* MGLCodingTests.mm */; };
35E0CFE61D3E501500188327 /* MGLStyle_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E0CFE51D3E501500188327 /* MGLStyle_Private.h */; };
35E0CFE71D3E501500188327 /* MGLStyle_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E0CFE51D3E501500188327 /* MGLStyle_Private.h */; };
35E1A4D81D74336F007AA97F /* MGLValueEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E1A4D71D74336F007AA97F /* MGLValueEvaluator.h */; };
@@ -485,8 +485,8 @@
CAA69DA4206DCD0E007279CD /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA4A26961CB6E795000B7809 /* Mapbox.framework */; };
CAA69DA5206DCD0E007279CD /* Mapbox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DA4A26961CB6E795000B7809 /* Mapbox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
CABE5DAD2072FAB40003AF3C /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA8847D21CBAF91600AB86E3 /* Mapbox.framework */; };
- CAE21180216552AE00429B6F /* MGLCluster.m in Sources */ = {isa = PBXBuildFile; fileRef = CAE2117F216552AE00429B6F /* MGLCluster.m */; };
- CAE21181216552AE00429B6F /* MGLCluster.m in Sources */ = {isa = PBXBuildFile; fileRef = CAE2117F216552AE00429B6F /* MGLCluster.m */; };
+ CAE21180216552AE00429B6F /* MGLCluster.mm in Sources */ = {isa = PBXBuildFile; fileRef = CAE2117F216552AE00429B6F /* MGLCluster.mm */; };
+ CAE21181216552AE00429B6F /* MGLCluster.mm in Sources */ = {isa = PBXBuildFile; fileRef = CAE2117F216552AE00429B6F /* MGLCluster.mm */; };
CAE211832165BD0300429B6F /* MGLCluster_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE211822165BD0300429B6F /* MGLCluster_Private.h */; };
CAE211842165BD0300429B6F /* MGLCluster_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE211822165BD0300429B6F /* MGLCluster_Private.h */; };
CAE7AD5520F46EF5003B6782 /* MGLMapSnapshotterSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAE7AD5420F46EF5003B6782 /* MGLMapSnapshotterSwiftTests.swift */; };
@@ -941,7 +941,7 @@
35D13AB61D3D15E300AFB4E0 /* MGLStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleLayer.mm; sourceTree = "<group>"; };
35D13AC11D3D19DD00AFB4E0 /* MGLFillStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFillStyleLayer.h; sourceTree = "<group>"; };
35D13AC21D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFillStyleLayer.mm; sourceTree = "<group>"; };
- 35D9DDE11DA25EEC00DAAD69 /* MGLCodingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLCodingTests.m; path = ../../darwin/test/MGLCodingTests.m; sourceTree = "<group>"; };
+ 35D9DDE11DA25EEC00DAAD69 /* MGLCodingTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLCodingTests.mm; path = ../../darwin/test/MGLCodingTests.mm; sourceTree = "<group>"; };
35DE35531EB7CBA8004917C5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = sv; path = sv.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
35E0CFE51D3E501500188327 /* MGLStyle_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyle_Private.h; sourceTree = "<group>"; };
35E1A4D71D74336F007AA97F /* MGLValueEvaluator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLValueEvaluator.h; sourceTree = "<group>"; };
@@ -1153,7 +1153,7 @@
CA6914B420E67F50002DB0EE /* MGLAnnotationViewIntegrationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLAnnotationViewIntegrationTests.m; path = "Annotation Tests/MGLAnnotationViewIntegrationTests.m"; sourceTree = "<group>"; };
CA88DC2F21C85D900059ED5A /* MGLStyleURLIntegrationTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLStyleURLIntegrationTest.m; sourceTree = "<group>"; };
CA8FBC0821A47BB100D1203C /* MGLRendererConfigurationTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLRendererConfigurationTests.mm; path = ../../darwin/test/MGLRendererConfigurationTests.mm; sourceTree = "<group>"; };
- CAE2117F216552AE00429B6F /* MGLCluster.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLCluster.m; sourceTree = "<group>"; wrapsLines = 0; };
+ CAE2117F216552AE00429B6F /* MGLCluster.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLCluster.mm; sourceTree = "<group>"; wrapsLines = 0; };
CAE211822165BD0300429B6F /* MGLCluster_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCluster_Private.h; sourceTree = "<group>"; };
CAE7AD5320F46EF5003B6782 /* integration-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "integration-Bridging-Header.h"; sourceTree = "<group>"; };
CAE7AD5420F46EF5003B6782 /* MGLMapSnapshotterSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MGLMapSnapshotterSwiftTests.swift; sourceTree = "<group>"; };
@@ -1991,7 +1991,7 @@
353D23951D0B0DFE002BE09D /* MGLAnnotationViewTests.m */,
DAEDC4331D603417000224FF /* MGLAttributionInfoTests.m */,
DA35A2C31CCA9F8300E826B2 /* MGLClockDirectionFormatterTests.m */,
- 35D9DDE11DA25EEC00DAAD69 /* MGLCodingTests.m */,
+ 35D9DDE11DA25EEC00DAAD69 /* MGLCodingTests.mm */,
DA35A2C41CCA9F8300E826B2 /* MGLCompassDirectionFormatterTests.m */,
DA35A2A91CCA058D00E826B2 /* MGLCoordinateFormatterTests.m */,
3598544C1E1D38AA00B29F84 /* MGLDistanceFormatterTests.m */,
@@ -2219,7 +2219,7 @@
DA8847E01CBAFA5100AB86E3 /* MGLAnnotation.h */,
CAE211822165BD0300429B6F /* MGLCluster_Private.h */,
CA42323A2159242400BB7C18 /* MGLCluster.h */,
- CAE2117F216552AE00429B6F /* MGLCluster.m */,
+ CAE2117F216552AE00429B6F /* MGLCluster.mm */,
DAD1656A1CF41981001FF4B9 /* MGLFeature_Private.h */,
DAD165691CF41981001FF4B9 /* MGLFeature.h */,
DAD1656B1CF41981001FF4B9 /* MGLFeature.mm */,
@@ -3097,7 +3097,7 @@
170C437D2029D97900863DF0 /* MGLHeatmapStyleLayerTests.mm in Sources */,
170C437C2029D96F00863DF0 /* MGLHeatmapColorTests.mm in Sources */,
357579801D501E09000B822E /* MGLFillStyleLayerTests.mm in Sources */,
- 35D9DDE21DA25EEC00DAAD69 /* MGLCodingTests.m in Sources */,
+ 35D9DDE21DA25EEC00DAAD69 /* MGLCodingTests.mm in Sources */,
DA1F8F3D1EBD287B00367E42 /* MGLDocumentationGuideTests.swift in Sources */,
076171C32139C70900668A35 /* MGLMapViewTests.m in Sources */,
3598544D1E1D38AA00B29F84 /* MGLDistanceFormatterTests.m in Sources */,
@@ -3212,7 +3212,7 @@
DA8848501CBAFB9800AB86E3 /* MGLAnnotationImage.m in Sources */,
40834BF01FE05E1800C1BD0D /* MMELocationManager.m in Sources */,
DA8848281CBAFA6200AB86E3 /* MGLShape.mm in Sources */,
- CAE21180216552AE00429B6F /* MGLCluster.m in Sources */,
+ CAE21180216552AE00429B6F /* MGLCluster.mm in Sources */,
DA35A2B31CCA141D00E826B2 /* MGLCompassDirectionFormatter.m in Sources */,
DD0902A91DB1929D00C5BDCE /* MGLNetworkConfiguration.m in Sources */,
35D13AB91D3D15E300AFB4E0 /* MGLStyleLayer.mm in Sources */,
@@ -3348,7 +3348,7 @@
40834C041FE05E1800C1BD0D /* MMELocationManager.m in Sources */,
DA35A2B41CCA141D00E826B2 /* MGLCompassDirectionFormatter.m in Sources */,
35D13ABA1D3D15E300AFB4E0 /* MGLStyleLayer.mm in Sources */,
- CAE21181216552AE00429B6F /* MGLCluster.m in Sources */,
+ CAE21181216552AE00429B6F /* MGLCluster.mm in Sources */,
071BBAFF1EE7613E001FB02A /* MGLImageSource.mm in Sources */,
DA35A2CC1CCAAAD200E826B2 /* NSValue+MGLAdditions.m in Sources */,
40834C591FE05F7600C1BD0D /* TSKTrustKitConfig.m in Sources */,
diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp
index 665cc9c0dc..0df72f1ed5 100644
--- a/src/mbgl/style/sources/geojson_source.cpp
+++ b/src/mbgl/style/sources/geojson_source.cpp
@@ -40,11 +40,11 @@ optional<std::string> GeoJSONSource::getURL() const {
return url;
}
-mapbox::geometry::feature_collection<double> GeoJSONSource::getChildren(const std::uint32_t cluster_id) const {
+mapbox::feature::feature_collection<double> GeoJSONSource::getChildren(const std::uint32_t cluster_id) const {
return impl().getData()->getChildren(cluster_id);
}
-mapbox::geometry::feature_collection<double> GeoJSONSource::getLeaves(const std::uint32_t cluster_id,
+mapbox::feature::feature_collection<double> GeoJSONSource::getLeaves(const std::uint32_t cluster_id,
const std::uint32_t limit = 10,
const std::uint32_t offset = 0) const{
return impl().getData()->getLeaves(cluster_id, limit, offset);
diff --git a/src/mbgl/style/sources/geojson_source_impl.cpp b/src/mbgl/style/sources/geojson_source_impl.cpp
index 7e83588c5d..2e29317258 100644
--- a/src/mbgl/style/sources/geojson_source_impl.cpp
+++ b/src/mbgl/style/sources/geojson_source_impl.cpp
@@ -21,11 +21,11 @@ public:
return impl.getTile(tileID.z, tileID.x, tileID.y).features;
}
- mapbox::geometry::feature_collection<double> getChildren(const std::uint32_t) final {
+ mapbox::feature::feature_collection<double> getChildren(const std::uint32_t) final {
return {};
}
- mapbox::geometry::feature_collection<double> getLeaves(const std::uint32_t,
+ mapbox::feature::feature_collection<double> getLeaves(const std::uint32_t,
const std::uint32_t,
const std::uint32_t) final {
return {};
@@ -49,11 +49,11 @@ public:
return impl.getTile(tileID.z, tileID.x, tileID.y);
}
- mapbox::geometry::feature_collection<double> getChildren(const std::uint32_t cluster_id) final {
+ mapbox::feature::feature_collection<double> getChildren(const std::uint32_t cluster_id) final {
return impl.getChildren(cluster_id);
}
- mapbox::geometry::feature_collection<double> getLeaves(const std::uint32_t cluster_id,
+ mapbox::feature::feature_collection<double> getLeaves(const std::uint32_t cluster_id,
const std::uint32_t limit = 10,
const std::uint32_t offset = 0) final {
return impl.getLeaves(cluster_id, limit, offset);
diff --git a/src/mbgl/style/sources/geojson_source_impl.hpp b/src/mbgl/style/sources/geojson_source_impl.hpp
index 4ab529b54b..120e7c2256 100644
--- a/src/mbgl/style/sources/geojson_source_impl.hpp
+++ b/src/mbgl/style/sources/geojson_source_impl.hpp
@@ -17,8 +17,8 @@ public:
virtual mapbox::feature::feature_collection<int16_t> getTile(const CanonicalTileID&) = 0;
// SuperclusterData
- virtual mapbox::geometry::feature_collection<double> getChildren(const std::uint32_t) = 0;
- virtual mapbox::geometry::feature_collection<double> getLeaves(const std::uint32_t, const std::uint32_t,
+ virtual mapbox::feature::feature_collection<double> getChildren(const std::uint32_t) = 0;
+ virtual mapbox::feature::feature_collection<double> getLeaves(const std::uint32_t, const std::uint32_t,
const std::uint32_t) = 0;
virtual std::uint8_t getClusterExpansionZoom(std::uint32_t) = 0;
};