Merge branch 'release-boba' into master

# Conflicts:
#	mapbox-gl-js
#	platform/android/CHANGELOG.md
#	platform/android/MapboxGLAndroidSDK/gradle.properties
#	platform/android/gradle/dependencies.gradle
#	platform/darwin/src/MGLVectorTileSource.mm
#	platform/darwin/src/MGLVectorTileSource_Private.h
#	platform/ios/CHANGELOG.md
#	src/mbgl/style/expression/compound_expression.cpp
This commit is contained in:
Fabian Guerra
2018-05-17 11:47:31 -04:00
143 changed files with 2541 additions and 1936 deletions

View File

@@ -46,6 +46,7 @@ type = STRINGS
[mapbox-gl-native.stringsxml-android]
file_filter = platform/android/MapboxGLAndroidSDK/src/main/res/values-<lang>/strings.xml
lang_map = pt_PT: pt-rPT
source_file = platform/android/MapboxGLAndroidSDK/src/main/res/values/strings.xml
source_lang = en
type = ANDROID

View File

@@ -1,7 +1,6 @@
#include <benchmark/benchmark.h>
#include <mbgl/style/filter.hpp>
#include <mbgl/style/filter_evaluator.hpp>
#include <mbgl/style/conversion.hpp>
#include <mbgl/style/conversion/json.hpp>
#include <mbgl/style/conversion/filter.hpp>

View File

@@ -358,7 +358,7 @@ jobs:
gcloud firebase test android run --type instrumentation \
--app platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/debug/MapboxGLAndroidSDKTestApp-debug.apk \
--test platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/androidTest/debug/MapboxGLAndroidSDKTestApp-debug-androidTest.apk \
--device-ids sailfish --os-version-ids 26 --locales en --orientations portrait --timeout 20m
--device-ids sailfish --os-version-ids 26 --locales en --orientations portrait --timeout 20m
- store_artifacts:
path: platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/debug
destination: .

View File

@@ -360,7 +360,6 @@ set(MBGL_CORE_FILES
include/mbgl/style/conversion.hpp
include/mbgl/style/data_driven_property_value.hpp
include/mbgl/style/filter.hpp
include/mbgl/style/filter_evaluator.hpp
include/mbgl/style/heatmap_color_property_value.hpp
include/mbgl/style/image.hpp
include/mbgl/style/layer.hpp
@@ -377,7 +376,6 @@ set(MBGL_CORE_FILES
src/mbgl/style/custom_tile_loader.cpp
src/mbgl/style/custom_tile_loader.hpp
src/mbgl/style/filter.cpp
src/mbgl/style/filter_evaluator.cpp
src/mbgl/style/image.cpp
src/mbgl/style/image_impl.cpp
src/mbgl/style/image_impl.hpp

View File

@@ -36,7 +36,7 @@ template <typename T>
struct Varargs : std::vector<T> { using std::vector<T>::vector; };
namespace detail {
// Base class for the Signature<Fn> structs that are used to determine the
// Base class for the Signature<Fn> structs that are used to determine
// each CompoundExpression definition's type::Type data from the type of its
// "evaluate" function.
struct SignatureBase {
@@ -137,10 +137,21 @@ ParseResult parseCompoundExpression(const std::string name, const mbgl::style::c
ParseResult createCompoundExpression(const CompoundExpressionRegistry::Definition& definition,
std::vector<std::unique_ptr<Expression>> args,
ParsingContext& ctx);
ParseResult createCompoundExpression(const std::string& name,
std::vector<std::unique_ptr<Expression>> args,
ParsingContext& ctx);
// Convenience method for use expressions that have 0, 1, or 2 args.
ParseResult createCompoundExpression(const std::string& name, ParsingContext& ctx);
ParseResult createCompoundExpression(const std::string& name,
std::unique_ptr<Expression> arg1,
ParsingContext& ctx);
ParseResult createCompoundExpression(const std::string& name,
std::unique_ptr<Expression> arg1,
std::unique_ptr<Expression> arg2,
ParsingContext& ctx);
} // namespace expression
} // namespace style

View File

@@ -51,6 +51,9 @@ private:
Value value;
};
std::unique_ptr<Literal> createLiteral(const char* value);
std::unique_ptr<Literal> createLiteral(Value value);
} // namespace expression
} // namespace style
} // namespace mbgl

View File

@@ -11,270 +11,30 @@
namespace mbgl {
namespace style {
class Filter;
class NullFilter {
public:
friend bool operator==(const NullFilter&, const NullFilter&) {
return true;
}
};
class EqualsFilter {
public:
std::string key;
Value value;
friend bool operator==(const EqualsFilter& lhs, const EqualsFilter& rhs) {
return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value);
}
};
class NotEqualsFilter {
public:
std::string key;
Value value;
friend bool operator==(const NotEqualsFilter& lhs, const NotEqualsFilter& rhs) {
return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value);
}
};
class LessThanFilter {
public:
std::string key;
Value value;
friend bool operator==(const LessThanFilter& lhs, const LessThanFilter& rhs) {
return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value);
}
};
class LessThanEqualsFilter {
public:
std::string key;
Value value;
friend bool operator==(const LessThanEqualsFilter& lhs, const LessThanEqualsFilter& rhs) {
return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value);
}
};
class GreaterThanFilter {
public:
std::string key;
Value value;
friend bool operator==(const GreaterThanFilter& lhs, const GreaterThanFilter& rhs) {
return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value);
}
};
class GreaterThanEqualsFilter {
public:
std::string key;
Value value;
friend bool operator==(const GreaterThanEqualsFilter& lhs, const GreaterThanEqualsFilter& rhs) {
return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value);
}
};
class InFilter {
public:
std::string key;
std::vector<Value> values;
friend bool operator==(const InFilter& lhs, const InFilter& rhs) {
return std::tie(lhs.key, lhs.values) == std::tie(rhs.key, rhs.values);
}
};
class NotInFilter {
public:
std::string key;
std::vector<Value> values;
friend bool operator==(const NotInFilter& lhs, const NotInFilter& rhs) {
return std::tie(lhs.key, lhs.values) == std::tie(rhs.key, rhs.values);
}
};
class AnyFilter {
public:
std::vector<Filter> filters;
friend bool operator==(const AnyFilter& lhs, const AnyFilter& rhs) {
return lhs.filters == rhs.filters;
}
};
class AllFilter {
public:
std::vector<Filter> filters;
friend bool operator==(const AllFilter& lhs, const AllFilter& rhs) {
return lhs.filters == rhs.filters;
}
};
class NoneFilter {
public:
std::vector<Filter> filters;
friend bool operator==(const NoneFilter& lhs, const NoneFilter& rhs) {
return lhs.filters == rhs.filters;
}
};
class HasFilter {
public:
std::string key;
friend bool operator==(const HasFilter& lhs, const HasFilter& rhs) {
return lhs.key == rhs.key;
}
};
class NotHasFilter {
public:
std::string key;
friend bool operator==(const NotHasFilter& lhs, const NotHasFilter& rhs) {
return lhs.key == rhs.key;
}
};
class TypeEqualsFilter {
public:
FeatureType value;
friend bool operator==(const TypeEqualsFilter& lhs, const TypeEqualsFilter& rhs) {
return lhs.value == rhs.value;
}
};
class TypeNotEqualsFilter {
public:
FeatureType value;
friend bool operator==(const TypeNotEqualsFilter& lhs, const TypeNotEqualsFilter& rhs) {
return lhs.value == rhs.value;
}
};
class TypeInFilter {
public:
std::vector<FeatureType> values;
friend bool operator==(const TypeInFilter& lhs, const TypeInFilter& rhs) {
return lhs.values == rhs.values;
}
};
class TypeNotInFilter {
public:
std::vector<FeatureType> values;
friend bool operator==(const TypeNotInFilter& lhs, const TypeNotInFilter& rhs) {
return lhs.values == rhs.values;
}
};
class IdentifierEqualsFilter {
public:
FeatureIdentifier value;
friend bool operator==(const IdentifierEqualsFilter& lhs, const IdentifierEqualsFilter& rhs) {
return lhs.value == rhs.value;
}
};
class IdentifierNotEqualsFilter {
public:
FeatureIdentifier value;
friend bool operator==(const IdentifierNotEqualsFilter& lhs, const IdentifierNotEqualsFilter& rhs) {
return lhs.value == rhs.value;
}
};
class IdentifierInFilter {
public:
std::vector<FeatureIdentifier> values;
friend bool operator==(const IdentifierInFilter& lhs, const IdentifierInFilter& rhs) {
return lhs.values == rhs.values;
}
};
class IdentifierNotInFilter {
public:
std::vector<FeatureIdentifier> values;
friend bool operator==(const IdentifierNotInFilter& lhs, const IdentifierNotInFilter& rhs) {
return lhs.values == rhs.values;
}
};
class HasIdentifierFilter {
public:
friend bool operator==(const HasIdentifierFilter&, const HasIdentifierFilter&) {
return true;
}
};
class NotHasIdentifierFilter {
public:
friend bool operator==(const NotHasIdentifierFilter&, const NotHasIdentifierFilter&) {
return true;
}
};
class ExpressionFilter {
class Filter {
public:
std::shared_ptr<const expression::Expression> expression;
optional<std::shared_ptr<const expression::Expression>> expression;
friend bool operator==(const ExpressionFilter& lhs, const ExpressionFilter& rhs) {
return *(lhs.expression) == *(rhs.expression);
Filter() : expression() {}
Filter(expression::ParseResult _expression) : expression(std::move(*_expression)) {
assert(!expression || *expression != nullptr);
}
};
using FilterBase = variant<
class NullFilter,
class EqualsFilter,
class NotEqualsFilter,
class LessThanFilter,
class LessThanEqualsFilter,
class GreaterThanFilter,
class GreaterThanEqualsFilter,
class InFilter,
class NotInFilter,
class AnyFilter,
class AllFilter,
class NoneFilter,
class HasFilter,
class NotHasFilter,
class TypeEqualsFilter,
class TypeNotEqualsFilter,
class TypeInFilter,
class TypeNotInFilter,
class IdentifierEqualsFilter,
class IdentifierNotEqualsFilter,
class IdentifierInFilter,
class IdentifierNotInFilter,
class HasIdentifierFilter,
class NotHasIdentifierFilter,
class ExpressionFilter>;
class Filter : public FilterBase {
public:
using FilterBase::FilterBase;
bool operator()(const expression::EvaluationContext& context) const;
friend bool operator==(const Filter& lhs, const Filter& rhs) {
if (!lhs.expression || !rhs.expression) {
return lhs.expression == rhs.expression;
} else {
return *(lhs.expression) == *(rhs.expression);
}
}
friend bool operator!=(const Filter& lhs, const Filter& rhs) {
return !(lhs == rhs);
}
};
} // namespace style

View File

@@ -1,55 +0,0 @@
#pragma once
#include <mbgl/style/filter.hpp>
#include <mbgl/util/geometry.hpp>
#include <type_traits>
namespace mbgl {
namespace style {
/*
A visitor that evaluates a `Filter` for a given feature.
Use via `Filter::operator()`. For example:
if (filter(feature)) {
// matches the filter
} else {
// does not match
}
*/
class FilterEvaluator {
public:
const expression::EvaluationContext context;
bool operator()(const NullFilter&) const;
bool operator()(const EqualsFilter& filter) const;
bool operator()(const NotEqualsFilter& filter) const;
bool operator()(const LessThanFilter& filter) const;
bool operator()(const LessThanEqualsFilter& filter) const;
bool operator()(const GreaterThanFilter& filter) const;
bool operator()(const GreaterThanEqualsFilter& filter) const;
bool operator()(const InFilter& filter) const;
bool operator()(const NotInFilter& filter) const;
bool operator()(const AnyFilter& filter) const;
bool operator()(const AllFilter& filter) const;
bool operator()(const NoneFilter& filter) const;
bool operator()(const HasFilter& filter) const;
bool operator()(const NotHasFilter& filter) const;
bool operator()(const TypeEqualsFilter& filter) const;
bool operator()(const TypeNotEqualsFilter& filter) const;
bool operator()(const TypeInFilter& filter) const;
bool operator()(const TypeNotInFilter& filter) const;
bool operator()(const IdentifierEqualsFilter& filter) const;
bool operator()(const IdentifierNotEqualsFilter& filter) const;
bool operator()(const IdentifierInFilter& filter) const;
bool operator()(const IdentifierNotInFilter& filter) const;
bool operator()(const HasIdentifierFilter&) const;
bool operator()(const NotHasIdentifierFilter&) const;
bool operator()(const ExpressionFilter&) const;
};
} // namespace style
} // namespace mbgl

View File

@@ -2,6 +2,12 @@
Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started.
## 6.1.2
- `"to-string"` expression operator converts `null` to empty string rather than to `"null"` [#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904)
## 6.1.1 - May 7, 2018
- Update telemetry to 3.1.0 [#11855](https://github.com/mapbox/mapbox-gl-native/pull/11855)
## 6.1.0 - May 4, 2018
- Unwrap LatLngBounds during JNI conversion [#11807](https://github.com/mapbox/mapbox-gl-native/pull/11807)
- Check if renderer is not destroyed before delivering snapshot [#11800](https://github.com/mapbox/mapbox-gl-native/pull/11800)

View File

@@ -1,5 +1,5 @@
GROUP=com.mapbox.mapboxsdk
VERSION_NAME=7.0.0-SNAPSHOT
VERSION_NAME=6.2.0-SNAPSHOT
POM_DESCRIPTION=Mapbox GL Android SDK
POM_URL=https://github.com/mapbox/mapbox-gl-native

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="mapbox_compassContentDescription">지도 나침반. 지도회전를 북쪽으로 재설정합니다.</string>
<string name="mapbox_attributionsIconContentDescription">속성 정보. 속성 대화를 표시합니다.</string>
<string name="mapbox_myLocationViewContentDescription">로케이션 뷰. 지도에서 현재 위치를 보여줍니다.</string>
<string name="mapbox_mapActionDescription">맵박스로 생성된 지도 표시. 두 손가락으로 드래그하여 화면을 위 아래로 움직이세요. 두 손가락을 이용해 화면을 확대 축소 하세요.</string>
<string name="mapbox_attributionsDialogTitle">안드로이드를 위한 맵박스 맵 SDK</string>
<string name="mapbox_attributionTelemetryTitle">더 나은 맵박스 지도 만들기</string>
<string name="mapbox_attributionTelemetryMessage">당신은 익명의 사용 데이터를 제공함으로써, 오픈스트리트맵과 맵박스 향상에 기여하고 있습니다.</string>
<string name="mapbox_attributionTelemetryPositive">동의</string>
<string name="mapbox_attributionTelemetryNegative">비동의</string>
<string name="mapbox_attributionTelemetryNeutral">추가정보</string>
<string name="mapbox_attributionErrorNoBrowser">웹 브라우저가 설치 되어 있지 않아, 웹 페이지를 열 수 없습니다.</string>
<string name="mapbox_offline_error_region_definition_invalid">제공된 오프라인지역정의가 월드바운즈에 적합하지 않습니다: %s</string>
<string name="mapbox_telemetrySettings">원격 측정 설정</string>
</resources>

View File

@@ -14,7 +14,8 @@ allprojects {
mavenCentral()
jcenter()
google()
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
// Snapshot repository
//maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
}

View File

@@ -157,14 +157,12 @@ namespace android {
using namespace mbgl::style::conversion;
Filter filter = layer.accept(GetFilterEvaluator());
jni::Object<gson::JsonElement> converted;
if (filter.is<ExpressionFilter>()) {
ExpressionFilter filterExpression = filter.get<ExpressionFilter>();
mbgl::Value expressionValue = filterExpression.expression.get()->serialize();
converted = gson::JsonElement::New(env, expressionValue);
if (filter.expression) {
mbgl::Value expressionValue = (*filter.expression)->serialize();
return gson::JsonElement::New(env, expressionValue);
} else {
return jni::Object<gson::JsonElement>();
}
return converted;
}
struct SetSourceLayerEvaluator {

View File

@@ -1,7 +1,5 @@
#import "LimeGreenStyleLayer.h"
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
@import GLKit;
@implementation LimeGreenStyleLayer {
GLuint _program;
@@ -12,8 +10,8 @@
}
- (void)didMoveToMapView:(MGLMapView *)mapView {
static const GLchar *vertexShaderSource = "attribute vec2 a_pos; void main() { gl_Position = vec4(a_pos, 0, 1); }";
static const GLchar *fragmentShaderSource = "void main() { gl_FragColor = vec4(0, 1, 0, 1); }";
static const GLchar *vertexShaderSource = "attribute vec2 a_pos; void main() { gl_Position = vec4(a_pos, 1, 1); }";
static const GLchar *fragmentShaderSource = "void main() { gl_FragColor = vec4(0, 0.5, 0, 0.5); }";
_program = glCreateProgram();
_vertexShader = glCreateShader(GL_VERTEX_SHADER);
@@ -28,10 +26,10 @@
glLinkProgram(_program);
_aPos = glGetAttribLocation(_program, "a_pos");
GLfloat background[] = { -1,-1, 1,-1, -1,1, 1,1 };
GLfloat triangle[] = { 0, 0.5, 0.5, -0.5, -0.5, -0.5 };
glGenBuffers(1, &_buffer);
glBindBuffer(GL_ARRAY_BUFFER, _buffer);
glBufferData(GL_ARRAY_BUFFER, 8 * sizeof(GLfloat), background, GL_STATIC_DRAW);
glBufferData(GL_ARRAY_BUFFER, 6 * sizeof(GLfloat), triangle, GL_STATIC_DRAW);
}
- (void)drawInMapView:(MGLMapView *)mapView withContext:(MGLStyleLayerDrawingContext)context {
@@ -41,7 +39,7 @@
glVertexAttribPointer(_aPos, 2, GL_FLOAT, GL_FALSE, 0, NULL);
glDisable(GL_STENCIL_TEST);
glDisable(GL_DEPTH_TEST);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
}
- (void)willMoveFromMapView:(MGLMapView *)mapView {

View File

@@ -272,7 +272,7 @@ Each property representing a layout or paint attribute is set to an
but you create the former using a very different syntax. `NSExpression`’s format
string syntax is reminiscent of a spreadsheet formula or an expression in a
database query. See the
“[Predicates and Expressions](Predicates and Expressions.md)” guide for an
“[Predicates and Expressions](predicates-and-expressions.html)” guide for an
overview of the expression support in this SDK. This SDK no longer supports
style functions; use expressions instead.
@@ -335,7 +335,7 @@ In style specification | Method, function, or predicate type | Format string syn
`number` | |
`string` | |
`to-boolean` | `boolValue` |
`to-color` | |
`to-color` | | `CAST(var, '<%- cocoaPrefix %>Color')`
`to-number` | `mgl_numberWithFallbackValues:` | `CAST(zipCode, 'NSNumber')`
`to-string` | `stringValue` | `CAST(ele, 'NSString')`
`typeof` | |
@@ -372,7 +372,7 @@ In style specification | Method, function, or predicate type | Format string syn
`rgb` | `+[UIColor colorWithRed:green:blue:alpha:]` |
`rgba` | `+[UIColor colorWithRed:green:blue:alpha:]` |
<% } -%>
`to-rgba` | |
`to-rgba` | | `CAST(noindex(var), 'NSArray')`
`-` | `from:subtract:` | `2 - 1`
`*` | `multiply:by:` | `1 * 2`
`/` | `divide:by:` | `1 / 2`
@@ -427,5 +427,5 @@ In style JSON | In the format string
`["any", f0, …, fn]` | `p0 OR … OR pn`
`["none", f0, …, fn]` | `NOT (p0 OR … OR pn)`
See the “[Predicates and Expressions](Predicates and Expressions.md)” guide for
See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for
a full description of the supported operators and operand types.

View File

@@ -70,6 +70,8 @@ path or variable into a matching type:
* To cast a value to a number, use `CAST(key, 'NSNumber')`.
* To cast a value to a string, use `CAST(key, 'NSString')`.
* To cast a value to a color, use `CAST(key, 'UIColor')` on iOS and `CAST(key, 'NSColor')` on macOS.
* To cast an `NSColor` or `UIColor` object to an array, use `CAST(noindex(color), 'NSArray')`.
For details about the predicate format string syntax, consult the “Predicate
Format String Syntax” chapter of the

View File

@@ -0,0 +1,297 @@
/* Clock position format, long: {hours} o’clock */
"CLOCK_FMT_LONG" = "%@ 시";
/* Clock position format, medium: {hours} o’clock */
"CLOCK_FMT_MEDIUM" = "%@ 시";
/* Clock position format, short: {hours}:00 */
"CLOCK_FMT_SHORT" = "%@:00";
/* East, long */
"COMPASS_E_LONG" = "동쪽";
/* East, short */
"COMPASS_E_SHORT" = "동";
/* East by north, long */
"COMPASS_EbN_LONG" = "동미북쪽";
/* East by north, short */
"COMPASS_EbN_SHORT" = "동미북";
/* East by south, long */
"COMPASS_EbS_LONG" = "동미남쪽";
/* East by south, short */
"COMPASS_EbS_SHORT" = "동미남";
/* East-northeast, long */
"COMPASS_ENE_LONG" = "동북동쪽";
/* East-northeast, short */
"COMPASS_ENE_SHORT" = "동북동";
/* East-southeast, long */
"COMPASS_ESE_LONG" = "동남동쪽";
/* East-southeast, short */
"COMPASS_ESE_SHORT" = "동남동";
/* North, long */
"COMPASS_N_LONG" = "북쪽";
/* North, short */
"COMPASS_N_SHORT" = "북";
/* North by east, long */
"COMPASS_NbE_LONG" = "북미동쪽";
/* North by east, short */
"COMPASS_NbE_SHORT" = "북미동";
/* North by west, long */
"COMPASS_NbW_LONG" = "북미서쪽";
/* North by west, short */
"COMPASS_NbW_SHORT" = "북미서";
/* Northeast, long */
"COMPASS_NE_LONG" = "북동쪽";
/* Northeast, short */
"COMPASS_NE_SHORT" = "북동";
/* Northeast by east, long */
"COMPASS_NEbE_LONG" = "북동미동쪽";
/* Northeast by east, short */
"COMPASS_NEbE_SHORT" = "북동미동";
/* Northeast by north, long */
"COMPASS_NEbN_LONG" = "북동미북쪽";
/* Northeast by north, short */
"COMPASS_NEbN_SHORT" = "북동미북";
/* North-northeast, long */
"COMPASS_NNE_LONG" = "북북동쪽";
/* North-northeast, short */
"COMPASS_NNE_SHORT" = "북북동";
/* North-northwest, long */
"COMPASS_NNW_LONG" = "북북서쪽";
/* North-northwest, short */
"COMPASS_NNW_SHORT" = "북북서";
/* Northwest, long */
"COMPASS_NW_LONG" = "북서쪽";
/* Northwest, short */
"COMPASS_NW_SHORT" = "북서";
/* Northwest by north, long */
"COMPASS_NWbN_LONG" = "북서미북쪽";
/* Northwest by north, short */
"COMPASS_NWbN_SHORT" = "북서미북";
/* Northwest by west, long */
"COMPASS_NWbW_LONG" = "북서미서쪽";
/* Northwest by west, short */
"COMPASS_NWbW_SHORT" = "북서미서";
/* South, long */
"COMPASS_S_LONG" = "남쪽";
/* South, short */
"COMPASS_S_SHORT" = "남";
/* South by east, long */
"COMPASS_SbE_LONG" = "남미동쪽";
/* South by east, short */
"COMPASS_SbE_SHORT" = "남미동";
/* South by west, long */
"COMPASS_SbW_LONG" = "남미서";
/* South by west, short */
"COMPASS_SbW_SHORT" = "남미서";
/* Southeast, long */
"COMPASS_SE_LONG" = "남동쪽";
/* Southeast, short */
"COMPASS_SE_SHORT" = "남동";
/* Southeast by east, long */
"COMPASS_SEbE_LONG" = "남동미동쪽";
/* Southeast by east, short */
"COMPASS_SEbE_SHORT" = "남동미동";
/* Southeast by south, long */
"COMPASS_SEbS_LONG" = "남동미남쪽";
/* Southeast by south, short */
"COMPASS_SEbS_SHORT" = "남동미남";
/* South-southeast, long */
"COMPASS_SSE_LONG" = "남남동쪽";
/* South-southeast, short */
"COMPASS_SSE_SHORT" = "남남동";
/* South-southwest, long */
"COMPASS_SSW_LONG" = "남남서쪽";
/* South-southwest, short */
"COMPASS_SSW_SHORT" = "남남서";
/* Southwest, long */
"COMPASS_SW_LONG" = "남서쪽";
/* Southwest, short */
"COMPASS_SW_SHORT" = "남서";
/* Southwest by south, long */
"COMPASS_SWbS_LONG" = "남서미남쪽";
/* Southwest by south, short */
"COMPASS_SWbS_SHORT" = "남서미남";
/* Southwest by west, long */
"COMPASS_SWbW_LONG" = "남서미서쪽";
/* Southwest by west, short */
"COMPASS_SWbW_SHORT" = "남서미서";
/* West, long */
"COMPASS_W_LONG" = "서쪽";
/* West, short */
"COMPASS_W_SHORT" = "서";
/* West by north, long */
"COMPASS_WbN_LONG" = "서미북쪽";
/* West by north, short */
"COMPASS_WbN_SHORT" = "서미북";
/* West by south, long */
"COMPASS_WbS_LONG" = "서미남쪽";
/* West by south, short */
"COMPASS_WbS_SHORT" = "서미남";
/* West-northwest, long */
"COMPASS_WNW_LONG" = "서북서쪽";
/* West-northwest, short */
"COMPASS_WNW_SHORT" = "서북서";
/* West-southwest, long */
"COMPASS_WSW_LONG" = "서남서쪽";
/* West-southwest, short */
"COMPASS_WSW_SHORT" = "서남서";
/* Degrees format, long */
"COORD_DEG_LONG" = "%d 도";
/* Degrees format, medium: {degrees} */
"COORD_DEG_MEDIUM" = "%d°";
/* Degrees format, short: {degrees} */
"COORD_DEG_SHORT" = "%d°";
/* Coordinate format, long: {degrees}{minutes} */
"COORD_DM_LONG" = "%1$@ 와 %2$@";
/* Coordinate format, medium: {degrees}{minutes} */
"COORD_DM_MEDIUM" = "%1$@%2$@";
/* Coordinate format, short: {degrees}{minutes} */
"COORD_DM_SHORT" = "%1$@%2$@";
/* Coordinate format, long: {degrees}{minutes}{seconds} */
"COORD_DMS_LONG" = "%1$@, %2$@, 와 %3$@";
/* Coordinate format, medium: {degrees}{minutes}{seconds} */
"COORD_DMS_MEDIUM" = "%1$@%2$@%3$@";
/* Coordinate format, short: {degrees}{minutes}{seconds} */
"COORD_DMS_SHORT" = "%1$@%2$@%3$@";
/* East longitude format, long: {longitude} */
"COORD_E_LONG" = "%@ 동쪽";
/* East longitude format, medium: {longitude} */
"COORD_E_MEDIUM" = "%@ 동쪽";
/* East longitude format, short: {longitude} */
"COORD_E_SHORT" = "%@동";
/* Coordinate pair format, long: {latitude}, {longitude} */
"COORD_FMT_LONG" = "%1$@ by %2$@";
/* Coordinate pair format, medium: {latitude}, {longitude} */
"COORD_FMT_MEDIUM" = "%1$@, %2$@";
/* Coordinate pair format, short: {latitude}, {longitude} */
"COORD_FMT_SHORT" = "%1$@, %2$@";
/* Minutes format, long */
"COORD_MIN_LONG" = "%d 분";
/* Minutes format, medium: {minutes} */
"COORD_MIN_MEDIUM" = "%d′";
/* Minutes format, short: {minutes} */
"COORD_MIN_SHORT" = "%d′";
/* North latitude format, long: {latitude} */
"COORD_N_LONG" = "%@ 북쪽";
/* North latitude format, medium: {latitude} */
"COORD_N_MEDIUM" = "%@ 북쪽";
/* North latitude format, short: {latitude} */
"COORD_N_SHORT" = "%@북";
/* South latitude format, long: {latitude} */
"COORD_S_LONG" = "%@ 남쪽";
/* South latitude format, medium: {latitude} */
"COORD_S_MEDIUM" = "%@ 남쪽";
/* South latitude format, short: {latitude} */
"COORD_S_SHORT" = "%@남";
/* Seconds format, long */
"COORD_SEC_LONG" = "%d 초";
/* Seconds format, medium: {seconds} */
"COORD_SEC_MEDIUM" = "%d″";
/* Seconds format, short: {seconds} */
"COORD_SEC_SHORT" = "%d″";
/* West longitude format, long: {longitude} */
"COORD_W_LONG" = "%@ 서쪽";
/* West longitude format, medium: {longitude} */
"COORD_W_MEDIUM" = "%@ 서쪽";
/* West longitude format, short: {longitude} */
"COORD_W_SHORT" = "%@서";
/* OpenStreetMap full name attribution */
"OSM_FULL_NAME" = "오픈스트리트맵";
/* OpenStreetMap short name attribution */
"OSM_SHORT_NAME" = "오픈스트리트맵";

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>COORD_DEG_LONG</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@degrees@</string>
<key>degrees</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>other</key>
<string>%d 도</string>
</dict>
</dict>
<key>COORD_MIN_LONG</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@minutes@</string>
<key>minutes</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>other</key>
<string>%d 분</string>
</dict>
</dict>
<key>COORD_SEC_LONG</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@seconds@</string>
<key>seconds</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>other</key>
<string>%d 초</string>
</dict>
</dict>
</dict>
</plist>

View File

@@ -408,7 +408,7 @@ global.describeValue = function (value, property, layerType) {
case 'boolean':
return value ? '`YES`' : '`NO`';
case 'number':
return 'the float ' + formatNumber(value);
return 'the float ' + '`' + formatNumber(value) + '`';
case 'string':
if (value === '') {
return 'the empty string';

View File

@@ -96,7 +96,7 @@ which it is added.
The opacity at which the background will be drawn.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:

View File

@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"

View File

@@ -117,7 +117,7 @@ MGL_EXPORT
full opacity.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -186,7 +186,7 @@ MGL_EXPORT
The opacity at which the circle will be drawn.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -235,7 +235,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
5. Set this property to `nil` to reset it to the default value.
`5`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -334,7 +334,7 @@ MGL_EXPORT
The opacity of the circle's stroke.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -361,7 +361,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:

View File

@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"
@@ -75,7 +75,7 @@ namespace mbgl {
{
MGLAssertStyleLayerIsValid();
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::NullFilter());
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::Filter());
}
- (NSPredicate *)predicate

View File

@@ -78,7 +78,7 @@ MGL_EXPORT
This property is measured in meters.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `fillExtrusionHeight` is
non-`nil`. Otherwise, it is ignored.
@@ -164,7 +164,7 @@ MGL_EXPORT
This property is measured in meters.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -189,7 +189,7 @@ MGL_EXPORT
per-layer, not per-feature, basis, and data-driven styling is not available.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:

View File

@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"
@@ -65,7 +65,7 @@ namespace mbgl {
{
MGLAssertStyleLayerIsValid();
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::NullFilter());
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::Filter());
}
- (NSPredicate *)predicate

View File

@@ -151,7 +151,7 @@ MGL_EXPORT
value will also affect the 1pt stroke around the fill, if the stroke is used.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:

View File

@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"
@@ -65,7 +65,7 @@ namespace mbgl {
{
MGLAssertStyleLayerIsValid();
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::NullFilter());
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::Filter());
}
- (NSPredicate *)predicate

View File

@@ -71,6 +71,17 @@ NS_INLINE MGLCoordinateQuad MGLCoordinateQuadFromLatLngArray(std::array<mbgl::La
MGLLocationCoordinate2DFromLatLng(quad[1]) };
}
/**
YES if the coordinate is valid or NO if it is not.
Considers extended coordinates.
*/
NS_INLINE BOOL MGLLocationCoordinate2DIsValid(CLLocationCoordinate2D coordinate) {
return (coordinate.latitude <= 90.0 &&
coordinate.latitude >= -90.0 &&
coordinate.longitude <= 360.0 &&
coordinate.longitude >= -360.0);
}
#if TARGET_OS_IPHONE
NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(UIEdgeInsets insets) {
return { insets.top, insets.left, insets.bottom, insets.right };

View File

@@ -116,7 +116,7 @@ MGL_EXPORT
Primarily used for adjusting the heatmap based on zoom level.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -142,7 +142,7 @@ MGL_EXPORT
The global opacity at which the heatmap layer will be drawn.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -171,7 +171,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
30. Set this property to `nil` to reset it to the default value.
`30`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -197,7 +197,7 @@ MGL_EXPORT
Especially useful when combined with clustering.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:

View File

@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"
@@ -56,7 +56,7 @@
{
MGLAssertStyleLayerIsValid();
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::NullFilter());
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::Filter());
}
- (NSPredicate *)predicate

View File

@@ -130,7 +130,7 @@ MGL_EXPORT
Intensity of the hillshade
The default value of this property is an expression that evaluates to the float
0.5. Set this property to `nil` to reset it to the default value.
`0.5`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -232,7 +232,7 @@ MGL_EXPORT
`hillshadeIlluminationAnchor` is set to `MGLHillshadeIlluminationAnchorMap`.
The default value of this property is an expression that evaluates to the float
335. Set this property to `nil` to reset it to the default value.
`335`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:

View File

@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"

View File

@@ -188,7 +188,7 @@ MGL_EXPORT
more extreme contrast.
The default value of this property is an expression that evaluates to the float
0.5.
`0.5`.
You can set this property to an expression containing any of the following:

View File

@@ -180,7 +180,7 @@ MGL_EXPORT
Used to automatically convert miter joins to bevel joins for sharp angles.
The default value of this property is an expression that evaluates to the float
2. Set this property to `nil` to reset it to the default value.
`2`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `lineJoin` is set to an
expression that evaluates to `miter`. Otherwise, it is ignored.
@@ -202,7 +202,7 @@ MGL_EXPORT
Used to automatically convert round joins to miter joins for shallow angles.
The default value of this property is an expression that evaluates to the float
1.05. Set this property to `nil` to reset it to the default value.
`1.05`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `lineJoin` is set to an
expression that evaluates to `round`. Otherwise, it is ignored.
@@ -228,7 +228,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -346,7 +346,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -375,7 +375,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -399,7 +399,7 @@ MGL_EXPORT
The opacity at which the line will be drawn.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -545,7 +545,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:

View File

@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"
@@ -77,7 +77,7 @@ namespace mbgl {
{
MGLAssertStyleLayerIsValid();
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::NullFilter());
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::Filter());
}
- (NSPredicate *)predicate

View File

@@ -122,8 +122,7 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64;
_snapshotCallback = std::make_unique<mbgl::Actor<mbgl::MapSnapshotter::Callback>>(*mbgl::Scheduler::GetCurrent(), [=](std::exception_ptr mbglError, mbgl::PremultipliedImage image, mbgl::MapSnapshotter::Attributions attributions, mbgl::MapSnapshotter::PointForFn pointForFn) {
__typeof__(self) strongSelf = weakSelf;
strongSelf.loading = false;
if (mbglError) {
NSString *description = @(mbgl::util::toString(mbglError).c_str());
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: description};
@@ -145,9 +144,13 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64;
}
_snapshotCallback = NULL;
});
dispatch_async(queue, ^{
_mbglMapSnapshotter->snapshot(_snapshotCallback->self());
dispatch_async(queue, ^{
__typeof__(self) strongSelf = weakSelf;
if (!strongSelf) {
return;
}
strongSelf->_mbglMapSnapshotter->snapshot(strongSelf->_snapshotCallback->self());
});
}

View File

@@ -163,7 +163,7 @@
if (!_bounds) {
mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty();
for (auto coordinate : _coordinates) {
if (!CLLocationCoordinate2DIsValid(coordinate)) {
if (!MGLLocationCoordinate2DIsValid(coordinate)) {
bounds = mbgl::LatLngBounds::empty();
break;
}

View File

@@ -30,6 +30,11 @@ NS_ASSUME_NONNULL_BEGIN
This property contains the smallest rectangle that completely encompasses the
overlay. Implementers of this protocol must set this area when implementing
their overlay class, and after setting it, you must not change it.
If this overlay spans the antimeridian, its bounds may extend west of −180 degrees
longitude or east of 180 degrees longitude. For example, an overlay covering the
Pacific Ocean from Tokyo to San Francisco might have a bounds extending
from (35.68476, −220.24257) to (37.78428, −122.41310).
*/
@property (nonatomic, readonly) MGLCoordinateBounds overlayBounds;

View File

@@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN
if (!_bounds) {
mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty();
for (auto coordinate : _coordinates) {
if (!CLLocationCoordinate2DIsValid(coordinate)) {
if (!MGLLocationCoordinate2DIsValid(coordinate)) {
bounds = mbgl::LatLngBounds::empty();
break;
}

View File

@@ -64,7 +64,7 @@ MGL_EXPORT
brightness.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-raster-brightness-max"><code>raster-brightness-max</code></a>
@@ -97,7 +97,7 @@ MGL_EXPORT
brightness.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-raster-brightness-min"><code>raster-brightness-min</code></a>
@@ -129,7 +129,7 @@ MGL_EXPORT
Increase or reduce the contrast of the image.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -157,7 +157,7 @@ MGL_EXPORT
This property is measured in milliseconds.
The default value of this property is an expression that evaluates to the float
300. Set this property to `nil` to reset it to the default value.
`300`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -178,7 +178,7 @@ MGL_EXPORT
This property is measured in degrees.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-raster-hue-rotate"><code>raster-hue-rotate</code></a>
@@ -210,7 +210,7 @@ MGL_EXPORT
The opacity at which the image will be drawn.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:
@@ -236,7 +236,7 @@ MGL_EXPORT
Increase or reduce the saturation of the image.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
You can set this property to an expression containing any of the following:

View File

@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"

View File

@@ -6,7 +6,7 @@
#import "MGLFeature_Private.h"
#import "MGLShape_Private.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSURL+MGLAdditions.h"
#include <mbgl/map/map.hpp>

View File

@@ -8,7 +8,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"
@@ -103,7 +103,7 @@ namespace mbgl {
{
MGLAssertStyleLayerIsValid();
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::NullFilter());
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::Filter());
}
- (NSPredicate *)predicate

View File

@@ -564,7 +564,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
2. Set this property to `nil` to reset it to the default value.
`2`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
@@ -615,7 +615,7 @@ MGL_EXPORT
This property is measured in degrees.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
@@ -678,7 +678,7 @@ MGL_EXPORT
This property is measured in factor of the original icon sizes.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
@@ -858,7 +858,7 @@ MGL_EXPORT
This property is measured in degrees.
The default value of this property is an expression that evaluates to the float
45. Set this property to `nil` to reset it to the default value.
`45`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`, and
`symbolPlacement` is set to an expression that evaluates to `line`. Otherwise,
@@ -890,7 +890,7 @@ MGL_EXPORT
This property is measured in ems.
The default value of this property is an expression that evaluates to the float
10. Set this property to `nil` to reset it to the default value.
`10`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
@@ -973,7 +973,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
250. Set this property to `nil` to reset it to the default value.
`250`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `symbolPlacement` is set to an
expression that evaluates to `line`. Otherwise, it is ignored.
@@ -1129,7 +1129,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
16. Set this property to `nil` to reset it to the default value.
`16`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
@@ -1219,7 +1219,7 @@ MGL_EXPORT
This property is measured in ems.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
@@ -1241,7 +1241,7 @@ MGL_EXPORT
This property is measured in ems.
The default value of this property is an expression that evaluates to the float
1.2. Set this property to `nil` to reset it to the default value.
`1.2`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
@@ -1338,7 +1338,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
2. Set this property to `nil` to reset it to the default value.
`2`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
@@ -1389,7 +1389,7 @@ MGL_EXPORT
This property is measured in degrees.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
@@ -1529,7 +1529,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
@@ -1611,7 +1611,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
@@ -1638,7 +1638,7 @@ MGL_EXPORT
The opacity at which the icon will be drawn.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
@@ -1819,7 +1819,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
@@ -1900,7 +1900,7 @@ MGL_EXPORT
This property is measured in points.
The default value of this property is an expression that evaluates to the float
0. Set this property to `nil` to reset it to the default value.
`0`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
@@ -1927,7 +1927,7 @@ MGL_EXPORT
The opacity at which the text will be drawn.
The default value of this property is an expression that evaluates to the float
1. Set this property to `nil` to reset it to the default value.
`1`. Set this property to `nil` to reset it to the default value.
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.

View File

@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "MGLStyleLayer_Private.h"
#import "MGLStyleValue_Private.h"
@@ -142,7 +142,7 @@ namespace mbgl {
{
MGLAssertStyleLayerIsValid();
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::NullFilter());
self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::Filter());
}
- (NSPredicate *)predicate

View File

@@ -6,7 +6,7 @@
#import "MGLStyle_Private.h"
#import "MGLMapView_Private.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSURL+MGLAdditions.h"
#include <mbgl/map/map.hpp>
@@ -112,7 +112,8 @@ static NSArray * const MGLMapboxStreetsAlternativeLanguages = @[
return [[NSLocale localeWithLocaleIdentifier:language].languageCode isEqualToString:@"en"];
}]].count;
NSArray<NSString *> *preferredLanguages = [NSBundle preferredLocalizationsFromArray:MGLMapboxStreetsAlternativeLanguages
NSArray<NSString *> *availableLanguages = acceptsEnglish ? MGLMapboxStreetsLanguages : MGLMapboxStreetsAlternativeLanguages;
NSArray<NSString *> *preferredLanguages = [NSBundle preferredLocalizationsFromArray:availableLanguages
forPreferences:preferencesArray];
NSString *mostSpecificLanguage;
for (NSString *language in preferredLanguages) {
@@ -120,10 +121,7 @@ static NSArray * const MGLMapboxStreetsAlternativeLanguages = @[
mostSpecificLanguage = language;
}
}
if ([mostSpecificLanguage isEqualToString:@"mul"]) {
return acceptsEnglish ? @"en" : nil;
}
return mostSpecificLanguage;
return [mostSpecificLanguage isEqualToString:@"mul"] ? nil : mostSpecificLanguage;
}
- (BOOL)isMapboxStreets {
@@ -135,19 +133,4 @@ static NSArray * const MGLMapboxStreetsAlternativeLanguages = @[
return [identifiers containsObject:@"mapbox.mapbox-streets-v7"] || [identifiers containsObject:@"mapbox.mapbox-streets-v6"];
}
- (NSDictionary<NSString *, NSString *> *)localizedKeysByKeyForPreferredLanguage:(nullable NSString *)preferredLanguage {
if (!self.mapboxStreets) {
return @{};
}
// Replace {name} and {name_*} with the matching localized name tag.
NSString *localizedKey = preferredLanguage ? [NSString stringWithFormat:@"name_%@", preferredLanguage] : @"name";
NSMutableDictionary *localizedKeysByKey = [NSMutableDictionary dictionaryWithObject:localizedKey forKey:@"name"];
for (NSString *languageCode in [MGLVectorTileSource mapboxStreetsLanguages]) {
NSString *key = [NSString stringWithFormat:@"name_%@", languageCode];
localizedKeysByKey[key] = localizedKey;
}
return localizedKeysByKey;
}
@end

View File

@@ -11,8 +11,6 @@ NS_ASSUME_NONNULL_BEGIN
+ (nullable NSString *)preferredMapboxStreetsLanguage;
+ (nullable NSString *)preferredMapboxStreetsLanguageForPreferences:(NSArray<NSString *> *)preferencesArray;
- (NSDictionary<NSString *, NSString *> *)localizedKeysByKeyForPreferredLanguage:(nullable NSString *)preferredLanguage;
@end
NS_ASSUME_NONNULL_END

View File

@@ -2,7 +2,7 @@
#import "MGLStyleValue_Private.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSExpression+MGLPrivateAdditions.h"
#include <mbgl/style/conversion/property_value.hpp>

View File

@@ -798,6 +798,22 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
} else if ([op isEqualToString:@"to-string"] || [op isEqualToString:@"string"]) {
NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject];
return [NSExpression expressionWithFormat:@"CAST(%@, 'NSString')", operand];
} else if ([op isEqualToString:@"to-color"]) {
NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject];
if (argumentObjects.count == 1) {
#if TARGET_OS_IPHONE
return [NSExpression expressionWithFormat:@"CAST(%@, 'UIColor')", operand];
#else
return [NSExpression expressionWithFormat:@"CAST(%@, 'NSColor')", operand];
#endif
}
NSArray *subexpressions = MGLSubexpressionsWithJSONObjects(array);
return [NSExpression expressionForFunction:@"MGL_FUNCTION" arguments:subexpressions];
} else if ([op isEqualToString:@"to-rgba"]) {
NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject];
return [NSExpression expressionWithFormat:@"CAST(noindex(%@), 'NSArray')", operand];
} else if ([op isEqualToString:@"get"]) {
if (argumentObjects.count == 2) {
NSExpression *operand = [NSExpression expressionWithMGLJSONObject:argumentObjects.lastObject];
@@ -909,7 +925,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
for (NSUInteger index = 0; index < argumentObjects.count; index++) {
if (index % 2 == 0 && index != argumentObjects.count - 1) {
NSPredicate *predicate = [NSPredicate mgl_predicateWithJSONObject:argumentObjects[index]];
NSPredicate *predicate = [NSPredicate predicateWithMGLJSONObject:argumentObjects[index]];
NSExpression *argument = [NSExpression expressionForConstantValue:predicate];
[arguments addObject:argument];
} else {
@@ -1091,7 +1107,22 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
NSArray *arguments = self.arguments.mgl_jsonExpressionObject;
return [@[@"concat", self.operand.mgl_jsonExpressionObject] arrayByAddingObjectsFromArray:arguments];
} else if ([function isEqualToString:@"objectFrom:withIndex:"]) {
return @[@"at", self.arguments[1].mgl_jsonExpressionObject, self.arguments[0].mgl_jsonExpressionObject];
id index = self.arguments[1].mgl_jsonExpressionObject;
if ([self.arguments[1] expressionType] == NSConstantValueExpressionType
&& [[self.arguments[1] constantValue] isKindOfClass:[NSString class]]) {
id value = self.arguments[1].constantValue;
if ([value isEqualToString:@"FIRST"]) {
index = [NSExpression expressionForConstantValue:@0].mgl_jsonExpressionObject;
} else if ([value isEqualToString:@"LAST"]) {
index = [NSExpression expressionWithFormat:@"count(%@) - 1", self.arguments[0]].mgl_jsonExpressionObject;
} else if ([value isEqualToString:@"SIZE"]) {
return [NSExpression expressionWithFormat:@"count(%@)", self.arguments[0]].mgl_jsonExpressionObject;
}
}
return @[@"at", index, self.arguments[0].mgl_jsonExpressionObject];
} else if ([function isEqualToString:@"boolValue"]) {
return @[@"to-boolean", self.operand.mgl_jsonExpressionObject];
} else if ([function isEqualToString:@"mgl_number"] ||
@@ -1144,6 +1175,26 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
} else if ([type isEqualToString:@"NSNumber"]) {
return @[@"to-number", object];
}
#if TARGET_OS_IPHONE
else if ([type isEqualToString:@"UIColor"] || [type isEqualToString:@"MGLColor"]) {
return @[@"to-color", object];
}
#else
else if ([type isEqualToString:@"NSColor"] || [type isEqualToString:@"MGLColor"]) {
return @[@"to-color", object];
}
#endif
else if ([type isEqualToString:@"NSArray"]) {
NSExpression *operand = self.arguments.firstObject;
if ([operand expressionType] == NSFunctionExpressionType ) {
operand = self.arguments.firstObject.arguments.firstObject;
}
if (([operand expressionType] != NSConstantValueExpressionType) ||
([operand expressionType] == NSConstantValueExpressionType &&
[[operand constantValue] isKindOfClass:[MGLColor class]])) {
return @[@"to-rgba", object];
}
}
[NSException raise:NSInvalidArgumentException
format:@"Casting expression to %@ not yet implemented.", type];
} else if ([function isEqualToString:@"MGL_FUNCTION"]) {
@@ -1212,7 +1263,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
case NSAnyKeyExpressionType:
case NSBlockExpressionType:
[NSException raise:NSInvalidArgumentException
format:@"Expression type %lu not yet implemented.", self.expressionType];
format:@"Expression type %lu not yet implemented.", (unsigned long)self.expressionType];
}
// NSKeyPathSpecifierExpression
@@ -1234,11 +1285,11 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
if (self.arguments.count < expectedArgumentCount) {
[NSException raise:NSInvalidArgumentException format:
@"Too few arguments to ‘%@’ function; expected %lu arguments.",
self.function, expectedArgumentCount];
self.function, (unsigned long)expectedArgumentCount];
} else if (self.arguments.count > expectedArgumentCount) {
[NSException raise:NSInvalidArgumentException format:
@"%lu unexpected arguments to ‘%@’ function; expected %lu arguments.",
self.arguments.count - expectedArgumentCount, self.function, expectedArgumentCount];
self.arguments.count - (unsigned long)expectedArgumentCount, self.function, (unsigned long)expectedArgumentCount];
}
BOOL isAftermarketFunction = [self.function isEqualToString:@"mgl_interpolate:withCurveType:parameters:stops:"];
@@ -1252,9 +1303,15 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
NSArray *controlPoints = [self.arguments[curveTypeIndex + 1].collection mgl_jsonExpressionObject];
[interpolationArray addObjectsFromArray:controlPoints];
}
NSDictionary<NSNumber *, NSExpression *> *stops = self.arguments[curveTypeIndex + 2].constantValue;
if (stops.count == 0) {
[NSException raise:NSInvalidArgumentException format:@"‘stops‘ dictionary argument to ‘%@’ function must not be empty.", self.function];
}
NSMutableArray *expressionObject = [NSMutableArray arrayWithObjects:@"interpolate", interpolationArray, nil];
[expressionObject addObject:(isAftermarketFunction ? self.arguments.firstObject : self.operand).mgl_jsonExpressionObject];
NSDictionary<NSNumber *, NSExpression *> *stops = self.arguments[curveTypeIndex + 2].constantValue;
for (NSNumber *key in [stops.allKeys sortedArrayUsingSelector:@selector(compare:)]) {
[expressionObject addObject:key];
[expressionObject addObject:[stops[key] mgl_jsonExpressionObject]];
@@ -1266,8 +1323,14 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
BOOL isAftermarketFunction = [self.function isEqualToString:@"mgl_step:from:stops:"];
NSUInteger minimumIndex = isAftermarketFunction ? 1 : 0;
id minimum = self.arguments[minimumIndex].mgl_jsonExpressionObject;
NSMutableArray *expressionObject = [NSMutableArray arrayWithObjects:@"step", (isAftermarketFunction ? self.arguments.firstObject : self.operand).mgl_jsonExpressionObject, minimum, nil];
NSDictionary<NSNumber *, NSExpression *> *stops = self.arguments[minimumIndex + 1].constantValue;
if (stops.count == 0) {
[NSException raise:NSInvalidArgumentException format:@"‘stops‘ dictionary argument to ‘%@’ function must not be empty.", self.function];
}
NSMutableArray *expressionObject = [NSMutableArray arrayWithObjects:@"step", (isAftermarketFunction ? self.arguments.firstObject : self.operand).mgl_jsonExpressionObject, minimum, nil];
for (NSNumber *key in [stops.allKeys sortedArrayUsingSelector:@selector(compare:)]) {
[expressionObject addObject:key];
[expressionObject addObject:[stops[key] mgl_jsonExpressionObject]];

View File

@@ -1,23 +1,44 @@
#import <Foundation/Foundation.h>
#import "NSExpression+MGLPrivateAdditions.h"
NS_ASSUME_NONNULL_BEGIN
@interface NSPredicate (MGLAdditions)
- (mbgl::style::Filter)mgl_filter;
#pragma mark Converting JSON Expressions
+ (instancetype)mgl_predicateWithFilter:(mbgl::style::Filter)filter;
@end
@interface NSPredicate (MGLExpressionAdditions)
+ (instancetype)mgl_predicateWithJSONObject:(id)object;
/**
Returns a predicate equivalent to the given Foundation object deserialized
from JSON data.
The Foundation object is interpreted according to the
[Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions).
See the
“[Predicates and Expressions](../predicates-and-expressions.html)”
guide for a correspondence of operators and types between the style
specification and the `NSPredicate` representation used by this SDK.
@param object A Foundation object deserialized from JSON data, for example
using `NSJSONSerialization`.
@return An initialized predicate equivalent to `object`, suitable for use
with the `MGLVectorStyleLayer.predicate` property.
*/
+ (instancetype)predicateWithMGLJSONObject:(id)object NS_SWIFT_NAME(init(mglJSONObject:));
/**
An equivalent Foundation object that can be serialized as JSON.
The Foundation object conforms to the
[Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions).
See the
“[Predicates and Expressions](../predicates-and-expressions.html)”
guide for a correspondence of operators and types between the style
specification and the `NSPredicate` representation used by this SDK.
You can use `NSJSONSerialization` to serialize the Foundation object as data to
write to a file.
*/
@property (nonatomic, readonly) id mgl_jsonExpressionObject;
- (id)mgl_if:(id)firstValue, ...;
- (id)mgl_match:(NSExpression *)firstCase, ...;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,210 +1,11 @@
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "MGLValueEvaluator.h"
#import "MGLStyleValue_Private.h"
#include <mbgl/style/conversion/filter.hpp>
class FilterEvaluator {
public:
NSArray *getPredicates(std::vector<mbgl::style::Filter> filters) {
NSMutableArray *predicates = [NSMutableArray arrayWithCapacity:filters.size()];
for (auto filter : filters) {
[predicates addObject:mbgl::style::Filter::visit(filter, FilterEvaluator())];
}
return predicates;
}
template <typename MBGLType>
NSExpression *getValues(std::vector<MBGLType> values) {
NSMutableArray *array = [NSMutableArray arrayWithCapacity:values.size()];
for (auto value : values) {
id constantValue = MBGLType::visit(value, ValueEvaluator());
[array addObject:[NSExpression expressionForConstantValue:constantValue]];
}
return [NSExpression expressionForAggregate:array];
}
NSString *getFeatureTypeString(mbgl::FeatureType type) {
switch (type) {
case mbgl::FeatureType::Point:
return @"Point";
case mbgl::FeatureType::LineString:
return @"LineString";
case mbgl::FeatureType::Polygon:
return @"Polygon";
default:
NSCAssert(NO, @"Unrecognized feature type %hhu", type);
return nil;
}
}
NSExpression *getFeatureTypeStrings(std::vector<mbgl::FeatureType> values) {
NSMutableArray *array = [NSMutableArray arrayWithCapacity:values.size()];
for (auto value : values) {
id typeString = getFeatureTypeString(value);
[array addObject:[NSExpression expressionForConstantValue:typeString]];
}
return [NSExpression expressionForAggregate:array];
}
NSPredicate *operator()(mbgl::style::NullFilter filter) {
return nil;
}
NSPredicate *operator()(mbgl::style::EqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K == %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
NSPredicate *operator()(mbgl::style::NotEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K != %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
NSPredicate *operator()(mbgl::style::GreaterThanFilter filter) {
return [NSPredicate predicateWithFormat:@"%K > %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
NSPredicate *operator()(mbgl::style::GreaterThanEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K >= %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
NSPredicate *operator()(mbgl::style::LessThanFilter filter) {
return [NSPredicate predicateWithFormat:@"%K < %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
NSPredicate *operator()(mbgl::style::LessThanEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K <= %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
NSPredicate *operator()(mbgl::style::InFilter filter) {
return [NSPredicate predicateWithFormat:@"%K IN %@", @(filter.key.c_str()), getValues(filter.values)];
}
NSPredicate *operator()(mbgl::style::NotInFilter filter) {
return [NSPredicate predicateWithFormat:@"NOT %K IN %@", @(filter.key.c_str()), getValues(filter.values)];
}
NSPredicate *operator()(mbgl::style::TypeEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K == %@", @"$type", getFeatureTypeString(filter.value)];
}
NSPredicate *operator()(mbgl::style::TypeNotEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K != %@", @"$type", getFeatureTypeString(filter.value)];
}
NSPredicate *operator()(mbgl::style::TypeInFilter filter) {
return [NSPredicate predicateWithFormat:@"%K IN %@", @"$type", getFeatureTypeStrings(filter.values)];
}
NSPredicate *operator()(mbgl::style::TypeNotInFilter filter) {
return [NSPredicate predicateWithFormat:@"NOT %K IN %@", @"$type", getFeatureTypeStrings(filter.values)];
}
NSPredicate *operator()(mbgl::style::IdentifierEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K == %@", @"$id", mbgl::FeatureIdentifier::visit(filter.value, ValueEvaluator())];
}
NSPredicate *operator()(mbgl::style::IdentifierNotEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K != %@", @"$id", mbgl::FeatureIdentifier::visit(filter.value, ValueEvaluator())];
}
NSPredicate *operator()(mbgl::style::IdentifierInFilter filter) {
return [NSPredicate predicateWithFormat:@"%K IN %@", @"$id", getValues(filter.values)];
}
NSPredicate *operator()(mbgl::style::IdentifierNotInFilter filter) {
return [NSPredicate predicateWithFormat:@"NOT %K IN %@", @"$id", getValues(filter.values)];
}
NSPredicate *operator()(mbgl::style::AnyFilter filter) {
NSArray *subpredicates = getPredicates(filter.filters);
if (subpredicates.count) {
return [NSCompoundPredicate orPredicateWithSubpredicates:subpredicates];
}
return [NSPredicate predicateWithValue:NO];
}
NSPredicate *operator()(mbgl::style::AllFilter filter) {
// Convert [all, [>=, key, lower], [<=, key, upper]] to key BETWEEN {lower, upper}
if (filter.filters.size() == 2) {
auto leftFilter = filter.filters[0];
auto rightFilter = filter.filters[1];
std::string lowerKey;
std::string upperKey;
mbgl::Value lowerBound;
mbgl::Value upperBound;
if (leftFilter.is<mbgl::style::GreaterThanEqualsFilter>()) {
lowerKey = leftFilter.get<mbgl::style::GreaterThanEqualsFilter>().key;
lowerBound = leftFilter.get<mbgl::style::GreaterThanEqualsFilter>().value;
} else if (rightFilter.is<mbgl::style::GreaterThanEqualsFilter>()) {
lowerKey = rightFilter.get<mbgl::style::GreaterThanEqualsFilter>().key;
lowerBound = rightFilter.get<mbgl::style::GreaterThanEqualsFilter>().value;
}
if (leftFilter.is<mbgl::style::LessThanEqualsFilter>()) {
upperKey = leftFilter.get<mbgl::style::LessThanEqualsFilter>().key;
upperBound = leftFilter.get<mbgl::style::LessThanEqualsFilter>().value;
} else if (rightFilter.is<mbgl::style::LessThanEqualsFilter>()) {
upperKey = rightFilter.get<mbgl::style::LessThanEqualsFilter>().key;
upperBound = rightFilter.get<mbgl::style::LessThanEqualsFilter>().value;
}
if (!lowerBound.is<mbgl::NullValue>() && !upperBound.is<mbgl::NullValue>()
&& lowerKey == upperKey) {
return [NSPredicate predicateWithFormat:@"%K BETWEEN {%@, %@}",
@(lowerKey.c_str()),
mbgl::Value::visit(lowerBound, ValueEvaluator()),
mbgl::Value::visit(upperBound, ValueEvaluator())];
}
}
NSArray *subpredicates = getPredicates(filter.filters);
if (subpredicates.count) {
return [NSCompoundPredicate andPredicateWithSubpredicates:subpredicates];
}
return [NSPredicate predicateWithValue:YES];
}
NSPredicate *operator()(mbgl::style::NoneFilter filter) {
NSArray *subpredicates = getPredicates(filter.filters);
if (subpredicates.count > 1) {
NSCompoundPredicate *predicate = [NSCompoundPredicate orPredicateWithSubpredicates:subpredicates];
return [NSCompoundPredicate notPredicateWithSubpredicate:predicate];
} else if (subpredicates.count) {
return [NSCompoundPredicate notPredicateWithSubpredicate:subpredicates.firstObject];
} else {
return [NSPredicate predicateWithValue:YES];
}
}
NSPredicate *operator()(mbgl::style::HasFilter filter) {
return [NSPredicate predicateWithFormat:@"%K != nil", @(filter.key.c_str())];
}
NSPredicate *operator()(mbgl::style::NotHasFilter filter) {
return [NSPredicate predicateWithFormat:@"%K == nil", @(filter.key.c_str())];
}
NSPredicate *operator()(mbgl::style::HasIdentifierFilter filter) {
return [NSPredicate predicateWithFormat:@"%K != nil", @"$id"];
}
NSPredicate *operator()(mbgl::style::NotHasIdentifierFilter filter) {
return [NSPredicate predicateWithFormat:@"%K == nil", @"$id"];
}
NSPredicate *operator()(mbgl::style::ExpressionFilter filter) {
id jsonObject = MGLJSONObjectFromMBGLExpression(*filter.expression);
return [NSPredicate mgl_predicateWithJSONObject:jsonObject];
}
};
@implementation NSPredicate (MGLAdditions)
@implementation NSPredicate (MGLPrivateAdditions)
- (mbgl::style::Filter)mgl_filter
{
@@ -224,24 +25,28 @@ public:
+ (instancetype)mgl_predicateWithFilter:(mbgl::style::Filter)filter
{
FilterEvaluator evaluator;
return mbgl::style::Filter::visit(filter, evaluator);
if (filter.expression) {
id jsonObject = MGLJSONObjectFromMBGLExpression(**filter.expression);
return [NSPredicate predicateWithMGLJSONObject:jsonObject];
} else {
return nil;
}
}
@end
@implementation NSPredicate (MGLExpressionAdditions)
@implementation NSPredicate (MGLAdditions)
NSArray *MGLSubpredicatesWithJSONObjects(NSArray *objects) {
NSMutableArray *subpredicates = [NSMutableArray arrayWithCapacity:objects.count];
for (id object in objects) {
NSPredicate *predicate = [NSPredicate mgl_predicateWithJSONObject:object];
NSPredicate *predicate = [NSPredicate predicateWithMGLJSONObject:object];
[subpredicates addObject:predicate];
}
return subpredicates;
}
+ (instancetype)mgl_predicateWithJSONObject:(id)object {
+ (instancetype)predicateWithMGLJSONObject:(id)object {
if ([object isEqual:@YES]) {
return [NSPredicate predicateWithValue:YES];
}
@@ -360,6 +165,10 @@ NSArray *MGLSubpredicatesWithJSONObjects(NSArray *objects) {
return nil;
}
@end
@implementation NSPredicate (MGLExpressionAdditions)
- (id)mgl_if:(id)firstValue, ... {
if ([self evaluateWithObject:nil]) {

View File

@@ -0,0 +1,25 @@
#import <Foundation/Foundation.h>
#import "NSPredicate+MGLAdditions.h"
#include <mbgl/style/filter.hpp>
NS_ASSUME_NONNULL_BEGIN
@interface NSPredicate (MGLPrivateAdditions)
- (mbgl::style::Filter)mgl_filter;
+ (instancetype)mgl_predicateWithFilter:(mbgl::style::Filter)filter;
@end
@interface NSPredicate (MGLExpressionAdditions)
- (id)mgl_if:(id)firstValue, ...;
- (id)mgl_match:(NSExpression *)firstCase, ...;
@end
NS_ASSUME_NONNULL_END

View File

@@ -668,6 +668,38 @@ using namespace std::string_literals;
XCTAssertEqualObjects([compatibilityExpression expressionValueWithObject:@{@"number": @1.5} context:nil], @"1.5");
XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression);
}
{
#if TARGET_OS_IPHONE
NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(x, 'UIColor')"];
#else
NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(x, 'NSColor')"];
#endif
NSArray *jsonExpression = @[@"to-color", @[@"get", @"x"]];
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression);
}
{
NSExpression *expression = [NSExpression expressionWithFormat:@"MGL_FUNCTION('to-color', x, y, z)"];
NSArray *jsonExpression = @[@"to-color", @[@"get", @"x"], @[@"get", @"y"], @[@"get", @"z"]];
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression);
}
{
NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(noindex(x), 'NSArray')"];
NSArray *jsonExpression = @[@"to-rgba", @[@"get", @"x"]];
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression);
}
{
NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(noindex(%@), 'NSArray')", MGLConstantExpression(MGLColor.blueColor)];
NSArray *jsonExpression = @[@"to-rgba", @[@"rgb", @0, @0, @255]];
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression);
}
{
NSExpression *expression = [NSExpression expressionWithFormat:@"CAST(noindex('x'), 'NSArray')"];
XCTAssertThrowsSpecificNamed(expression.mgl_jsonExpressionObject, NSException, NSInvalidArgumentException);
}
}
- (void)testInterpolationExpressionObject {
@@ -710,6 +742,16 @@ using namespace std::string_literals;
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression);
}
{
NSDictionary *stops = @{};
NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_interpolate:withCurveType:parameters:stops:(x, 'cubic-bezier', { 0.42, 0, 0.58, 1 }, %@)", stops];
XCTAssertThrowsSpecificNamed(expression.mgl_jsonExpressionObject, NSException, NSInvalidArgumentException);
}
{
NSDictionary *stops = @{};
NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_step:from:stops:($zoomLevel, 11, %@)", stops];
XCTAssertThrowsSpecificNamed(expression.mgl_jsonExpressionObject, NSException, NSInvalidArgumentException);
}
}
- (void)testMatchExpressionObject {
@@ -821,6 +863,33 @@ using namespace std::string_literals;
}
- (void)testLookupExpressionObject {
{
NSExpression *array = [NSExpression expressionForAggregate:@[MGLConstantExpression(@9),
MGLConstantExpression(@8),
MGLConstantExpression(@7)]];
NSExpression *expression = [NSExpression expressionForFunction:@"objectFrom:withIndex:"
arguments:@[array, MGLConstantExpression(@"FIRST")]];
NSArray *jsonExpression = @[@"at", @0, @[ @"literal", @[@9, @8, @7]]];
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression);
}
{
NSExpression *array = [NSExpression expressionForAggregate:@[MGLConstantExpression(@9),
MGLConstantExpression(@8),
MGLConstantExpression(@7)]];
NSExpression *expression = [NSExpression expressionForFunction:@"objectFrom:withIndex:"
arguments:@[array, MGLConstantExpression(@"LAST")]];
NSArray *jsonExpression = @[@"at", @[@"-", @[@"length", @[ @"literal", @[@9, @8, @7]]], @1], @[ @"literal", @[@9, @8, @7]]];
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression);
}
{
NSExpression *array = [NSExpression expressionForAggregate:@[MGLConstantExpression(@9),
MGLConstantExpression(@8),
MGLConstantExpression(@7)]];
NSExpression *expression = [NSExpression expressionForFunction:@"objectFrom:withIndex:"
arguments:@[array, MGLConstantExpression(@"SIZE")]];
NSArray *jsonExpression = @[@"length", @[ @"literal", @[@9, @8, @7]]];
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression);
}
{
NSExpression *array = [NSExpression expressionForAggregate:@[MGLConstantExpression(@9),
MGLConstantExpression(@8),

View File

@@ -172,4 +172,40 @@
XCTAssertEqual(point.y, roundTrippedPoint.y);
XCTAssertEqual(point.zoomLevel, roundTrippedPoint.zoomLevel);
}
- (void)testMGLLocationCoordinate2DIsValid {
{
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(37.936, -71.516);
XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate));
}
{
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(46.816368, 5.844469);
XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate));
}
{
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(-21.512680, 23.334703);
XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate));
}
{
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(-44.947936, -73.081313);
XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate));
}
{
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(19.333630, 203.555405);
XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate));
}
{
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(23.254696, -240.795323);
XCTAssertTrue(MGLLocationCoordinate2DIsValid(coordinate));
}
{
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(91, 361);
XCTAssertFalse(MGLLocationCoordinate2DIsValid(coordinate));
}
{
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(-91, -361);
XCTAssertFalse(MGLLocationCoordinate2DIsValid(coordinate));
}
}
@end

View File

@@ -1,229 +1,15 @@
#import <XCTest/XCTest.h>
#import <Mapbox/Mapbox.h>
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "MGLValueEvaluator.h"
namespace mbgl {
namespace style {
bool operator!=(const Filter &a, const Filter &b) {
return !(a == b);
}
}
}
#define MGLAssertEqualFilters(actual, expected, ...) \
XCTAssertTrue(actual.is<__typeof__(expected)>()); \
if (actual.is<__typeof__(expected)>()) { \
XCTAssertEqual(actual.get<__typeof__(expected)>(), expected, __VA_ARGS__); \
}
@interface MGLPredicateTests : XCTestCase
@end
@implementation MGLPredicateTests
- (void)testPredication {
XCTAssertNil([NSPredicate mgl_predicateWithFilter:mbgl::style::NullFilter()]);
{
mbgl::style::EqualsFilter filter = { .key = "a", .value = std::string("b") };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a = 'b'"]);
}
{
mbgl::style::TypeEqualsFilter filter = { .value = mbgl::FeatureType::Point };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K = 'Point'", @"$type"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::TypeEqualsFilter filter = { .value = mbgl::FeatureType::LineString };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K = 'LineString'", @"$type"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::TypeEqualsFilter filter = { .value = mbgl::FeatureType::Polygon };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K = 'Polygon'", @"$type"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::IdentifierEqualsFilter filter = { .value = UINT64_C(67086180) };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K = 67086180", @"$id"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::NotHasIdentifierFilter filter;
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K = nil", @"$id"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::TypeEqualsFilter filter = { .value = mbgl::FeatureType::Unknown };
XCTAssertThrowsSpecificNamed([NSPredicate mgl_predicateWithFilter:filter], NSException, NSInternalInconsistencyException);
}
{
mbgl::style::NotHasFilter filter = { .key = "a" };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a = nil"]);
}
{
mbgl::style::NotEqualsFilter filter = { .key = "a", .value = std::string("b") };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a != 'b'"]);
}
{
mbgl::style::TypeNotEqualsFilter filter = { .value = mbgl::FeatureType::Point };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K != 'Point'", @"$type"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::IdentifierNotEqualsFilter filter = { .value = UINT64_C(67086180) };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K != 67086180", @"$id"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::HasIdentifierFilter filter;
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K != nil", @"$id"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::HasFilter filter = { .key = "a" };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a != nil"]);
}
{
mbgl::style::LessThanFilter filter = { .key = "a", .value = std::string("b") };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a < 'b'"]);
}
{
mbgl::style::LessThanEqualsFilter filter = { .key = "a", .value = std::string("b") };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a <= 'b'"]);
}
{
mbgl::style::GreaterThanFilter filter = { .key = "a", .value = std::string("b") };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a > 'b'"]);
}
{
mbgl::style::GreaterThanEqualsFilter filter = { .key = "a", .value = std::string("b") };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a >= 'b'"]);
}
{
mbgl::style::AllFilter filter = {
.filters = {
mbgl::style::GreaterThanEqualsFilter { .key = "a", .value = std::string("b") },
mbgl::style::LessThanEqualsFilter { .key = "a", .value = std::string("z") },
},
};
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a BETWEEN {'b', 'z'}"]);
}
{
mbgl::style::AllFilter filter = {
.filters = {
mbgl::style::LessThanEqualsFilter { .key = "a", .value = std::string("z") },
mbgl::style::GreaterThanEqualsFilter { .key = "a", .value = std::string("b") },
},
};
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a BETWEEN {'b', 'z'}"]);
}
{
mbgl::style::InFilter filter = { .key = "a", .values = { std::string("b"), std::string("c") } };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter].predicateFormat, [NSPredicate predicateWithFormat:@"a IN {'b', 'c'}"].predicateFormat);
}
{
mbgl::style::TypeInFilter filter = { .values = { mbgl::FeatureType::LineString, mbgl::FeatureType::Polygon } };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K IN {'LineString', 'Polygon'}", @"$type"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter].predicateFormat, expected.predicateFormat);
}
{
mbgl::style::IdentifierInFilter filter = { .values = { UINT64_C(67086180), UINT64_C(3709678893), UINT64_C(3352016856), UINT64_C(4189833989) } };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"%K IN {67086180, 3709678893, 3352016856, 4189833989}", @"$id"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::NotInFilter filter = { .key = "a", .values = { std::string("b"), std::string("c") } };
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter].predicateFormat, [NSPredicate predicateWithFormat:@"NOT a IN {'b', 'c'}"].predicateFormat);
}
{
mbgl::style::TypeNotInFilter filter = { .values = { mbgl::FeatureType::LineString, mbgl::FeatureType::Polygon } };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"NOT %K IN {'LineString', 'Polygon'}", @"$type"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter].predicateFormat, expected.predicateFormat);
}
{
mbgl::style::IdentifierNotInFilter filter = { .values = { UINT64_C(67086180), UINT64_C(3709678893), UINT64_C(3352016856), UINT64_C(4189833989) } };
NSPredicate *expected = [NSPredicate predicateWithFormat:@"NOT %K IN {67086180, 3709678893, 3352016856, 4189833989}", @"$id"];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], expected);
}
{
mbgl::style::AllFilter filter;
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithValue:YES]);
}
{
mbgl::style::AllFilter filter = {
.filters = {
mbgl::style::EqualsFilter { .key = "a", .value = std::string("b") },
mbgl::style::EqualsFilter { .key = "c", .value = std::string("d") },
},
};
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a == 'b' AND c == 'd'"]);
}
{
mbgl::style::AnyFilter filter;
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithValue:NO]);
}
{
mbgl::style::AnyFilter filter = {
.filters = {
mbgl::style::EqualsFilter { .key = "a", .value = std::string("b") },
mbgl::style::EqualsFilter { .key = "c", .value = std::string("d") },
},
};
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"a == 'b' OR c == 'd'"]);
}
{
mbgl::style::NoneFilter filter;
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithValue:YES]);
}
{
mbgl::style::NoneFilter filter = {
.filters = {
mbgl::style::EqualsFilter { .key = "a", .value = std::string("b") },
mbgl::style::EqualsFilter { .key = "c", .value = std::string("d") },
},
};
XCTAssertEqualObjects([NSPredicate mgl_predicateWithFilter:filter], [NSPredicate predicateWithFormat:@"NOT(a == 'b' OR c == 'd')"]);
}
}
- (void)testUnsupportedFilterPredicates {
XCTAssertThrowsSpecificNamed([NSPredicate predicateWithFormat:@"1 == 2"].mgl_filter, NSException, NSInvalidArgumentException);
XCTAssertThrowsSpecificNamed([NSPredicate predicateWithFormat:@"1 == 1"].mgl_filter, NSException, NSInvalidArgumentException);
XCTAssertThrowsSpecificNamed([NSPredicate predicateWithValue:YES].mgl_filter, NSException, NSInvalidArgumentException);
XCTAssertThrowsSpecificNamed([NSPredicate predicateWithValue:NO].mgl_filter, NSException, NSInvalidArgumentException);
XCTAssertThrowsSpecificNamed([NSPredicate predicateWithFormat:@"a BEGINSWITH 'L'"].mgl_filter, NSException, NSInvalidArgumentException);
XCTAssertThrowsSpecificNamed([NSPredicate predicateWithFormat:@"a ENDSWITH 'itude'"].mgl_filter, NSException, NSInvalidArgumentException);
XCTAssertThrowsSpecificNamed([NSPredicate predicateWithFormat:@"a LIKE 'glob?trotter'"].mgl_filter, NSException, NSInvalidArgumentException);
@@ -242,48 +28,48 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"x == YES"];
NSArray *jsonExpression = @[@"==", @[@"get", @"x"], @YES];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') < 5"];
NSArray *jsonExpression = @[@"<", @[@"to-number", @[@"get", @"x"]], @5];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') > 5"];
NSArray *jsonExpression = @[@">", @[@"to-number", @[@"get", @"x"]], @5];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') <= 5"];
NSArray *jsonExpression = @[@"<=", @[@"to-number", @[@"get", @"x"]], @5];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') >= 5"];
NSArray *jsonExpression = @[@">=", @[@"to-number", @[@"get", @"x"]], @5];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSString') > 'value'"];
NSArray *jsonExpression = @[@">", @[@"to-string", @[@"get", @"x"]], @"value"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
@@ -360,48 +146,48 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') < 'b'"];
NSArray *jsonExpression = @[@"<", @[@"to-string", @[@"get", @"a"]], @"b"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') <= 'b'"];
NSArray *jsonExpression = @[@"<=", @[@"to-string", @[@"get", @"a"]], @"b"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') > 'b'"];
NSArray *jsonExpression = @[@">", @[@"to-string", @[@"get", @"a"]], @"b"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') >= 'b'"];
NSArray *jsonExpression = @[@">=", @[@"to-string", @[@"get", @"a"]], @"b"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(a, 'NSString') BETWEEN {'b', 'z'}"];
NSArray *jsonExpression =@[@"all", @[@"<=", @"b", @[@"to-string", @[@"get", @"a"]]], @[@"<=", @[@"to-string", @[@"get", @"a"]], @"z"]];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSExpression *limits = [NSExpression expressionForAggregate:@[[NSExpression expressionForConstantValue:@10], [NSExpression expressionForConstantValue:@100]]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') BETWEEN %@", limits];
NSArray *jsonExpression = @[@"all", @[@">=", @[@"to-number", @[@"get", @"x"]], @10], @[@"<=", @[@"to-number", @[@"get", @"x"]], @100]];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
@@ -409,24 +195,24 @@ namespace mbgl {
NSExpression *limits = [NSExpression expressionForAggregate:@[[NSExpression expressionForConstantValue:@10], [NSExpression expressionForConstantValue:@100]]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') BETWEEN %@", limits];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:expected], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:expected]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected]
mustRoundTrip:NO];
}
{
NSArray *expected = @[@"all", @[@"<=", @10, @[@"to-number", @[@"get", @"x"]]], @[@">=", @100, @[@"to-number", @[@"get", @"x"]]]];
NSExpression *limits = [NSExpression expressionForAggregate:@[[NSExpression expressionForConstantValue:@10], [NSExpression expressionForConstantValue:@100]]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') BETWEEN %@", limits];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:expected], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:expected]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected]
mustRoundTrip:NO];
}
{
NSArray *expected = @[@"all", @[@">=", @[@"to-number", @[@"get", @"x"]], @10], @[@">=", @100, @[@"to-number", @[@"get", @"x"]]]];
NSExpression *limits = [NSExpression expressionForAggregate:@[[NSExpression expressionForConstantValue:@10], [NSExpression expressionForConstantValue:@100]]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"CAST(x, 'NSNumber') BETWEEN %@", limits];
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:expected], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:expected]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:expected], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:expected]
mustRoundTrip:NO];
}
{
@@ -434,7 +220,7 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"$featureIdentifier IN { 6, 5, 4, 3}"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected);
NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"MGL_MATCH(CAST($featureIdentifier, 'NSNumber'), 3, YES, 4, YES, 5, YES, 6, YES, NO) == YES"];
auto forwardFilter = [NSPredicate mgl_predicateWithJSONObject:expected].mgl_filter;
auto forwardFilter = [NSPredicate predicateWithMGLJSONObject:expected].mgl_filter;
NSPredicate *forwardPredicateAfter = [NSPredicate mgl_predicateWithFilter:forwardFilter];
XCTAssertEqualObjects(predicateAfter, forwardPredicateAfter);
}
@@ -443,7 +229,7 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT x IN { 6, 5, 4, 3}"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected);
NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"NOT MGL_MATCH(CAST(x, 'NSNumber'), 3, YES, 4, YES, 5, YES, 6, YES, NO) == YES"];
auto forwardFilter = [NSPredicate mgl_predicateWithJSONObject:expected].mgl_filter;
auto forwardFilter = [NSPredicate predicateWithMGLJSONObject:expected].mgl_filter;
NSPredicate *forwardPredicateAfter = [NSPredicate mgl_predicateWithFilter:forwardFilter];
XCTAssertEqualObjects(predicateAfter, forwardPredicateAfter);
}
@@ -452,7 +238,7 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"a IN { 'b', 'c' }"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected);
NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"MGL_MATCH(CAST(a, 'NSString'), 'b', YES, 'c', YES, NO) == YES"];
auto forwardFilter = [NSPredicate mgl_predicateWithJSONObject:expected].mgl_filter;
auto forwardFilter = [NSPredicate predicateWithMGLJSONObject:expected].mgl_filter;
NSPredicate *forwardPredicateAfter = [NSPredicate mgl_predicateWithFilter:forwardFilter];
XCTAssertEqualObjects(predicateAfter, forwardPredicateAfter);
}
@@ -461,7 +247,7 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%@ IN %@", [NSExpression expressionForVariable:@"geometryType"], @[@"LineString", @"Polygon"]];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected);
NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"MGL_MATCH($geometryType, 'LineString', YES, 'Polygon', YES, NO) == YES"];
auto forwardFilter = [NSPredicate mgl_predicateWithJSONObject:expected].mgl_filter;
auto forwardFilter = [NSPredicate predicateWithMGLJSONObject:expected].mgl_filter;
NSPredicate *forwardPredicateAfter = [NSPredicate mgl_predicateWithFilter:forwardFilter];
XCTAssertEqualObjects(predicateAfter, forwardPredicateAfter);
}
@@ -470,7 +256,7 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"{ 6, 5, 4, 3} CONTAINS x"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected);
NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"MGL_MATCH(CAST(x, 'NSNumber'), 3, YES, 4, YES, 5, YES, 6, YES, NO) == YES"];
auto forwardFilter = [NSPredicate mgl_predicateWithJSONObject:expected].mgl_filter;
auto forwardFilter = [NSPredicate predicateWithMGLJSONObject:expected].mgl_filter;
NSPredicate *forwardPredicateAfter = [NSPredicate mgl_predicateWithFilter:forwardFilter];
XCTAssertEqualObjects(predicateAfter, forwardPredicateAfter);
}
@@ -479,7 +265,7 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%@ CONTAINS %@", @[@"LineString", @"Polygon"], [NSExpression expressionForVariable:@"geometryType"]];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected);
NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"MGL_MATCH($geometryType, 'LineString', YES, 'Polygon', YES, NO) == YES"];
auto forwardFilter = [NSPredicate mgl_predicateWithJSONObject:expected].mgl_filter;
auto forwardFilter = [NSPredicate predicateWithMGLJSONObject:expected].mgl_filter;
NSPredicate *forwardPredicateAfter = [NSPredicate mgl_predicateWithFilter:forwardFilter];
XCTAssertEqualObjects(predicateAfter, forwardPredicateAfter);
}
@@ -488,7 +274,7 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"{ 6, 5, 4, 3} CONTAINS $featureIdentifier"];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, expected);
NSPredicate *predicateAfter = [NSPredicate predicateWithFormat:@"MGL_MATCH(CAST($featureIdentifier, 'NSNumber'), 3, YES, 4, YES, 5, YES, 6, YES, NO) == YES"];
auto forwardFilter = [NSPredicate mgl_predicateWithJSONObject:expected].mgl_filter;
auto forwardFilter = [NSPredicate predicateWithMGLJSONObject:expected].mgl_filter;
NSPredicate *forwardPredicateAfter = [NSPredicate mgl_predicateWithFilter:forwardFilter];
XCTAssertEqualObjects(predicateAfter, forwardPredicateAfter);
}
@@ -499,32 +285,32 @@ namespace mbgl {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"a == 'b' AND c == 'd'"];
NSArray *jsonExpression = @[@"all", @[@"==", @[@"get", @"a"], @"b"], @[@"==", @[@"get", @"c"], @"d"]];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"a == 'b' OR c == 'd'"];
NSArray *jsonExpression = @[@"any", @[@"==", @[@"get", @"a"], @"b"], @[@"==", @[@"get", @"c"], @"d"]];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT(a == 'b' AND c == 'd')"];
NSArray *jsonExpression = @[@"!", @[@"all", @[@"==", @[@"get", @"a"], @"b"], @[@"==", @[@"get", @"c"], @"d"]]];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT(a == 'b' OR c == 'd')"];
NSArray *jsonExpression = @[@"!", @[@"any", @[@"==", @[@"get", @"a"], @"b"], @[@"==", @[@"get", @"c"], @"d"]]];
XCTAssertEqualObjects(predicate.mgl_jsonExpressionObject, jsonExpression);
XCTAssertEqualObjects([NSPredicate mgl_predicateWithJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate mgl_predicateWithJSONObject:jsonExpression]
XCTAssertEqualObjects([NSPredicate predicateWithMGLJSONObject:jsonExpression], predicate);
[self testSymmetryWithPredicate:[NSPredicate predicateWithMGLJSONObject:jsonExpression]
mustRoundTrip:NO];
}
{

View File

@@ -447,6 +447,10 @@
NSArray *preferences = @[@"zh-Hant"];
XCTAssertNil([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences]);
}
{
NSArray *preferences = @[@"en", @"fr", @"el"];
XCTAssertEqualObjects([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences], @"en");
}
{
NSArray *preferences = @[@"tlh"];
XCTAssertNil([MGLVectorTileSource preferredMapboxStreetsLanguageForPreferences:preferences]);

View File

@@ -7,6 +7,8 @@
#include <mbgl/style/image.hpp>
#include <mbgl/style/transition_options.hpp>
#include <mbgl/style/layers/fill_extrusion_layer.hpp>
#include <mbgl/style/expression/compound_expression.hpp>
#include <mbgl/style/expression/literal.hpp>
#include <mbgl/util/logging.hpp>
#include <mbgl/util/platform.hpp>
#include <mbgl/util/string.hpp>
@@ -619,6 +621,9 @@ void GLFWView::onDidFinishLoadingStyle() {
}
void GLFWView::toggle3DExtrusions(bool visible) {
using namespace mbgl::style;
using namespace mbgl::style::expression;
show3DExtrusions = visible;
// Satellite-only style does not contain building extrusions data.
@@ -634,7 +639,9 @@ void GLFWView::toggle3DExtrusions(bool visible) {
auto extrusionLayer = std::make_unique<mbgl::style::FillExtrusionLayer>("3d-buildings", "composite");
extrusionLayer->setSourceLayer("building");
extrusionLayer->setMinZoom(15.0f);
extrusionLayer->setFilter(mbgl::style::EqualsFilter { "extrude", { std::string("true") } });
ParsingContext parsingContext;
extrusionLayer->setFilter(Filter(createCompoundExpression("filter-==", createLiteral("extrude"), createLiteral("true"), parsingContext)));
auto colorFn = mbgl::style::SourceFunction<mbgl::Color> { "height",
mbgl::style::ExponentialStops<mbgl::Color> {

View File

@@ -8,9 +8,33 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* The minimum deployment target for this SDK is now iOS 9.0. ([#11776](https://github.com/mapbox/mapbox-gl-native/pull/11776))
## 4.0.1 - May 14, 2018
### Packaging
* Re-added support for 32-bit simulators (i386) to work around an issue in CocoaPods. ([#11891](https://github.com/mapbox/mapbox-gl-native/pull/11891))
* Added a Korean localization. ([#11792](https://github.com/mapbox/mapbox-gl-native/pull/11792))
### Style layers
* Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748))
* Deprecated `+[NSExpression featurePropertiesVariableExpression]`; use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748))
* Added an `-[NSPredicate(MGLAdditions) predicateWithMGLJSONObject:]` method and `NSPredicate.mgl_jsonExpressionObject` property. ([#11810](https://github.com/mapbox/mapbox-gl-native/pull/11810))
* Added `FIRST`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770))
* Inside an expression, casting `nil` to a string turns it into the empty string instead of the string `"null"`. ([#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904))
* Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MGLStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725))
### Annotations
* Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731))
* Fixed an issue where annotation views could become distorted if `rotatesToMatchCamera` was enabled. ([#11817](https://github.com/mapbox/mapbox-gl-native/pull/11817))
* Fixed `MGLAnnotationView.rotatesToMatchCamera` overriding other transforms that might be applied to annotation views that had this property enabled. ([#11842](https://github.com/mapbox/mapbox-gl-native/pull/11842))
* Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783))
### Other changes
* If English is the first language listed in the user’s Preferred Languages setting, `-[MGLStyle localizeLabelsIntoLocale:]` no longer prioritizes other languages over English. ([#11907](https://github.com/mapbox/mapbox-gl-native/pull/11907))
* Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765))
* Reduced per-frame render CPU time. ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811))
## 3.7.8 - May 7, 2018

View File

@@ -11,7 +11,7 @@ The Mapbox Maps SDK for iOS is intended to run on iOS 9.0 and above on the follo
* iPod touch 5th generation and above
Note that 32-bit simulators (such as the iPhone 5 or iPad 2) are not supported.
Note that debugging in 32-bit simulators (such as the iPhone 5 or iPad 2) is only partially supported.
The Mapbox Maps SDK for iOS requires:

View File

@@ -0,0 +1,61 @@
#import "MGLMapViewIntegrationTest.h"
@interface MGLStyleLayerIntegrationTests : MGLMapViewIntegrationTest
@end
@implementation MGLStyleLayerIntegrationTests
- (MGLCircleStyleLayer*)setupCircleStyleLayer {
// Adapted from https://www.mapbox.com/ios-sdk/examples/dds-circle-layer/
// "mapbox://examples.2uf7qges" is a map ID referencing a tileset. For more
// more information, see mapbox.com/help/define-map-id/
MGLSource *source = [[MGLVectorTileSource alloc] initWithIdentifier:@"trees" configurationURL:[NSURL URLWithString:@"mapbox://examples.2uf7qges"]];
[self.mapView.style addSource:source];
MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier: @"tree-style" source:source];
// The source name from the source's TileJSON metadata: mapbox.com/api-documentation/#retrieve-tilejson-metadata
layer.sourceLayerIdentifier = @"yoshino-trees-a0puw5";
return layer;
}
- (void)testForInterpolatingExpressionRenderCrashWithEmptyStops {
// Tests: https://github.com/mapbox/mapbox-gl-native/issues/9539
// Adapted from https://www.mapbox.com/ios-sdk/examples/dds-circle-layer/
self.mapView.centerCoordinate = CLLocationCoordinate2DMake(38.897,-77.039);
self.mapView.zoomLevel = 10.5;
MGLCircleStyleLayer *layer = [self setupCircleStyleLayer];
NSExpression *interpExpression = [NSExpression mgl_expressionForInterpolatingExpression:NSExpression.zoomLevelVariableExpression
withCurveType:MGLExpressionInterpolationModeLinear
parameters:nil
stops:[NSExpression expressionForConstantValue:@{}]];
XCTAssertThrowsSpecificNamed((layer.circleColor = interpExpression), NSException, NSInvalidArgumentException);
[self.mapView.style addLayer:layer];
[self waitForMapViewToBeRenderedWithTimeout:1.0];
}
- (void)testForSteppingExpressionRenderCrashWithEmptyStops {
// Tests: https://github.com/mapbox/mapbox-gl-native/issues/9539
// Adapted from https://www.mapbox.com/ios-sdk/examples/dds-circle-layer/
self.mapView.centerCoordinate = CLLocationCoordinate2DMake(38.897,-77.039);
self.mapView.zoomLevel = 10.5;
MGLCircleStyleLayer *layer = [self setupCircleStyleLayer];
NSExpression *steppingExpression = [NSExpression mgl_expressionForSteppingExpression:NSExpression.zoomLevelVariableExpression
fromExpression:[NSExpression expressionForConstantValue:[UIColor greenColor]]
stops:[NSExpression expressionForConstantValue:@{}]];
XCTAssertThrowsSpecificNamed((layer.circleColor = steppingExpression), NSException, NSInvalidArgumentException);
[self.mapView.style addLayer:layer];
[self waitForMapViewToBeRenderedWithTimeout:1.0];
}
@end

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
version = '4.0.0'
version = '4.0.1'
m.name = 'Mapbox-iOS-SDK-nightly-dynamic'
m.version = "#{version}-nightly"

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
version = '4.0.0'
version = '4.0.1'
m.name = 'Mapbox-iOS-SDK-symbols'
m.version = "#{version}-symbols"

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
version = '4.0.0'
version = '4.0.1'
m.name = 'Mapbox-iOS-SDK'
m.version = version

View File

@@ -5,6 +5,7 @@
#import "MBXOfflinePacksTableViewController.h"
#import "MBXAnnotationView.h"
#import "MBXUserLocationAnnotationView.h"
#import "LimeGreenStyleLayer.h"
#import "MBXEmbeddedMapViewController.h"
#import <Mapbox/Mapbox.h>
@@ -82,6 +83,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsRuntimeStylingRows) {
MBXSettingsRuntimeStylingRasterTileSource,
MBXSettingsRuntimeStylingImageSource,
MBXSettingsRuntimeStylingRouteLine,
MBXSettingsRuntimeStylingAddLimeGreenTriangleLayer,
MBXSettingsRuntimeStylingDDSPolygon,
MBXSettingsRuntimeStylingCustomLatLonGrid,
};
@@ -366,6 +368,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
@"Style Raster Tile Source",
@"Style Image Source",
@"Add Route Line",
@"Add Lime Green Triangle Layer",
@"Dynamically Style Polygon",
@"Add Custom Lat/Lon Grid",
]];
@@ -554,6 +557,9 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
case MBXSettingsRuntimeStylingRouteLine:
[self styleRouteLine];
break;
case MBXSettingsRuntimeStylingAddLimeGreenTriangleLayer:
[self styleAddLimeGreenTriangleLayer];
break;
case MBXSettingsRuntimeStylingDDSPolygon:
[self stylePolygonWithDDS];
break;
@@ -1438,6 +1444,12 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
[self.mapView.style addLayer:routeLayer];
}
- (void)styleAddLimeGreenTriangleLayer
{
LimeGreenStyleLayer *layer = [[LimeGreenStyleLayer alloc] initWithIdentifier:@"mbx-custom"];
[self.mapView.style addLayer:layer];
}
- (void)stylePolygonWithDDS {
CLLocationCoordinate2D leftCoords[] = {
{37.73081027834234, -122.49412536621094},

View File

@@ -280,7 +280,7 @@ Each property representing a layout or paint attribute is set to an
but you create the former using a very different syntax. `NSExpression`’s format
string syntax is reminiscent of a spreadsheet formula or an expression in a
database query. See the
“[Predicates and Expressions](Predicates and Expressions.md)” guide for an
“[Predicates and Expressions](predicates-and-expressions.html)” guide for an
overview of the expression support in this SDK. This SDK no longer supports
style functions; use expressions instead.
@@ -325,7 +325,7 @@ In style specification | Method, function, or predicate type | Format string syn
`number` | |
`string` | |
`to-boolean` | `boolValue` |
`to-color` | |
`to-color` | | `CAST(var, 'UIColor')`
`to-number` | `mgl_numberWithFallbackValues:` | `CAST(zipCode, 'NSNumber')`
`to-string` | `stringValue` | `CAST(ele, 'NSString')`
`typeof` | |
@@ -357,7 +357,7 @@ In style specification | Method, function, or predicate type | Format string syn
`upcase` | `uppercase:` | `uppercase('Elysian Fields')`
`rgb` | `+[UIColor colorWithRed:green:blue:alpha:]` |
`rgba` | `+[UIColor colorWithRed:green:blue:alpha:]` |
`to-rgba` | |
`to-rgba` | | `CAST(noindex(var), 'NSArray')`
`-` | `from:subtract:` | `2 - 1`
`*` | `multiply:by:` | `1 * 2`
`/` | `divide:by:` | `1 / 2`
@@ -412,5 +412,5 @@ In style JSON | In the format string
`["any", f0, …, fn]` | `p0 OR … OR pn`
`["none", f0, …, fn]` | `NOT (p0 OR … OR pn)`
See the “[Predicates and Expressions](Predicates and Expressions.md)” guide for
See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for
a full description of the supported operators and operand types.

View File

@@ -0,0 +1,3 @@
"TELEMETRY_GROUP_TITLE" = "개인 정보 설정";
"TELEMETRY_SWITCH_TITLE" = "맵박스 텔레메트리";
"TELEMETRY_GROUP_FOOTER" = "이 설정은 어플리케이션이 익명화된 장소와 사용데이터를 맵박스와 공유하는것을 허용합니다.";

View File

@@ -36,6 +36,8 @@
1F7454971ECD450D00021D39 /* MGLLight_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F7454941ECD450D00021D39 /* MGLLight_Private.h */; };
1F7454A91ED08AB400021D39 /* MGLLightTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F7454A61ED08AB400021D39 /* MGLLightTest.mm */; };
1F95931D1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931C1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm */; };
1FC4817D2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC4817B2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h */; };
1FC4817F2098CD80000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC4817B2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h */; };
30E578171DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; };
30E578181DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; };
30E578191DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 30E578121DAA7D690050F07E /* UIImage+MGLAdditions.mm */; };
@@ -53,7 +55,6 @@
3510FFEC1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3510FFE91D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm */; };
3510FFED1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3510FFE91D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm */; };
3510FFF01D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3510FFEE1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
3510FFF11D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3510FFEE1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
3510FFF21D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3510FFEF1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm */; };
3510FFF31D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3510FFEF1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm */; };
3510FFF91D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3510FFF71D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.h */; };
@@ -131,8 +132,8 @@
357FE2E01E02D2B20068B753 /* NSCoder+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 357FE2DC1E02D2B20068B753 /* NSCoder+MGLAdditions.mm */; };
3598544D1E1D38AA00B29F84 /* MGLDistanceFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3598544C1E1D38AA00B29F84 /* MGLDistanceFormatterTests.m */; };
359F57461D2FDDA6005217F1 /* MGLUserLocationAnnotationView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 359F57451D2FDBD5005217F1 /* MGLUserLocationAnnotationView_Private.h */; };
35B82BF81D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; };
35B82BF91D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; };
35B82BF81D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
35B82BF91D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
35B82BFA1D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35B82BF71D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm */; };
35B82BFB1D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35B82BF71D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm */; };
35B8E08C1D6C8B5100E768D2 /* MGLPredicateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35B8E08B1D6C8B5100E768D2 /* MGLPredicateTests.mm */; };
@@ -159,6 +160,9 @@
35E79F201D41266300957B9E /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */; };
35E79F211D41266300957B9E /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */; };
36F1153D1D46080700878E1A /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 36F1153B1D46080700878E1A /* libmbgl-core.a */; };
3E6465D62065767A00685536 /* LimeGreenStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E6465D42065767A00685536 /* LimeGreenStyleLayer.m */; };
3E8770612074297100B7E842 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554180411D2E97DE00012372 /* OpenGLES.framework */; };
3E8E82F120744B4100E7BE97 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E8E82F020744B4100E7BE97 /* libmbgl-core.a */; };
3EA93369F61CF70AFA50465D /* MGLRendererConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3EA931BC4F087E166D538F21 /* MGLRendererConfiguration.mm */; };
3EA934623AD0000B7D99C3FB /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */; };
3EA9363147E77DD29FA06063 /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */; };
@@ -267,9 +271,6 @@
40F887701D7A1E58008ECB67 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */; };
40F887711D7A1E59008ECB67 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */; };
40FDA76B1CCAAA6800442548 /* MBXAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 40FDA76A1CCAAA6800442548 /* MBXAnnotationView.m */; };
5549A0381EF1D86B00073113 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5549A0371EF1D86B00073113 /* libmbgl-core.a */; };
5549A0391EF2877100073113 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554180411D2E97DE00012372 /* OpenGLES.framework */; };
5549A03A1EF2877500073113 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554180411D2E97DE00012372 /* OpenGLES.framework */; };
556660CA1E1BF3A900E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; };
556660D81E1D085500E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D71E1D085500E2C41B /* MGLVersionNumber.m */; };
556660DB1E1D8E8D00E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -307,6 +308,7 @@
9620BB391E69FE1700705A1D /* MGLSDKUpdateChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 9620BB361E69FE1700705A1D /* MGLSDKUpdateChecker.h */; };
9620BB3A1E69FE1700705A1D /* MGLSDKUpdateChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */; };
9620BB3B1E69FE1700705A1D /* MGLSDKUpdateChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */; };
9621F2502091020E005B3800 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3510FFEE1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
9654C1261FFC1AB900DB6A19 /* MGLPolyline_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C1251FFC1AB900DB6A19 /* MGLPolyline_Private.h */; };
9654C1291FFC1CCD00DB6A19 /* MGLPolygon_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C1271FFC1CC000DB6A19 /* MGLPolygon_Private.h */; };
9658C155204761FC00D8A674 /* MGLMapViewScaleBarTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9658C154204761FC00D8A674 /* MGLMapViewScaleBarTests.m */; };
@@ -362,6 +364,7 @@
AC518E03201BB56000EBC820 /* MGLTelemetryConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */; };
AC518E04201BB56100EBC820 /* MGLTelemetryConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */; };
CA0C27942076CA19001CE5B7 /* MGLMapViewIntegrationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */; };
CA4EB8C720863487006AB465 /* MGLStyleLayerIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA4EB8C620863487006AB465 /* MGLStyleLayerIntegrationTests.m */; };
CA55CD41202C16AA00CE7095 /* MGLCameraChangeReason.h in Headers */ = {isa = PBXBuildFile; fileRef = CA55CD3E202C16AA00CE7095 /* MGLCameraChangeReason.h */; settings = {ATTRIBUTES = (Public, ); }; };
CA55CD42202C16AA00CE7095 /* MGLCameraChangeReason.h in Headers */ = {isa = PBXBuildFile; fileRef = CA55CD3E202C16AA00CE7095 /* MGLCameraChangeReason.h */; settings = {ATTRIBUTES = (Public, ); }; };
CAA69DA4206DCD0E007279CD /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA4A26961CB6E795000B7809 /* Mapbox.framework */; };
@@ -510,8 +513,6 @@
DA8963381CC549A100684375 /* sprites in Resources */ = {isa = PBXBuildFile; fileRef = DA8963341CC549A100684375 /* sprites */; };
DA8963391CC549A100684375 /* styles in Resources */ = {isa = PBXBuildFile; fileRef = DA8963351CC549A100684375 /* styles */; };
DA89633A1CC549A100684375 /* tiles in Resources */ = {isa = PBXBuildFile; fileRef = DA8963361CC549A100684375 /* tiles */; };
DA9EA82B201C0C0C00F9874D /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA9EA82A201C0C0B00F9874D /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
DA9EA82C201C0C0C00F9874D /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA9EA82A201C0C0B00F9874D /* NSExpression+MGLAdditions.h */; };
DAA32CC31E4C6B65006F8D24 /* MGLDistanceFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3557F7AF1E1D27D300CCA5E6 /* MGLDistanceFormatter.m */; };
DAA4E4081CBB6C9500178DFB /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA8847D21CBAF91600AB86E3 /* Mapbox.framework */; };
DAA4E4091CBB6C9500178DFB /* Mapbox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DA8847D21CBAF91600AB86E3 /* Mapbox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -754,6 +755,7 @@
1F7454941ECD450D00021D39 /* MGLLight_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLight_Private.h; sourceTree = "<group>"; };
1F7454A61ED08AB400021D39 /* MGLLightTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLLightTest.mm; path = ../../darwin/test/MGLLightTest.mm; sourceTree = "<group>"; };
1F95931C1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLNSDateAdditionsTests.mm; path = ../../darwin/test/MGLNSDateAdditionsTests.mm; sourceTree = "<group>"; };
1FC4817B2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MGLPrivateAdditions.h"; sourceTree = "<group>"; };
20DABE861DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Foundation.strings"; sourceTree = "<group>"; };
20DABE881DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
20DABE8A1DF78149007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Root.strings"; sourceTree = "<group>"; };
@@ -830,6 +832,9 @@
35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayer_Private.h; sourceTree = "<group>"; };
36F1153B1D46080700878E1A /* libmbgl-core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-core.a"; path = "build/Debug-iphoneos/libmbgl-core.a"; sourceTree = "<group>"; };
36F1153C1D46080700878E1A /* libmbgl-platform-ios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-platform-ios.a"; path = "build/Debug-iphoneos/libmbgl-platform-ios.a"; sourceTree = "<group>"; };
3E6465D42065767A00685536 /* LimeGreenStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LimeGreenStyleLayer.m; path = ../../darwin/app/LimeGreenStyleLayer.m; sourceTree = "<group>"; };
3E6465D52065767A00685536 /* LimeGreenStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LimeGreenStyleLayer.h; path = ../../darwin/app/LimeGreenStyleLayer.h; sourceTree = "<group>"; };
3E8E82F020744B4100E7BE97 /* libmbgl-core.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-core.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3EA931BC4F087E166D538F21 /* MGLRendererConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRendererConfiguration.mm; sourceTree = "<group>"; };
3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRendererConfiguration.h; sourceTree = "<group>"; };
400532FF1DB0862B0069F638 /* NSArray+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLAdditions.h"; sourceTree = "<group>"; };
@@ -993,6 +998,7 @@
AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLTelemetryConfig.m; sourceTree = "<group>"; };
CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLMapViewIntegrationTest.m; sourceTree = "<group>"; };
CA0C27952076CA50001CE5B7 /* MGLMapViewIntegrationTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLMapViewIntegrationTest.h; sourceTree = "<group>"; };
CA4EB8C620863487006AB465 /* MGLStyleLayerIntegrationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLStyleLayerIntegrationTests.m; sourceTree = "<group>"; };
CA55CD3E202C16AA00CE7095 /* MGLCameraChangeReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCameraChangeReason.h; sourceTree = "<group>"; };
DA00FC8C1D5EEB0D009AABC8 /* MGLAttributionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributionInfo.h; sourceTree = "<group>"; };
DA00FC8D1D5EEB0D009AABC8 /* MGLAttributionInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLAttributionInfo.mm; sourceTree = "<group>"; };
@@ -1186,7 +1192,6 @@
DA9C012C1E4C7ADB00C4742A /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "pt-BR"; path = "pt-BR.lproj/Foundation.stringsdict"; sourceTree = "<group>"; };
DA9C012D1E4C7B1F00C4742A /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = "<group>"; };
DA9C012E1E4C7B6100C4742A /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Root.strings"; sourceTree = "<group>"; };
DA9EA82A201C0C0B00F9874D /* NSExpression+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLAdditions.h"; sourceTree = "<group>"; };
DAA32CA11E4C44DB006F8D24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = de; path = de.lproj/Foundation.stringsdict; sourceTree = "<group>"; };
DAA32CA21E4C44DD006F8D24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = de; path = de.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
DAA32CA31E4C44F1006F8D24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Foundation.strings; sourceTree = "<group>"; };
@@ -1257,6 +1262,12 @@
DAFBD0D21E3FA7A1000CD6BF /* zh-Hant */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Foundation.strings"; sourceTree = "<group>"; };
DAFBD0D31E3FA7A1000CD6BF /* zh-Hant */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
DAFBD0D41E3FA7A2000CD6BF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Root.strings"; sourceTree = "<group>"; };
DAFEB3742093AE3700A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
DAFEB3752093AE4800A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Foundation.strings; sourceTree = "<group>"; };
DAFEB3762093AE6800A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ko; path = ko.lproj/Foundation.stringsdict; sourceTree = "<group>"; };
DAFEB3772093AE7900A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
DAFEB3782093AE9200A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ko; path = ko.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
DAFEB3792093AEA100A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Root.strings; sourceTree = "<group>"; };
DD0902A21DB18DE700C5BDCE /* MGLNetworkConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLNetworkConfiguration.m; sourceTree = "<group>"; };
DD0902A41DB18F1B00C5BDCE /* MGLNetworkConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLNetworkConfiguration.h; sourceTree = "<group>"; };
DD4823721D94AE6C00EB71B7 /* fill_filter_style.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = fill_filter_style.json; sourceTree = "<group>"; };
@@ -1292,7 +1303,6 @@
buildActionMask = 2147483647;
files = (
DA8847D91CBAF91600AB86E3 /* Mapbox.framework in Frameworks */,
5549A0391EF2877100073113 /* OpenGLES.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1300,7 +1310,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5549A0381EF1D86B00073113 /* libmbgl-core.a in Frameworks */,
3E8E82F120744B4100E7BE97 /* libmbgl-core.a in Frameworks */,
DA2E88561CC036F400F24E7B /* Mapbox.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1331,7 +1341,7 @@
buildActionMask = 2147483647;
files = (
DAA4E4081CBB6C9500178DFB /* Mapbox.framework in Frameworks */,
5549A03A1EF2877500073113 /* OpenGLES.framework in Frameworks */,
3E8770612074297100B7E842 /* OpenGLES.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1345,6 +1355,7 @@
16376B0B1FFD9DAF0000563E /* Info.plist */,
CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */,
CA0C27952076CA50001CE5B7 /* MGLMapViewIntegrationTest.h */,
CA4EB8C620863487006AB465 /* MGLStyleLayerIntegrationTests.m */,
);
path = "Integration Tests";
sourceTree = "<group>";
@@ -1724,6 +1735,8 @@
DA1DC94C1CB6C1C2006E619F /* Demo App */ = {
isa = PBXGroup;
children = (
3E6465D52065767A00685536 /* LimeGreenStyleLayer.h */,
3E6465D42065767A00685536 /* LimeGreenStyleLayer.m */,
DA1DC9501CB6C1C2006E619F /* MBXAppDelegate.h */,
DA1DC9981CB6E054006E619F /* MBXAppDelegate.m */,
40FDA7691CCAAA6800442548 /* MBXAnnotationView.h */,
@@ -1763,6 +1776,7 @@
DA1DC9921CB6DF24006E619F /* Frameworks */ = {
isa = PBXGroup;
children = (
3E8E82F020744B4100E7BE97 /* libmbgl-core.a */,
55D120AD1F791018004B6D81 /* libmbgl-loop-darwin.a */,
55D120AB1F791015004B6D81 /* libmbgl-filesource.a */,
55D120A91F79100C004B6D81 /* libmbgl-filesource.a */,
@@ -2096,11 +2110,11 @@
408AA8561DAEDA0800022900 /* NSDictionary+MGLAdditions.mm */,
DA8848141CBAFA6200AB86E3 /* NSException+MGLAdditions.h */,
3510FFEE1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h */,
DA9EA82A201C0C0B00F9874D /* NSExpression+MGLAdditions.h */,
DAC25FCB200FD83E009BE98E /* NSExpression+MGLPrivateAdditions.h */,
3510FFEF1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm */,
35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */,
35B82BF71D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm */,
1FC4817B2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h */,
DA8848151CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h */,
DA8848161CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m */,
DA8848171CBAFA6200AB86E3 /* NSString+MGLAdditions.h */,
@@ -2189,6 +2203,7 @@
DA88483B1CBAFB8500AB86E3 /* MGLCalloutView.h in Headers */,
35E0CFE61D3E501500188327 /* MGLStyle_Private.h in Headers */,
3510FFF01D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h in Headers */,
1FC4817D2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */,
353AFA141D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */,
DA8848531CBAFB9800AB86E3 /* MGLCompactCalloutView.h in Headers */,
DA8847FB1CBAFA5100AB86E3 /* MGLShape.h in Headers */,
@@ -2286,7 +2301,6 @@
DA8848841CBB033F00AB86E3 /* FABAttributes.h in Headers */,
DA8847FD1CBAFA5100AB86E3 /* MGLTilePyramidOfflineRegion.h in Headers */,
DA88482F1CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h in Headers */,
DA9EA82B201C0C0C00F9874D /* NSExpression+MGLAdditions.h in Headers */,
DA8848601CBAFC2E00AB86E3 /* Mapbox.h in Headers */,
DAF0D8101DFE0EA000B28378 /* MGLRasterTileSource_Private.h in Headers */,
350098BB1D480108004B2AF0 /* MGLVectorTileSource.h in Headers */,
@@ -2316,7 +2330,6 @@
DABFB8641CBE99E500D62B32 /* MGLOfflineStorage.h in Headers */,
96E516E32000552A00A02306 /* MGLAccountManager_Private.h in Headers */,
96E5170420005A6B00A02306 /* SMCalloutView.h in Headers */,
DA9EA82C201C0C0C00F9874D /* NSExpression+MGLAdditions.h in Headers */,
96036A02200565C700510F3D /* NSOrthography+MGLAdditions.h in Headers */,
DAD165791CF4CDFF001FF4B9 /* MGLShapeCollection.h in Headers */,
4049C29E1DB6CD6C00B3F799 /* MGLPointCollection.h in Headers */,
@@ -2326,7 +2339,6 @@
96E516F6200059EC00A02306 /* MGLRendererFrontend.h in Headers */,
071BBB041EE76147001FB02A /* MGLImageSource.h in Headers */,
DABFB8611CBE99E500D62B32 /* MGLMultiPoint.h in Headers */,
3510FFF11D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h in Headers */,
35D3A1E71E9BE7EC002B38EE /* MGLScaleBar.h in Headers */,
96E516EF2000594F00A02306 /* NSArray+MGLAdditions.h in Headers */,
96E516F12000596800A02306 /* NSString+MGLAdditions.h in Headers */,
@@ -2371,6 +2383,7 @@
96E516F920005A3500A02306 /* MGLFaux3DUserLocationAnnotationView.h in Headers */,
96E516F22000596D00A02306 /* NSException+MGLAdditions.h in Headers */,
96E516EC2000560B00A02306 /* MGLUserLocationAnnotationView_Private.h in Headers */,
1FC4817F2098CD80000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */,
DABFB8671CBE99E500D62B32 /* MGLPolygon.h in Headers */,
404C26E81D89C55D000AA13D /* MGLTileSource_Private.h in Headers */,
1F7454931ECBB43F00021D39 /* MGLLight.h in Headers */,
@@ -2431,6 +2444,7 @@
96E516E12000551100A02306 /* MGLMultiPoint_Private.h in Headers */,
3EA934623AD0000B7D99C3FB /* MGLRendererConfiguration.h in Headers */,
DACA86272019218600E9693A /* MGLRasterDEMSource.h in Headers */,
9621F2502091020E005B3800 /* NSExpression+MGLAdditions.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2606,7 +2620,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = MBX;
LastUpgradeCheck = 0910;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = Mapbox;
TargetAttributes = {
16376B061FFD9DAF0000563E = {
@@ -2673,6 +2687,7 @@
he,
da,
"pt-PT",
ko,
);
mainGroup = DA1DC9411CB6C1C2006E619F;
productRefGroup = DA1DC94B1CB6C1C2006E619F /* Products */;
@@ -2793,6 +2808,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CA4EB8C720863487006AB465 /* MGLStyleLayerIntegrationTests.m in Sources */,
16376B0A1FFD9DAF0000563E /* MBGLIntegrationTests.m in Sources */,
CA0C27942076CA19001CE5B7 /* MGLMapViewIntegrationTest.m in Sources */,
);
@@ -2819,6 +2835,7 @@
927FBCFC1F4DAA8300F8BF1F /* MBXSnapshotsViewController.m in Sources */,
DA1DC99B1CB6E064006E619F /* MBXViewController.m in Sources */,
40FDA76B1CCAAA6800442548 /* MBXAnnotationView.m in Sources */,
3E6465D62065767A00685536 /* LimeGreenStyleLayer.m in Sources */,
632281DF1E6F855900D75A5D /* MBXEmbeddedMapViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -3216,6 +3233,7 @@
DACBC60B20118ABE00C4D7E2 /* he */,
DAD88E07202ACFE800AAA536 /* da */,
DA93409B208562EB0059919A /* pt-PT */,
DAFEB3742093AE3700A86A83 /* ko */,
);
name = Localizable.strings;
sourceTree = "<group>";
@@ -3244,6 +3262,7 @@
DACBC60E20118AFE00C4D7E2 /* he */,
DAD88E0C202AD06500AAA536 /* da */,
DA93409F208563440059919A /* pt-PT */,
DAFEB3792093AEA100A86A83 /* ko */,
);
name = Root.strings;
sourceTree = "<group>";
@@ -3270,6 +3289,7 @@
DACBC60D20118ADE00C4D7E2 /* he */,
DAD88E0A202AD03C00AAA536 /* da */,
DA93409D208563220059919A /* pt-PT */,
DAFEB3772093AE7900A86A83 /* ko */,
);
name = Localizable.strings;
sourceTree = "<group>";
@@ -3293,6 +3313,7 @@
DA3389661FA3EE28001EA329 /* bg */,
DACBC60C20118AD000C4D7E2 /* he */,
DAD88E08202AD01300AAA536 /* da */,
DAFEB3752093AE4800A86A83 /* ko */,
);
name = Foundation.strings;
sourceTree = "<group>";
@@ -3317,6 +3338,7 @@
DA80E9611FE84AEF0065FC9B /* ar */,
DAD88E09202AD01F00AAA536 /* da */,
DA93409C2085630C0059919A /* pt-PT */,
DAFEB3762093AE6800A86A83 /* ko */,
);
name = Foundation.stringsdict;
sourceTree = "<group>";
@@ -3347,6 +3369,7 @@
DA3389691FA3EE50001EA329 /* bg */,
DAD88E0B202AD04D00AAA536 /* da */,
DA93409E208563360059919A /* pt-PT */,
DAFEB3782093AE9200A86A83 /* ko */,
);
name = Localizable.stringsdict;
sourceTree = "<group>";
@@ -3466,6 +3489,7 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
@@ -3473,6 +3497,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -3525,6 +3550,7 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
@@ -3532,6 +3558,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -54,7 +54,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -66,6 +65,14 @@
BlueprintName = "test"
ReferencedContainer = "container:ios.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "MGLAnnotationViewTests/testAnnotationViewInitWithFrame">
</Test>
<Test
Identifier = "MGLAnnotationViewTests/testSelectingADisabledAnnotationView">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
<MacroExpansion>
@@ -84,7 +91,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@@ -46,7 +45,6 @@
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -54,7 +54,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -84,7 +83,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -70,7 +69,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -19,10 +19,10 @@ custom_categories:
children:
- Adding Markers to a Map
- Runtime Styling
- Migrating to Expressions
- Working with Mapbox Studio
- Working with GeoJSON Data
- Predicates and Expressions
- Migrating to Expressions
- For Style Authors
- Tile URL Templates
- Info.plist Keys

View File

@@ -0,0 +1,117 @@
/* Accessibility hint */
"ANNOTATION_A11Y_HINT" = "추가 정보 보기";
/* No comment provided by engineer. */
"API_CLIENT_400_DESC" = "세션 데이타 작업 실패. 초기 요청: %@";
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "상태 코드 %ld";
/* No comment provided by engineer. */
"CANCEL" = "취소";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
"CLOSE_CALLOUT_A11Y_HINT" = "지도로 복귀";
/* Accessibility hint */
"COMPASS_A11Y_HINT" = "정북쪽으로 지도 회전";
/* Accessibility label */
"COMPASS_A11Y_LABEL" = "나침반";
/* Compass abbreviation for north */
"COMPASS_NORTH" = "북";
/* Instructions in Interface Builder designable; {key}, {plist file name} */
"DESIGNABLE" = "맵박스에의한 지도를 출력하기 위해, %1$@ 를 %2$@에 당신의 접근 토큰으로 으로 설정하십시오. \n\n자세한 정보를 찾으시는 경우, 확인:";
/* Setup documentation URL display string; keep as short as possible */
"FIRST_STEPS_URL" = "mapbox.com/help/first-steps-ios-sdk";
/* Accessibility hint */
"INFO_A11Y_HINT" = "크레딧, 피드백 폼, 기타 보기";
/* Accessibility label */
"INFO_A11Y_LABEL" = "이 맵에 관하여";
/* List separator */
"LIST_SEPARATOR" = ", ";
/* User-friendly error description */
"LOAD_MAP_FAILED_DESC" = "알수 없는 에러로 인해 맵 로드에 실패하였습니다.";
/* User-friendly error description */
"LOAD_STYLE_FAILED_DESC" = "형식이 로드되지 않아, 맵 로드에 실패하였습니다.";
/* Accessibility label */
"LOGO_A11Y_LABEL" = "맵박스";
/* Accessibility label */
"MAP_A11Y_LABEL" = "지도";
/* Map accessibility value; {number of visible annotations} */
"MAP_A11Y_VALUE_ANNOTATIONS" = "%ld 주석 볼 수 있는.";
/* Map accessibility value; {list of visible places} */
"MAP_A11Y_VALUE_PLACES" = "가시거리 범위: %@.";
/* Map accessibility value; {number of visible roads} */
"MAP_A11Y_VALUE_ROADS" = "%ld 도로 볼 수 있는.";
/* Map accessibility value; {zoom level} */
"MAP_A11Y_VALUE_ZOOM" = "확대 %dx.";
/* User-friendly error description */
"PARSE_STYLE_FAILED_DESC" = "형식에 오류가 발생하여 맵 로드에 실패하였습니다.";
/* String format for accessibility value for road feature; {starting compass direction}, {ending compass direction} */
"ROAD_DIRECTION_A11Y_FMT" = "%1$@ to %2$@";
/* Accessibility value indicating that a road is a divided road (dual carriageway) */
"ROAD_DIVIDED_A11Y_VALUE" = "분리 도로";
/* Accessibility value indicating that a road is a one-way road */
"ROAD_ONEWAY_A11Y_VALUE" = "일방 통행";
/* String format for accessibility value for road feature; {route number} */
"ROAD_REF_A11Y_FMT" = "경로 %@";
/* Action sheet title */
"SDK_NAME" = "iOS를 위한 맵박스 지도 SDK";
/* Developer-only SDK update notification; {latest version, in format x.x.x} */
"SDK_UPDATE_AVAILABLE" = "iOS버전 맵박스 지도 %@가 사용 가능합니다:";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "형식을 찾을 수 없거나 호환이 되지 않아, 맵 로드에 실패하였습니다.";
/* Telemetry prompt message */
"TELEMETRY_DISABLED_MSG" = "당신은 익명의 사용 데이타를 제공함으로써, 오픈스트리트맵과 맵박스의 향상에 기여하고 있습니다.";
/* Telemetry prompt button */
"TELEMETRY_DISABLED_OFF" = "참여하지 마십시오";
/* Telemetry prompt button */
"TELEMETRY_DISABLED_ON" = "참여";
/* Telemetry prompt message */
"TELEMETRY_ENABLED_MSG" = "당신은 익명의 사용 데이타를 제공함으로써, 오픈스트리트맵과 맵박스의 향상에 기여하고 있습니다.";
/* Telemetry prompt button */
"TELEMETRY_ENABLED_OFF" = "참여 중지";
/* Telemetry prompt button */
"TELEMETRY_ENABLED_ON" = "참여 계속";
/* Telemetry prompt button */
"TELEMETRY_MORE" = "좀 더 말해보세요";
/* Action in attribution sheet */
"TELEMETRY_NAME" = "맵박스 텔레메트리";
/* Telemetry prompt title */
"TELEMETRY_TITLE" = "더 나은 맵박스 지도 만들기";
/* Default user location annotation title */
"USER_DOT_TITLE" = "당신의 위치";

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>MAP_A11Y_VALUE_ANNOTATIONS</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@count@</string>
<key>count</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>ld</string>
<key>other</key>
<string>%d 주석 보이기</string>
</dict>
</dict>
<key>MAP_A11Y_VALUE_ROADS</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@count@</string>
<key>count</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>ld</string>
<key>other</key>
<string>%d 도로 보이기</string>
</dict>
</dict>
<key>MAP_A11Y_VALUE_ZOOM</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@level@</string>
<key>level</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>other</key>
<string>확대 %dx</string>
</dict>
</dict>
</dict>
</plist>

View File

@@ -70,7 +70,7 @@ xcodebuild \
CURRENT_SHORT_VERSION=${SHORT_VERSION} \
CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \
CURRENT_COMMIT_HASH=${HASH} \
ARCHS="x86_64" \
ONLY_ACTIVE_ARCH=NO \
-derivedDataPath ${DERIVED_DATA} \
-workspace ./platform/ios/ios.xcworkspace \
-scheme ${SCHEME} \
@@ -194,6 +194,10 @@ if [[ ${BUILD_DYNAMIC} == true && ${BUILDTYPE} == Release ]]; then
validate_dsym \
"${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" \
"${OUTPUT}/dynamic/${NAME}.framework/${NAME}"
step "Removing i386 slice from dSYM"
lipo -remove i386 "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" -o "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}"
lipo -info "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}"
fi
function create_podspec {

View File

@@ -11,8 +11,9 @@
@property (nonatomic, readwrite, nullable) NSString *reuseIdentifier;
@property (nonatomic, readwrite) CATransform3D lastAppliedScaleTransform;
@property (nonatomic, readwrite) CATransform3D lastAppliedRotateTransform;
@property (nonatomic, readwrite) CGFloat lastPitch;
@property (nonatomic, readwrite) CATransform3D lastAppliedRotationTransform;
@property (nonatomic, readwrite) CGFloat lastDirection;
@property (nonatomic, weak) UIPanGestureRecognizer *panGestureRecognizer;
@property (nonatomic, weak) UILongPressGestureRecognizer *longPressRecognizer;
@property (nonatomic, weak) MGLMapView *mapView;
@@ -43,9 +44,9 @@
- (void)commonInitWithAnnotation:(nullable id<MGLAnnotation>)annotation reuseIdentifier:(nullable NSString *)reuseIdentifier {
_lastAppliedScaleTransform = CATransform3DIdentity;
_lastAppliedRotationTransform = CATransform3DIdentity;
_annotation = annotation;
_reuseIdentifier = [reuseIdentifier copy];
_scalesWithViewingDistance = NO;
_enabled = YES;
}
@@ -159,7 +160,7 @@
// We keep track of each viewing distance scale transform that we apply. Each iteration,
// we can account for it so that we don't get cumulative scaling every time we move.
// We also avoid clobbering any existing transform passed in by the client, too.
// We also avoid clobbering any existing transform passed in by the client or this SDK.
CATransform3D undoOfLastScaleTransform = CATransform3DInvert(_lastAppliedScaleTransform);
CATransform3D newScaleTransform = CATransform3DMakeScale(pitchAdjustedScale, pitchAdjustedScale, 1);
CATransform3D effectiveTransform = CATransform3DConcat(undoOfLastScaleTransform, newScaleTransform);
@@ -181,11 +182,20 @@
{
if (self.rotatesToMatchCamera == NO) return;
CGFloat directionRad = self.mapView.direction * M_PI / 180.0;
CATransform3D newRotateTransform = CATransform3DMakeRotation(-directionRad, 0, 0, 1);
self.layer.transform = CATransform3DConcat(CATransform3DIdentity, newRotateTransform);
_lastAppliedRotateTransform = newRotateTransform;
CGFloat direction = -MGLRadiansFromDegrees(self.mapView.direction);
// Return early if the map view has the same rotation as the already-applied transform.
if (direction == _lastDirection) return;
_lastDirection = direction;
// We keep track of each rotation transform that we apply. Each iteration,
// we can account for it so that we don't get cumulative rotation every time we move.
// We also avoid clobbering any existing transform passed in by the client or this SDK.
CATransform3D undoOfLastRotationTransform = CATransform3DInvert(_lastAppliedRotationTransform);
CATransform3D newRotationTransform = CATransform3DMakeRotation(direction, 0, 0, 1);
CATransform3D effectiveTransform = CATransform3DConcat(undoOfLastRotationTransform, newRotationTransform);
self.layer.transform = CATransform3DConcat(self.layer.transform, effectiveTransform);
_lastAppliedRotationTransform = newRotationTransform;
}
#pragma mark - Draggable

View File

@@ -1065,7 +1065,7 @@ MGL_EXPORT IB_DESIGNABLE
*/
- (CLLocationDistance)metersPerPointAtLatitude:(CLLocationDegrees)latitude;
- (CLLocationDistance)metersPerPixelAtLatitude:(CLLocationDegrees)latitude __attribute__((deprecated("Use -metersPerPointAtLatitude:.")));
- (CLLocationDistance)metersPerPixelAtLatitude:(CLLocationDegrees)latitude __attribute__((unavailable("Use -metersPerPointAtLatitude:.")));
#pragma mark Annotating the Map

View File

@@ -49,7 +49,7 @@
#import "NSBundle+MGLAdditions.h"
#import "NSDate+MGLAdditions.h"
#import "NSException+MGLAdditions.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import "NSProcessInfo+MGLAdditions.h"
#import "NSString+MGLAdditions.h"
#import "NSURL+MGLAdditions.h"
@@ -4280,6 +4280,15 @@ public:
moveOnscreen = [self isBringingAnnotationOnscreenSupportedForAnnotation:annotation animated:animateSelection];
}
// If we have an invalid positioning rect, we need to provide a suitable default.
// This (currently) happens if you select an annotation that has NOT yet been
// added. See https://github.com/mapbox/mapbox-gl-native/issues/11476
if (CGRectIsNull(calloutPositioningRect)) {
CLLocationCoordinate2D origin = annotation.coordinate;
CGPoint originPoint = [self convertCoordinate:origin toPointToView:self];
calloutPositioningRect = { .origin = originPoint, .size = CGSizeZero };
}
CGRect expandedPositioningRect = UIEdgeInsetsInsetRect(calloutPositioningRect, MGLMapViewOffscreenAnnotationPadding);
// Used for callout positioning, and moving offscreen annotations onscreen.
@@ -4432,7 +4441,11 @@ public:
{
MGLAnnotationTag annotationTag = [self annotationTagForAnnotation:annotation];
CGRect positioningRect = [self positioningRectForCalloutForAnnotationWithTag:annotationTag];
if (CGRectIsNull(positioningRect)) {
return positioningRect;
}
// For annotations which `coordinate` falls offscreen it will use the current tap point as anchor instead.
if ( ! CGRectIntersectsRect(positioningRect, self.bounds) && annotation != self.userLocation)
{
@@ -4452,15 +4465,15 @@ public:
id <MGLAnnotation> annotation = [self annotationWithTag:annotationTag];
if ( ! annotation)
{
return CGRectZero;
return CGRectNull;
}
if ([annotation isKindOfClass:[MGLMultiPoint class]]) {
CLLocationCoordinate2D origin = annotation.coordinate;
CGPoint originPoint = [self convertCoordinate:origin toPointToView:self];
return CGRectMake(originPoint.x, originPoint.y, MGLAnnotationImagePaddingForHitTest, MGLAnnotationImagePaddingForHitTest);
}
UIImage *image = [self imageOfAnnotationWithTag:annotationTag].image;
if ( ! image)
{
@@ -4547,6 +4560,8 @@ public:
return;
}
__weak __typeof__(self) weakSelf = self;
// The user location callout view initially points to the user location
// annotation’s implicit (visual) frame, which is offset from the
// annotation’s explicit frame. Now the callout view needs to rendezvous
@@ -4560,10 +4575,16 @@ public:
UIViewAnimationOptionBeginFromCurrentState)
animations:^
{
__typeof__(self) strongSelf = weakSelf;
if ( ! strongSelf)
{
return;
}
calloutView.frame = CGRectOffset(calloutView.frame,
_initialImplicitCalloutViewOffset.x,
_initialImplicitCalloutViewOffset.y);
_initialImplicitCalloutViewOffset = CGPointZero;
strongSelf->_initialImplicitCalloutViewOffset.x,
strongSelf->_initialImplicitCalloutViewOffset.y);
strongSelf->_initialImplicitCalloutViewOffset = CGPointZero;
}
completion:NULL];
}
@@ -5694,10 +5715,12 @@ public:
if (annotationView.layer.animationKeys.count > 0) {
continue;
}
// Move the annotation view far out of view to the left
CGRect adjustedFrame = annotationView.frame;
adjustedFrame.origin.x = -CGRectGetWidth(self.frame) * 10.0;
annotationView.frame = adjustedFrame;
CGPoint adjustedCenter = annotationView.center;
adjustedCenter.x = -CGRectGetWidth(self.frame) * 10.0;
annotationView.center = adjustedCenter;
[self enqueueAnnotationViewForAnnotationContext:annotationContext];
}
}
@@ -5733,6 +5756,8 @@ public:
rect = annotationView.frame;
}
NSAssert(!CGRectIsNull(rect), @"Positioning rect should not be CGRectNull by this point");
CGPoint point = CGPointMake(CGRectGetMidX(rect), CGRectGetMinY(rect));
if ( ! CGPointEqualToPoint(calloutView.center, point)) {

View File

@@ -66,3 +66,4 @@ FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[];
#import "MGLAttributionInfo.h"
#import "MGLMapSnapshotter.h"
#import "NSExpression+MGLAdditions.h"
#import "NSPredicate+MGLAdditions.h"

View File

@@ -66,7 +66,7 @@
return [UIColor colorWithRed:[components[0].constantValue doubleValue] / 255.0
green:[components[1].constantValue doubleValue] / 255.0
blue:[components[2].constantValue doubleValue] / 255.0
alpha:components.count == 3 ? [components[3].constantValue doubleValue] : 1.0];
alpha:components.count == 3 ? 1.0 : [components[3].constantValue doubleValue]];
}
@end

View File

@@ -3,6 +3,13 @@
static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer";
@interface MGLMapView (Tests)
@property (nonatomic) MGLCameraChangeReason cameraChangeReasonBitmask;
@end
@interface MGLCustomAnnotationView : MGLAnnotationView
@end
@@ -58,6 +65,7 @@ static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReu
@property (nonatomic) MGLMapView *mapView;
@property (nonatomic, weak) MGLAnnotationView *annotationView;
@property (nonatomic) NSInteger annotationSelectedCount;
@property (nonatomic) void (^prepareAnnotationView)(MGLAnnotationView*);
@end
@implementation MGLAnnotationViewTests
@@ -152,6 +160,83 @@ static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReu
XCTAssertEqual(selectionCount, self.annotationSelectedCount, @"-mapView:didSelectAnnotation: should be called for each selection");
}
- (void)testSelectingOnscreenAnnotationThatHasNotBeenAdded {
// See https://github.com/mapbox/mapbox-gl-native/issues/11476
// This bug occurs under the following conditions:
//
// - There are content insets (e.g. navigation bar) for the compare against
// CGRectZero (now CGRectNull)
// - annotationView.enabled == NO - Currently this can happen if you use
// `-initWithFrame:` rather than one of the provided initializers
//
self.prepareAnnotationView = ^(MGLAnnotationView *view) {
view.enabled = NO;
};
self.mapView.contentInset = UIEdgeInsetsMake(10.0, 10.0, 10.0, 10.0);
MGLCameraChangeReason reasonBefore = self.mapView.cameraChangeReasonBitmask;
XCTAssert(reasonBefore == MGLCameraChangeReasonNone, @"Camera should not have moved at start of test");
// Create annotation
MGLPointFeature *point = [[MGLPointFeature alloc] init];
point.title = NSStringFromSelector(_cmd);
point.coordinate = CLLocationCoordinate2DMake(0.0, 0.0);
MGLCoordinateBounds coordinateBounds = [self.mapView convertRect:self.mapView.bounds toCoordinateBoundsFromView:self.mapView];
XCTAssert(MGLCoordinateInCoordinateBounds(point.coordinate, coordinateBounds), @"The test point should be within the visible map view");
// Select on screen annotation (DO NOT ADD FIRST).
[self.mapView selectAnnotation:point animated:YES];
// Expect - the camera NOT to move.
MGLCameraChangeReason reasonAfter = self.mapView.cameraChangeReasonBitmask;
XCTAssert(reasonAfter == MGLCameraChangeReasonNone, @"Camera should not have moved");
}
- (void)checkDefaultPropertiesForAnnotationView:(MGLAnnotationView*)view {
XCTAssertNil(view.annotation);
XCTAssertNil(view.reuseIdentifier);
XCTAssertEqual(view.centerOffset.dx, 0.0);
XCTAssertEqual(view.centerOffset.dy, 0.0);
XCTAssertFalse(view.scalesWithViewingDistance);
XCTAssertFalse(view.rotatesToMatchCamera);
XCTAssertFalse(view.isSelected);
XCTAssert(view.isEnabled);
XCTAssertFalse(view.isDraggable);
XCTAssertEqual(view.dragState, MGLAnnotationViewDragStateNone);
}
- (void)testAnnotationViewInitWithFrame {
CGRect frame = CGRectMake(10.0, 10.0, 100.0, 100.0);
MGLAnnotationView *view = [[MGLAnnotationView alloc] initWithFrame:frame];
[self checkDefaultPropertiesForAnnotationView:view];
}
- (void)testAnnotationViewInitWithReuseIdentifier {
MGLAnnotationView *view = [[MGLAnnotationView alloc] initWithReuseIdentifier:nil];
[self checkDefaultPropertiesForAnnotationView:view];
}
- (void)testSelectingADisabledAnnotationView {
self.prepareAnnotationView = ^(MGLAnnotationView *view) {
view.enabled = NO;
};
// Create annotation
MGLPointFeature *point = [[MGLPointFeature alloc] init];
point.title = NSStringFromSelector(_cmd);
point.coordinate = CLLocationCoordinate2DMake(0.0, 0.0);
XCTAssert(self.mapView.selectedAnnotations.count == 0, @"There should be 0 selected annotations");
[self.mapView selectAnnotation:point animated:NO];
XCTAssert(self.mapView.selectedAnnotations.count == 0, @"There should be 0 selected annotations");
}
#pragma mark - MGLMapViewDelegate -
- (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id<MGLAnnotation>)annotation
@@ -163,6 +248,10 @@ static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReu
annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifer];
}
if (self.prepareAnnotationView) {
self.prepareAnnotationView(annotationView);
}
_annotationView = annotationView;
return annotationView;

View File

@@ -47,6 +47,8 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
3EAB52CE206ACE7E008BFE2D /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-loop-darwin.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3EAB52CF206ACE7E008BFE2D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
96567A221B0E84CD00D78776 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = SOURCE_ROOT; };
96567A301B0E8BB900D78776 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = SOURCE_ROOT; };
DA180EF11DD1A4DF000A211D /* OHHTTPStubs.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OHHTTPStubs.framework; path = "OHHTTPStubs/OHHTTPStubs/build/Debug-iphoneos/OHHTTPStubs.framework"; sourceTree = "<group>"; };
@@ -122,6 +124,8 @@
DD043325196DB9BC00E6F39D /* Frameworks */ = {
isa = PBXGroup;
children = (
3EAB52CF206ACE7E008BFE2D /* OpenGLES.framework */,
3EAB52CE206ACE7E008BFE2D /* libmbgl-loop-darwin.a */,
DA180EF11DD1A4DF000A211D /* OHHTTPStubs.framework */,
DA9C551B1CD9DFA7000A15C6 /* libKIF.a */,
DA482C7F1C12582600772FE3 /* Mapbox.framework */,

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "0930"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -91,7 +90,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -10,7 +10,22 @@
### Style layers
* Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748))
* Deprecated `+[NSExpression featurePropertiesVariableExpression]`; use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748))
* Added an `-[NSPredicate(MGLAdditions) predicateWithMGLJSONObject:]` method and `NSPredicate.mgl_jsonExpressionObject` property. ([#11810](https://github.com/mapbox/mapbox-gl-native/pull/11810))
* Added `FIRST`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770))
* Inside an expression, casting `nil` to a string turns it into the empty string instead of the string `"null"`. ([#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904))
* Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MGLStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725))
### Annotations
* Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731))
* Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783))
### Other changes
* Reduced per-frame render CPU time. ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811))
* Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092))
* If English is the first language listed in the user’s Preferred Languages setting, `-[MGLStyle localizeLabelsIntoLocale:]` no longer prioritizes other languages over English. ([#11907](https://github.com/mapbox/mapbox-gl-native/pull/11907))
## 0.7.0 - April 19, 2018

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
version = '0.7.0'
version = '0.7.1'
m.name = 'Mapbox-macOS-SDK-symbols'
m.version = "#{version}-symbols"

View File

@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
version = '0.7.0'
version = '0.7.1'
m.name = 'Mapbox-macOS-SDK'
m.version = version

View File

@@ -93,9 +93,8 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
BOOL _isTouringWorld;
BOOL _isShowingPolygonAndPolylineAnnotations;
BOOL _isShowingAnimatedAnnotation;
// Snapshotter
MGLMapSnapshotter* snapshotter;
MGLMapSnapshotter *_snapshotter;
}
#pragma mark Lifecycle
@@ -185,17 +184,23 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
options.zoomLevel = self.mapView.zoomLevel;
// Create and start the snapshotter
snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options];
[snapshotter startWithCompletionHandler:^(MGLMapSnapshot *snapshot, NSError *error) {
__weak __typeof__(self) weakSelf = self;
_snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options];
[_snapshotter startWithCompletionHandler:^(MGLMapSnapshot *snapshot, NSError *error) {
__typeof__(self) strongSelf = weakSelf;
if (!strongSelf) {
return;
}
if (error) {
NSLog(@"Could not load snapshot: %@", error.localizedDescription);
} else {
// Set the default name for the file and show the panel.
NSSavePanel *panel = [NSSavePanel savePanel];
panel.nameFieldStringValue = [self.mapView.styleURL.lastPathComponent.stringByDeletingPathExtension stringByAppendingPathExtension:@"png"];
panel.nameFieldStringValue = [strongSelf.mapView.styleURL.lastPathComponent.stringByDeletingPathExtension stringByAppendingPathExtension:@"png"];
panel.allowedFileTypes = [@[(NSString *)kUTTypePNG] arrayByAddingObjectsFromArray:[NSBitmapImageRep imageUnfilteredTypes]];
[panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
[panel beginSheetModalForWindow:strongSelf.window completionHandler:^(NSInteger result) {
if (result == NSFileHandlingPanelOKButton) {
// Write the contents in the new format.
NSURL *fileURL = panel.URL;
@@ -232,7 +237,8 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
}];
}
snapshotter = nil;
strongSelf->_snapshotter = nil;
}];
}
@@ -1179,7 +1185,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
return YES;
}
if (menuItem.action == @selector(takeSnapshot:)) {
return !(snapshotter && [snapshotter isLoading]);
return !(_snapshotter && [_snapshotter isLoading]);
}
return NO;
}

View File

@@ -267,7 +267,7 @@ Each property representing a layout or paint attribute is set to an
but you create the former using a very different syntax. `NSExpression`’s format
string syntax is reminiscent of a spreadsheet formula or an expression in a
database query. See the
“[Predicates and Expressions](Predicates and Expressions.md)” guide for an
“[Predicates and Expressions](predicates-and-expressions.html)” guide for an
overview of the expression support in this SDK. This SDK no longer supports
style functions; use expressions instead.
@@ -318,7 +318,7 @@ In style specification | Method, function, or predicate type | Format string syn
`number` | |
`string` | |
`to-boolean` | `boolValue` |
`to-color` | |
`to-color` | | `CAST(var, 'NSColor')`
`to-number` | `mgl_numberWithFallbackValues:` | `CAST(zipCode, 'NSNumber')`
`to-string` | `stringValue` | `CAST(ele, 'NSString')`
`typeof` | |
@@ -350,7 +350,7 @@ In style specification | Method, function, or predicate type | Format string syn
`upcase` | `uppercase:` | `uppercase('Elysian Fields')`
`rgb` | `+[NSColor colorWithCalibratedRed:green:blue:alpha:]` |
`rgba` | `+[NSColor colorWithCalibratedRed:green:blue:alpha:]` |
`to-rgba` | |
`to-rgba` | | `CAST(noindex(var), 'NSArray')`
`-` | `from:subtract:` | `2 - 1`
`*` | `multiply:by:` | `1 * 2`
`/` | `divide:by:` | `1 / 2`
@@ -405,5 +405,5 @@ In style JSON | In the format string
`["any", f0, …, fn]` | `p0 OR … OR pn`
`["none", f0, …, fn]` | `NOT (p0 OR … OR pn)`
See the “[Predicates and Expressions](Predicates and Expressions.md)” guide for
See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for
a full description of the supported operators and operand types.

View File

@@ -20,7 +20,7 @@ custom_categories:
- Working with GeoJSON Data
- Predicates and Expressions
- For Style Authors
- Style Layers Using Expressions
- Migrating to Expressions
- Tile URL Templates
- Info.plist Keys
- name: Maps

View File

@@ -23,6 +23,7 @@
1F7454AB1ED1DDBD00021D39 /* MGLLightTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F7454AA1ED1DDBD00021D39 /* MGLLightTest.mm */; };
1F95931B1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */; };
1F9EF4061FBA1B0E0063FBB0 /* mapbox_helmet.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 1F9EF4051FBA1B0D0063FBB0 /* mapbox_helmet.pdf */; };
1FC481852098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */; };
30E5781B1DAA857E0050F07E /* NSImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */; };
3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
3508EC651D749D39009B0EE4 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */; };
@@ -37,7 +38,7 @@
3527428D1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527428B1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
3527428E1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3527428C1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.mm */; };
352742A11D4C25BD00A1ECE6 /* MGLStyleValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3527429E1D4C25BD00A1ECE6 /* MGLStyleValue.mm */; };
3529039B1D6C63B80002C7DF /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 352903991D6C63B80002C7DF /* NSPredicate+MGLAdditions.h */; };
3529039B1D6C63B80002C7DF /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 352903991D6C63B80002C7DF /* NSPredicate+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
3529039C1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3529039A1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm */; };
3537CA741D3F93A600380318 /* MGLStyle_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3537CA731D3F93A600380318 /* MGLStyle_Private.h */; };
3538AA231D542685008EC33D /* MGLStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3538AA211D542685008EC33D /* MGLStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -62,6 +63,7 @@
35C6DF871E214C1800ACA483 /* MGLDistanceFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6DF861E214C1800ACA483 /* MGLDistanceFormatterTests.m */; };
35D65C5A1D65AD5500722C23 /* NSDate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */; };
35D65C5B1D65AD5500722C23 /* NSDate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */; };
3E6465D9206576A900685536 /* LimeGreenStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E6465D7206576A800685536 /* LimeGreenStyleLayer.m */; };
3EA9317388DC9A0BF46B7674 /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9369A4C46957566058822 /* MGLRendererConfiguration.h */; };
3EA93BA38DBB4B814B6C1FCC /* MGLRendererConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3EA93B1B0864609938506E12 /* MGLRendererConfiguration.mm */; };
4031ACFC1E9EB3C100A3EA26 /* MGLMapViewDelegateIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4031ACFB1E9EB3C100A3EA26 /* MGLMapViewDelegateIntegrationTests.swift */; };
@@ -95,6 +97,7 @@
9654C12B1FFC38E000DB6A19 /* MGLPolyline_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C12A1FFC38E000DB6A19 /* MGLPolyline_Private.h */; };
9654C12D1FFC394700DB6A19 /* MGLPolygon_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C12C1FFC394700DB6A19 /* MGLPolygon_Private.h */; };
96E027311E57C9A7004B8E66 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 96E027331E57C9A7004B8E66 /* Localizable.strings */; };
CA9461A620884CCB0015EB12 /* MGLAnnotationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA9461A520884CCB0015EB12 /* MGLAnnotationTests.m */; };
DA00FC8A1D5EEAC3009AABC8 /* MGLAttributionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA00FC881D5EEAC3009AABC8 /* MGLAttributionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
DA00FC8B1D5EEAC3009AABC8 /* MGLAttributionInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA00FC891D5EEAC3009AABC8 /* MGLAttributionInfo.mm */; };
DA0CD58E1CF56F5800A5F5A5 /* MGLFeatureTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA0CD58D1CF56F5800A5F5A5 /* MGLFeatureTests.mm */; };
@@ -162,7 +165,6 @@
DAA998FB1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DAA998F91E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
DAA998FC1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAA998FA1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.mm */; };
DAA999011E9F5EC5002E6EA6 /* MGLFillExtrusionStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DAA999001E9F5EC5002E6EA6 /* MGLFillExtrusionStyleLayerTests.mm */; };
DAB2CCE51DF632ED001B2FE1 /* LimeGreenStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = DAB2CCE41DF632ED001B2FE1 /* LimeGreenStyleLayer.m */; };
DAC25FCA200FD5E2009BE98E /* NSExpression+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC25FC9200FD5E2009BE98E /* NSExpression+MGLPrivateAdditions.h */; };
DAC2ABC51CC6D343006D18C4 /* MGLAnnotationImage_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */; };
DACA8622201920BE00E9693A /* MGLRasterDEMSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DACA8620201920BE00E9693A /* MGLRasterDEMSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -308,6 +310,7 @@
1F7454AA1ED1DDBD00021D39 /* MGLLightTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLightTest.mm; sourceTree = "<group>"; };
1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLNSDateAdditionsTests.mm; path = ../../darwin/test/MGLNSDateAdditionsTests.mm; sourceTree = "<group>"; };
1F9EF4051FBA1B0D0063FBB0 /* mapbox_helmet.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = mapbox_helmet.pdf; sourceTree = "<group>"; };
1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MGLPrivateAdditions.h"; sourceTree = "<group>"; };
30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSImage+MGLAdditions.h"; path = "src/NSImage+MGLAdditions.h"; sourceTree = SOURCE_ROOT; };
3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLAdditions.h"; sourceTree = "<group>"; };
3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSExpression+MGLAdditions.mm"; sourceTree = "<group>"; };
@@ -347,6 +350,8 @@
35C6DF861E214C1800ACA483 /* MGLDistanceFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLDistanceFormatterTests.m; path = ../../darwin/test/MGLDistanceFormatterTests.m; sourceTree = "<group>"; };
35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+MGLAdditions.h"; sourceTree = "<group>"; };
35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSDate+MGLAdditions.mm"; sourceTree = "<group>"; };
3E6465D7206576A800685536 /* LimeGreenStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LimeGreenStyleLayer.m; path = ../../darwin/app/LimeGreenStyleLayer.m; sourceTree = "<group>"; };
3E6465D8206576A900685536 /* LimeGreenStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LimeGreenStyleLayer.h; path = ../../darwin/app/LimeGreenStyleLayer.h; sourceTree = "<group>"; };
3EA9369A4C46957566058822 /* MGLRendererConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRendererConfiguration.h; sourceTree = "<group>"; };
3EA93B1B0864609938506E12 /* MGLRendererConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRendererConfiguration.mm; sourceTree = "<group>"; };
4031ACFB1E9EB3C100A3EA26 /* MGLMapViewDelegateIntegrationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MGLMapViewDelegateIntegrationTests.swift; sourceTree = "<group>"; };
@@ -394,6 +399,7 @@
96E027391E57C9B9004B8E66 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = "<group>"; };
96E0273A1E57C9BB004B8E66 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = "<group>"; };
96E0273B1E57C9BC004B8E66 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = "<group>"; };
CA9461A520884CCB0015EB12 /* MGLAnnotationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLAnnotationTests.m; path = test/MGLAnnotationTests.m; sourceTree = SOURCE_ROOT; };
DA00FC881D5EEAC3009AABC8 /* MGLAttributionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributionInfo.h; sourceTree = "<group>"; };
DA00FC891D5EEAC3009AABC8 /* MGLAttributionInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLAttributionInfo.mm; sourceTree = "<group>"; };
DA0CD58D1CF56F5800A5F5A5 /* MGLFeatureTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLFeatureTests.mm; path = ../../darwin/test/MGLFeatureTests.mm; sourceTree = "<group>"; };
@@ -518,8 +524,6 @@
DAA998F91E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFillExtrusionStyleLayer.h; sourceTree = "<group>"; };
DAA998FA1E9F545C002E6EA6 /* MGLFillExtrusionStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFillExtrusionStyleLayer.mm; sourceTree = "<group>"; };
DAA999001E9F5EC5002E6EA6 /* MGLFillExtrusionStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFillExtrusionStyleLayerTests.mm; sourceTree = "<group>"; };
DAB2CCE31DF632ED001B2FE1 /* LimeGreenStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LimeGreenStyleLayer.h; sourceTree = "<group>"; };
DAB2CCE41DF632ED001B2FE1 /* LimeGreenStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LimeGreenStyleLayer.m; sourceTree = "<group>"; };
DAC25FC9200FD5E2009BE98E /* NSExpression+MGLPrivateAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLPrivateAdditions.h"; sourceTree = "<group>"; };
DAC2ABC41CC6D343006D18C4 /* MGLAnnotationImage_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAnnotationImage_Private.h; sourceTree = "<group>"; };
DACA8620201920BE00E9693A /* MGLRasterDEMSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLRasterDEMSource.h; sourceTree = "<group>"; };
@@ -635,6 +639,9 @@
DAF2571D201902A500367EF5 /* MGLHillshadeStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLHillshadeStyleLayerTests.mm; sourceTree = "<group>"; };
DAFBD0D51E3FA969000CD6BF /* zh-Hant */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
DAFBD0D61E3FA983000CD6BF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Foundation.strings"; sourceTree = "<group>"; };
DAFEB3702093ACBF00A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
DAFEB3722093ACDA00A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Foundation.strings; sourceTree = "<group>"; };
DAFEB3732093ACE400A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ko; path = ko.lproj/Foundation.stringsdict; sourceTree = "<group>"; };
DD0902AF1DB1AC6400C5BDCE /* MGLNetworkConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLNetworkConfiguration.m; sourceTree = "<group>"; };
DD0902B01DB1AC6400C5BDCE /* MGLNetworkConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLNetworkConfiguration.h; sourceTree = "<group>"; };
DD58A4C71D822C6200E1F038 /* MGLExpressionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLExpressionTests.mm; path = ../../darwin/test/MGLExpressionTests.mm; sourceTree = "<group>"; };
@@ -816,8 +823,8 @@
DA839E961CC2E3400062CAFB /* AppDelegate.m */,
DAE6C2E31CC3050F00DB3429 /* DroppedPinAnnotation.h */,
DAE6C2E41CC3050F00DB3429 /* DroppedPinAnnotation.m */,
DAB2CCE31DF632ED001B2FE1 /* LimeGreenStyleLayer.h */,
DAB2CCE41DF632ED001B2FE1 /* LimeGreenStyleLayer.m */,
3E6465D8206576A900685536 /* LimeGreenStyleLayer.h */,
3E6465D7206576A800685536 /* LimeGreenStyleLayer.m */,
DAE6C2E51CC3050F00DB3429 /* LocationCoordinate2DTransformer.h */,
DAE6C2E61CC3050F00DB3429 /* LocationCoordinate2DTransformer.m */,
DA839E9B1CC2E3400062CAFB /* MapDocument.h */,
@@ -1029,6 +1036,7 @@
3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */,
352903991D6C63B80002C7DF /* NSPredicate+MGLAdditions.h */,
3529039A1D6C63B80002C7DF /* NSPredicate+MGLAdditions.mm */,
1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */,
DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h */,
DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.m */,
DAE6C3821CC31E2A00DB3429 /* NSString+MGLAdditions.h */,
@@ -1076,6 +1084,7 @@
4031AD001E9FD61000A3EA26 /* Test Helpers */,
4031ACFA1E9EB39A00A3EA26 /* Swift Integration */,
DA8F257D1D51C5F40010E6B5 /* Styling */,
CA9461A520884CCB0015EB12 /* MGLAnnotationTests.m */,
DAEDC4311D6033F1000224FF /* MGLAttributionInfoTests.m */,
DAEDC4361D606291000224FF /* MGLAttributionButtonTests.m */,
DA35A2C11CCA9F4A00E826B2 /* MGLClockDirectionFormatterTests.m */,
@@ -1212,6 +1221,7 @@
DAE6C3631CC31E0400DB3429 /* MGLPointAnnotation.h in Headers */,
DAC2ABC51CC6D343006D18C4 /* MGLAnnotationImage_Private.h in Headers */,
DAE6C35F1CC31E0400DB3429 /* MGLOfflinePack.h in Headers */,
1FC481852098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */,
DAE6C39C1CC31E2A00DB3429 /* NSString+MGLAdditions.h in Headers */,
3529039B1D6C63B80002C7DF /* NSPredicate+MGLAdditions.h in Headers */,
DA8F25971D51CAC70010E6B5 /* MGLVectorTileSource.h in Headers */,
@@ -1370,7 +1380,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = MBX;
LastUpgradeCheck = 0920;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = Mapbox;
TargetAttributes = {
DA839E911CC2E3400062CAFB = {
@@ -1418,6 +1428,7 @@
he,
da,
"pt-PT",
ko,
);
mainGroup = DA839E891CC2E3400062CAFB;
productRefGroup = DA839E931CC2E3400062CAFB /* Products */;
@@ -1483,11 +1494,11 @@
DA839E9D1CC2E3400062CAFB /* MapDocument.m in Sources */,
DAE6C2ED1CC3050F00DB3429 /* DroppedPinAnnotation.m in Sources */,
DAE6C2EE1CC3050F00DB3429 /* LocationCoordinate2DTransformer.m in Sources */,
DAB2CCE51DF632ED001B2FE1 /* LimeGreenStyleLayer.m in Sources */,
DAE6C2F11CC3050F00DB3429 /* TimeIntervalTransformer.m in Sources */,
DACB0C391E18DFFD005DDBEA /* MGLStyle+MBXAdditions.m in Sources */,
DA839E9A1CC2E3400062CAFB /* main.m in Sources */,
DA839E971CC2E3400062CAFB /* AppDelegate.m in Sources */,
3E6465D9206576A900685536 /* LimeGreenStyleLayer.m in Sources */,
DAE6C2F01CC3050F00DB3429 /* OfflinePackNameValueTransformer.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1601,6 +1612,7 @@
DAE6C3D31CC34C9900DB3429 /* MGLOfflinePackTests.m in Sources */,
DA87A9A51DCACC5000810D09 /* MGLLineStyleLayerTests.mm in Sources */,
DA87A9A31DCACC5000810D09 /* MGLRasterStyleLayerTests.mm in Sources */,
CA9461A620884CCB0015EB12 /* MGLAnnotationTests.m in Sources */,
DA87A9991DC9D88400810D09 /* MGLTileSetTests.mm in Sources */,
DA35A2A81CC9F41600E826B2 /* MGLCoordinateFormatterTests.m in Sources */,
DAE7DEC41E24549F007505A6 /* MGLNSStringAdditionsTests.m in Sources */,
@@ -1657,6 +1669,7 @@
DACBC6082011885800C4D7E2 /* he */,
DAD88E03202ACF5900AAA536 /* da */,
DA934097208562590059919A /* pt-PT */,
DAFEB3702093ACBF00A86A83 /* ko */,
);
name = Localizable.strings;
sourceTree = "<group>";
@@ -1735,6 +1748,7 @@
DA3389621FA3EDEF001EA329 /* bg */,
DACBC6092011888C00C4D7E2 /* he */,
DAD88E04202ACF7C00AAA536 /* da */,
DAFEB3722093ACDA00A86A83 /* ko */,
);
name = Foundation.strings;
sourceTree = "<group>";
@@ -1759,6 +1773,7 @@
DA80E95F1FE84A540065FC9B /* ar */,
DAD88E05202ACF8200AAA536 /* da */,
DA934098208562870059919A /* pt-PT */,
DAFEB3732093ACE400A86A83 /* ko */,
);
name = Foundation.stringsdict;
sourceTree = "<group>";
@@ -1780,6 +1795,7 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
@@ -1787,6 +1803,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -1837,6 +1854,7 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
@@ -1844,6 +1862,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -56,7 +56,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E933DEF922EF4BC1AD735333"
BlueprintIdentifier = "9EEBD19ABEE247CF8D3CF4C5"
BuildableName = "mbgl-test"
BlueprintName = "mbgl-test"
ReferencedContainer = "container:../../build/macos/mbgl.xcodeproj">
@@ -70,7 +70,7 @@
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D3EE78DAFFA4A42AFD7160D"
BlueprintIdentifier = "B328AB16ECE141AAAE2A72C8"
BuildableName = "mbgl-benchmark"
BlueprintName = "mbgl-benchmark"
ReferencedContainer = "container:../../build/macos/mbgl.xcodeproj">
@@ -82,7 +82,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -112,7 +111,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -70,7 +69,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@@ -58,7 +58,7 @@
#import "NSURL+MGLAdditions.h"
#import "NSColor+MGLAdditions.h"
#import "NSImage+MGLAdditions.h"
#import "NSPredicate+MGLAdditions.h"
#import "NSPredicate+MGLPrivateAdditions.h"
#import <QuartzCore/QuartzCore.h>
#import <OpenGL/gl.h>
@@ -2249,8 +2249,16 @@ public:
// The annotation's anchor will bounce to the current click.
NSRect positioningRect = [self positioningRectForCalloutForAnnotationWithTag:annotationTag];
// Check for invalid (zero) positioning rect
if (NSEqualRects(positioningRect, NSZeroRect)) {
CLLocationCoordinate2D origin = annotation.coordinate;
positioningRect.origin = [self convertCoordinate:origin toPointToView:self];
}
if (!moveOnscreen && NSIsEmptyRect(NSIntersectionRect(positioningRect, self.bounds))) {
positioningRect = CGRectMake(gesturePoint.x, gesturePoint.y, positioningRect.size.width, positioningRect.size.height);
if (!NSEqualPoints(gesturePoint, NSZeroPoint)) {
positioningRect = CGRectMake(gesturePoint.x, gesturePoint.y, positioningRect.size.width, positioningRect.size.height);
}
}
self.selectedAnnotation = annotation;
@@ -2464,6 +2472,8 @@ public:
if (callout) {
NSRect rect = [self positioningRectForCalloutForAnnotationWithTag:_selectedAnnotationTag];
NSAssert(!NSEqualRects(rect, NSZeroRect), @"Positioning rect should be non-zero");
if (!NSIsEmptyRect(NSIntersectionRect(rect, self.bounds))) {
// It's possible that the current callout hasn't been presented (since the original

Some files were not shown because too many files have changed in this diff Show More