summaryrefslogtreecommitdiff
path: root/src/mbgl/style
Commit message (Collapse)AuthorAgeFilesLines
* [core] Fix crash due to mixing legacy filters and expressions (#12065)Anand Thakker2018-06-061-33/+51
| | | | | | | | | | | | | | | | | | | * Fix crash due to mixing legacy filters and expressions In some cases, (invalid) nested filters that used a mix of legacy filter syntax and expression syntax caused a crash due to a failure to propagate parsing errors from deeper within the filter expression. These errors went undetected in part because these conversion functions returned unique_ptr<Expression> values (or vectors thereof), using {nullptr} to represent a parsing error, but the core expression classes expect unique_ptr<Expression> that are never null. This changes over to using expression::ParseResult (aka optional<unique_ptr<Expression>>), to represent conversion failure the same way we do in the rest of the expression system. * Fix clang 3.8 / gcc 4.9 issue
* [core] fix bogus unused variable with GCC 7Konstantin Käfer2018-06-041-3/+3
|
* [core] don't use floating point versions of pow/logKonstantin Käfer2018-06-041-1/+1
| | | | | | GLIBC 2.27 added new versioned symbols of powf and logf, while the double versions of pow and log remained stable. Prefer the double version to avoid introducing a dependency on a newer version of GLIBC than strictly necessary. See https://lists.gnu.org/archive/html/info-gnu/2018-02/msg00000.html
* Clamp TileJSON.bounds latitudes to [-90, 90] (#11964)Asheem Mamoowala2018-05-211-8/+9
| | | Fixes #11963.
* [core] Align match behavior with case/==John Firebaugh2018-05-181-2/+16
| | | | Makes `["match", ["get", k], label, match, otherwise]` equivalent to `["case", ["==", ["get", k], label], match, otherwise]`. This changes the behavior of match expressions where the runtime type of the input does not match the type of the labels: previously such expressions produced a runtime type error and then fell back to the property default value; now they produce the fallback value from the match expression.
* Merge branch 'release-boba' into masterupstream/fabian-merge-release-4.0.1-masterFabian Guerra2018-05-176-639/+433
|\ | | | | | | | | | | | | | | | | | | | | | | # 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
| * [core] Convert null to empty string, not “null”Minh Nguyễn2018-05-141-0/+1
| |
| * [core] Convert "legacy" filters directly into expressions (#11610)Lucas Wojciechowski2018-05-106-641/+434
| | | | | | Ports the specialized filter-* expressions from GL JS, adding them to src/mbgl/style/expression/compound_expression.cpp
* | [qt] Fix build when building the Qt Location pluginThiago Marcos P. Santos2018-05-141-1/+1
| | | | | | | | | | - MinGW has to explicitly know that is building a static library. - Android doesn't have 'round' on the std:: namespace when using g++.
* | [core] Port is-supported-script to native.Chris Loer2018-04-271-0/+5
|/ | | | Native port is much simpler because RTL text support is always enabled.
* Don't enforce ["zoom"] constraints for filters (#11672)Anand Thakker2018-04-122-5/+29
| | | | | | | | | | | | * Don't enforce ["zoom"] constraints for filters Fixes #11594 * Add a couple of comments * Fix ambiguous constructor call * ParsingContext(optional<Type>) => ParsingContext(Type)
* Update layer immediately when changing its max/min zoom level (#11399)Łukasz Paczos2018-04-1210-0/+20
| | | | | | * [android][core] update layer immediately when changing it's max/min zoom * [core] node bindings for layer zoom range
* Add abs, round, floor, ceil operators (#11653)Anand Thakker2018-04-111-0/+6
| | | | | | | | | | | | | | | | | | | | * Add abs, round, floor, ceil operators Port of https://github.com/mapbox/mapbox-gl-js/pull/6496 * [ios, macos] Simplified abs, ceiling, floor expressions * [ios, macos] Added rounding expression function * [android] - binding integration for round, ceil, floor and abs expressions * Update mapbox-gl-js to include non-integer rounding test * Drop extra braces * mapbox-gl-js -> master * Update style-spec docs -> PropertyFactory.java
* Fix style parsing bug for constant expressions (#11606)Anand Thakker2018-04-091-14/+27
| | | | | | | | | | | | | | * Fix style parsing bug for constant expressions Closes #10849 * Ignore tests for unported GL JS change Refs https://github.com/mapbox/mapbox-gl-js/pull/6429 * Fuller fix * Update mapbox-gl-js
* Use a host interface for CustomLayer instead of function pointers (#11553)Asheem Mamoowala2018-04-023-34/+8
| | | | | | Use a host interface for CustomLayer instead of function pointers Co-authored-by: Julian Rex <julian.rex@mapbox.com>
* [core] Fixed to-rgba with zero opacityMinh Nguyễn2018-03-302-10/+6
|
* [core] Round-trip linear interpolatorsMinh Nguyễn2018-03-301-1/+5
|
* [core] Stringify expression syntax, not function syntaxJohn Firebaugh2018-03-141-125/+6
|
* [core] TileJSON conversion clamps bounds longitude to [-180,180], per specAsheem Mamoowala2018-03-091-0/+2
|
* [core] Add expression filter support (#11251)Lucas Wojciechowski2018-03-094-6/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP * WIP * WIP * Remove Filter::operator()(const Feature&) * WIP * WIP * WIP * WIP * Hook up expression filter evaluator * Replace `shared_ptr` with &reference * Fill in implementation of `void operator()(const ExpressionFilter&)` * Fix failing tests * Switch back to a shared_ptr per chat with @anandthakker * Fix benchmark compilation * Shot in the dark to fix CI * Shot in the dark to fix CI (part 2) * Shot in the dark to fix CI (part 3) * In src/mbgl/style/conversion/filter.cpp, add a port of isExpressionFilter and use it to decide in Converter<Filter>::operator() whether to parse the incoming JSON as an ExpressionFilter or one of the legacy filter types * Remove bool Filter::operator()(const GeometryTileFeature&) const * Ensure the map zoom is passed into filtering operations wherever applicable * Add expression filter tests * Addressed PR feedback * Implement `NSPredicate *operator()(mbgl::style::ExpressionFilter filter)` * Fix formatting& nit
* Port fix for "at" expression off-by-1 error (#11375)Anand Thakker2018-03-021-4/+10
| | | | | | | | | | * Port fix for "at" expression off-by-1 error Refs https://github.com/mapbox/mapbox-gl-js/pull/6269 * Consistency * Add ignores for symbol positiong differences in real-world tests
* Relax type checking for "length"John Firebaugh2018-03-013-7/+68
|
* Infer type assertions for objectJohn Firebaugh2018-03-011-1/+1
| | | | Cross-ports https://github.com/mapbox/mapbox-gl-js/pull/6243.
* [core] Implement Expression::serialize()Chris Loer2018-02-2810-23/+177
| | | | | | | | Issue #10714 - Each expression stores its operator as a string, and default serialization is [operator, serialize(child1), ...] - Custom implementations of `serialize` for Expression types that don't follow the pattern - expression::Value -> mbgl::Value converter - node_expression bindings to expose `serialize`
* [core] continue loading style even if we mutate itKonstantin Käfer2018-02-231-5/+0
| | | | When we load a stale style from cache, and the user immediately starts mutating it, we should continue loading the style so that we'll get a fresh copy of the data into our cache and avoid perpetually showing the stale style.
* [core, ios, macos, android, node] Heatmap layer (#11046)Vladimir Agafonkin2018-02-1512-0/+378
| | | | | Co-Authored-By: Konstantin Käfer <mail@kkaefer.com> Co-Authored-By: Anand Thakker <anandthakker@users.noreply.github.com> Co-Authored-By: Minh Nguyễn <1ec5@users.noreply.github.com>
* [core] add support for mapzen terrarium (#11154)Molly Lloyd2018-02-141-0/+10
| | | | | | | | | | | | * add support for mapzen terrarium * Encoding --> DEMEncoding, avoid if statement when unpacking elevation values * add Terrarium test * update submodule * remove redundant checks
* TileJSON Bounds allows values inclusive of world extentsAsheem Mamoowala2018-02-121-1/+1
|
* [core] don't force downloading of Open Sans fontsKonstantin Käfer2018-01-251-1/+1
| | | | When a SymbolLayer doesn't have a text-font defined, we automatically add Open Sans/Arial Unicode MS. However, when the SymbolLayer is only used for rendering icons, it doesn't have text-field defined either. In those cases, we still force downloading Open Sans/Arial Unicode MS during offline pack creation. If the user doesn't use this font, this change should save ~15MB and a few seconds in download time.
* Reimplement style values atop NSExpression (#10726)Minh Nguyễn2018-01-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [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] fix style parsing crash when a layer's paint property is not an objectKonstantin Käfer2018-01-231-0/+3
|
* [core] add raster-dem source type and hillshade layer type (#10642)Molly Lloyd2018-01-2316-7/+424
|
* [core] Add warning for invalid text-font valuesJohn Firebaugh2018-01-101-0/+6
|
* [core, ios, macos, android] Add data-driven-styling support for `text-font`John Firebaugh2018-01-1014-19/+117
|
* [core] Handle NaN input to interpolate and stepJohn Firebaugh2018-01-102-8/+11
|
* [core] Omit inferred type annotations for 'coalesce' argumentsJohn Firebaugh2018-01-092-31/+50
|
* [core] Fix alpha handling in rgba and to-rgba operatorsJohn Firebaugh2018-01-092-4/+7
|
* [core] Enable implicit type assertions for array typesJohn Firebaugh2018-01-091-0/+2
|
* [core] Improve typing for !=, == expressionsJohn Firebaugh2018-01-093-16/+86
|
* [windows][qt] Remove std:: namespace of some functionsThiago Marcos P. Santos2018-01-081-1/+1
| | | | Not available on Windows.
* Support TileJSON bounds property (#10701)Asheem Mamoowala2018-01-052-2/+40
| | | | | | | | * [core] Parse TileJSON bounds property * [core] Add TileRange and LatLngBounds::contains(CanonicalTileID) Move LatLngBounds::contains impl to cpp file * [core] Skip tile creation outside of tileset bounds * [core] Fix TileRange for wrapped bounds and use for CustomTileLoader instead of LatLngBounds comparisons for tiles.
* [core] Migrated upcase, downcase to platform codeMinh Nguyễn2017-12-141-8/+3
| | | | Replaced manual, per-character upper- and lowercasing code with calls to platform-specific code that affects a wider range of characters.
* [core] Use wrapped bounds check for CustomTileLoaderAsheem Mamoowala2017-12-071-1/+1
|
* [core] Mark custom geometry tiles stale without clearing dataAsheem Mamoowala2017-12-063-15/+17
|
* [core] Use Actors for CustomTileLoader invocation from bindings.Asheem Mamoowala2017-11-223-17/+8
|
* [core] Custom Geometry SourcesAsheem Mamoowala2017-11-226-0/+276
|
* [core] Fix build on Android + GCC and Android + armeabiThiago Marcos P. Santos2017-11-1211-20/+31
| | | | Sadly we don't have bots for these two setups.
* Implement Expressions (#9439)Anand Thakker2017-11-0824-0/+2881
| | | Ports https://github.com/mapbox/mapbox-gl-js/pull/4777 (and its several follow-ups)
* [core] Add layer before notifying observerJohn Firebaugh2017-10-251-1/+2
|
* Replace compile-time polymorphism with runtime polymorphism in the ↵John Firebaugh2017-10-2317-82/+1508
| | | | conversion system