summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLSymbolStyleLayerTests.mm
Commit message (Collapse)AuthorAgeFilesLines
* [ios, macos] NSPredicate expression filters. (#11587)Fabian Guerra Soto2018-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Add NSAndPredicateType predicate expression filter. * [ios, macos] Add type to NSPredicate expressions. * [ios, macos] Add Expression filter support. * [ios, macos] Update NSPredicate expression based tests. * [ios, macos] Refactor ExpressionFilters. * [ios, macos] Add symmetric test to ExpressionFilters. * [ios, macos] Update NSPredicate test to ExpressionFilters. * [ios, macos] Re-introduce Filter tests. * [ios, macos] Remove typed NSComparisonPredicate's comparable values. * [ios, macos] Update style layers predicate tests. * [ios, macos] Remove unused predicate conversion code. * [ios, macos] Update documentation exaple's test. * [ios, macos] Update Predicate and Expressions guide.. * [ios, macos] Remove mgl_ prefix from variable expressions. * [ios, macos] Update predicates and expressions documentation. * [ios, macos] Update changelogs.
* Eviscerate mbgl expression to Foundation JSON object conversion (#11389)Minh Nguyễn2018-03-301-36/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Eviscerate mbgl expression to Foundation JSON object conversion * [ios, macos] Remove literal special case MGLJSONObjectFromMBGLValue() is just a literal translation from C++ types to Foundation types; no need for expression-specific literal wrapping. * [ios, macos] Implemented RGB(A) operators * [ios, macos] More robust color conversion * [macos] Create calibrated RGB from expression on Sierra * [macos] Calibrate colors in expressions at runtime * [ios, macos] Special-case number conversion without fallbacks * [ios, macos] Test mgl_number expressions * [ios, macos] Updated tests for aftermarket expressions * [ios, macos] Relax roundtripping requirement for serialize() * [ios, macos] Fixed interpolation expression tests * [ios, macos] Removed dead code * [ios, macos] Fixed color conversion on Sierra
* Install aftermarket expression functions (#11472)Minh Nguyễn2018-03-291-136/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Introduced more ergonomic expression concatenation syntax * [ios, macos] Fixed mgl_join: * [ios, macos] Simplified expression document headings * [ios, macos] Documented mgl_join: * [ios, macos] Convert length operator to length: for strings Only works for literal strings. * [ios, macos] Implemented type conversion using CAST() * [ios, macos] Aftermarket let expressions * [ios, macos] Refactored aftermarket expression functions Refactored the installation of aftermarket expression functions to use macros. It is no longer necessary to handwrite the type encoding of a function. Also added aftermarket functions for interpolating and stepping. * [ios, macos] Updated documentation, tests, demo apps * [ios, macos] Added generic expression function * [ios, macos] Add MGL_MATCH function placeholder. * [ios, macos] Add MGL_SWITCH expression operator. * [ios, macos] Add mgl_coalesce: as expression function. * [ios, macos] Update style documentation. * [ios, macos] Add conventional custom function support. * [ios, macos] Updated example code * [ios, macos] Add mgl_coalesce conventional custom function support. * [ios, macos] Add aftermarket function to 'has' operator. * [ios, macos] Add documentation for lookup and feature operators. * [ios, macos] Documented simple lookup * [ios, macos] Renamed, reversed has expression Renamed mgl_hasProperty:properties: to mgl_does:have: for better readability and consistency with the conventional mgl_has: function. Documented both forms of mgl_has:. * [ios, macos] Restored OEM conditionals where available This is the preferred syntax for simple conditionals on iOS 9 and above, because you can inline the predicate instead of wrapping it in a constant value expression, which means you can write a conditional in a single format string. * [ios, macos] Update style docs. Co-authored-by: Fabian Guerra <fabian.guerra@mapbox.com>
* Reimplement style values atop NSExpression (#10726)Minh Nguyễn2018-01-241-1030/+1255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Import headers, not implementation files * [core] Added accessors for various expression parameters Added missing parameter accessors to various expression operator classes, as well as a method on InterpolatorBase and Step that enumerates the stops and their values. * [ios, macos] Silenced warning in test of error condition * [ios, macos] Made MGLSphericalPosition boxable * [ios, macos] Implemented array enumeration during conversion * [ios, macos] Temporarily ignore heatmap layer type * [ios, macos] Migrated MGLSymbolStyleLayer.text to NSExpression MGLSymbolStyleLayer.text is now of type NSExpression instead of MGLStyleValue, as a first step toward migrating the entire layer API from style values to expressions. Implemented conversions from NSExpression to JSON arrays and vice versa. The most common NSExpression functions are now converted into style expressions, but not all of the most common style expression operators are supported yet. * [ios, macos] Implemented string coercion * [ios, macos] Color literals * [ios, macos] Null constant expressions * [ios, macos] Convert dictionary literals * [ios, macos] Interpolation expressions * [ios, macos] to-boolean, to-number, get from object * [ios, macos] Variable expressions Implemented custom expression functions for assigning and referring to variables within the context of an expression. Variables are assigned via a “context dictionary” and applied to an subexpression that is given as another argument to the same expression. Also implemented built-in variable expressions for zoom level and heatmap density. * [ios, macos] Convert colors, offsets, padding in expressions to JSON objects * [ios, macos] Expression-based style property getters Implemented a conversion from mbgl::style::PropertyValues to Objective-C JSON objects, which are then converted to NSExpressions. * [ios, macos] Consolidated property value–expression conversion in MGLStyleValueTransformer * [ios, macos] Predicate and expression guide Extracted documentation about predicates from a documentation comment in MGLVectorStyleLayer.h to a new jazzy guide. Added details about NSExpression support as well. Began updating the “For Style Authors” guide to reflect the transition from style values to expressions. * [ios, macos] Updated style authoring guide Updated the Information for Style Authors guide to discuss expressions instead of style functions. Included a table mapping style specification expression operators to NSExpression syntaxes. * [ios, macos] Migrated codegen templates to expressions * [ios, macos] Applied expression changes via codegen Ran make darwin-style-code. * [macos] Migrated macosapp to expressions * [ios, macos] Updated style function guide This guide needs to be thoroughly rewritten, but for now the example code has been migrated to expressions. * [ios, macos] Eviscerated style function tests * [ios, macos] Updated changelogs * [ios] Migrated iosapp to expressions * [ios, macos] Exposed JSON conversion methods publicly * [ios, macos] Removed MGLStyleValue, MGLStyleFunction
* [core, ios, macos, android] Add data-driven-styling support for `text-font`John Firebaugh2018-01-101-6/+1
|
* [core][ios][macos][android]DDS-ify `text-letter-spacing` and `text-max-width`Asheem Mamoowala2017-08-301-12/+48
|
* Implement icon-anchor propertyLauren Budorick2017-08-281-3/+47
|
* [core][android][macos][ios] Implement property functions for line-join, ↵Lauren Budorick2017-07-261-12/+2
| | | | text-justify, text-anchor (#9583)
* [core] Update shaders.Chris Loer2017-07-121-0/+43
| | | | | Implements 'icon-pitch-alignment' (issue #9345) Fixes issue #9456 (map-aligned point label regression)
* [core] Add DDS support for {text,icon}-size (#8593)Anand Thakker2017-04-061-12/+48
| | | | | | | | | | | | | | | | | | | | | | | | * Update gl-js and generate style code * Factor out packUint8Pair() helper function * Draft implementation of DDS for {text,icon}-size Ports https://github.com/mapbox/mapbox-gl-js/pull/4455 * Fix text-size/composite-function-line-placement test * Refactor to PaintPropertyBinders-like strategy * Dedupe gl::Program construction * Use exponential function base for interpolation * Dedupe coveringZoomStops method * Fixup tests * Fix CI errors (hidden within #if block)
* [core] Add DDS support for icon-imageJohn Firebaugh2017-03-311-6/+1
|
* [core] Add DDS support for text-rotateJohn Firebaugh2017-03-311-6/+24
|
* [core] implement dds for text-offsetMolly Lloyd2017-03-281-6/+24
|
* Per-attribute transition properties on MGLStyleLayer (#8225)Fabian Guerra Soto2017-03-101-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] new struct MGLTransition * [ios] MGLTransition struct moved to MGLTypes.h * [ios] MGLTransition implemented for style layer properties * [ios, macos] added support for getting property transitions * [ios, macos] updated to MGLDurationFromTimeInterval and MGLTimeIntervalFromDuration * [ios, macos] added transition properties test * [ios, macos] modified key strings imp * [ios, macos] The impl for transition properties were changed to public methods * [ios, macos] Changelog update * [ios] Fixed layer space formatting * [core] The name space was fixed for getters that returned TransitionOptions * [ios, macos] Added rawLayer transition property tests * [ios] Added a factory method for MGLTransition and transition-related methods to NSValue(MGLAdditions) * [ios, macos] Copyedited changelog blurbs about transition properties
* [core] Implement data-driven styling for ↵Anand Thakker2017-02-281-60/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | {text,icon}-{color,opacity,halo-color,halo-blur,halo-width} (#7939) * Add symbol dds attributes and adapt style code generation * Update to mapbox-gl-js/master * Refactor SymbolFeature as a subclass of GeometryTileFeature Prepares for enabling DDS on symbol paint properties by allowing the SymbolFeatures, which we keep around after constructing SymbolLayout, to be used in evaluating data-driven paint properties later in the layout process. * Draft approach for splitting icon/text paint properties The `Program` types are set up to bind GL attributes to each of the data-driven paint properties specified in the `PaintProperties` type provided. Since `SymbolPaintProperties` specifies both `Text*` and `Icon*` properties, the symbolIcon, symbolIconSDF, and symbolGlyph programs each attempt to bind roughly double the number of attributes that they actually need. This change addresses this by: - Adding the more specific `IconPaintProperties` and `TextPaintProperties` types, which are subsets of the full `SymbolPaintProperties`. - The symbol layer continues to use its `SymbolPaintProperties paint` member to track layer property state, but it provides helpers that construct objects of each the specific `{Icon,Text}PaintProperties::Evaluated` type, for use by the painter. - The three symbol programs instantiate `Program<>` using the appropriate `{Icon,Text}PaintProperties` type. * check in generated style code * Populate paint buffers for symbol DDS properties * Address first round of review comments * Refactor VectorTile{Layer,Feature} to explicitly share data * Update submodule
* [core] Enable property functions for text-{field,transform} (#7944)Anand Thakker2017-02-171-54/+142
|
* [core, ios, macos] Refactor composite stop types and conversionsJohn Firebaugh2017-02-091-4/+4
|
* [ios, macos] Add support for data-driven property functionsJesse Bounds2017-02-021-675/+853
|
* [core] remove trailing whitespace, add trailing newlines, add space after //Konstantin Käfer2017-01-271-196/+196
|
* Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.7Minh Nguyễn2017-01-161-4/+4
|
* [ios, macos] Rewrote style layer testsMinh Nguyễn2017-01-131-0/+1797
Replaced the style layer integration tests with unit tests. Test conversion of style values to property values and vice versa, not just round-tripping. Test the initial state and null-resetting of each null-resettable property. Test NSValue additions for style attribute enumerations. Test properties common to all style layer classes. Test MGLStyle’s source and layer collections. Eviscerated implementations of unavailable style layer properties corresponding to style specification properties that were renamed. Implemented corresponding getters to prevent ivars from being autosynthesized for these unavailable properties. Added a missing bridging header to the iOS test project.