Commit Graph

1941 Commits

Author SHA1 Message Date
Chris Loer
9ff5d34ef2 [core] Introduce "collator" expressions
Cross platform parsing and evaluation code.
2018-07-03 10:03:05 -07:00
Bobby Sudekum
4286d5869c Add pitch argument to cameraThatFits functions (#12213) 2018-07-02 16:30:18 -07:00
John Firebaugh
647959a853 [core] Add assertions to expression constructors 2018-06-29 15:38:11 -07:00
John Firebaugh
25ac89e018 [core] Remove stops-based *Function constructors 2018-06-29 15:38:11 -07:00
John Firebaugh
6dfe56510c [darwin] Replace use of *Stops with expressions DSL 2018-06-29 15:38:11 -07:00
John Firebaugh
542a4b4501 [core] Replace use of *Stops with expressions DSL 2018-06-29 15:38:11 -07:00
John Firebaugh
e323daf71f [core] InterpolateBase → Interpolate; Interpolate → InterpolateImpl 2018-06-28 10:00:40 -07:00
John Firebaugh
1dd35eface [core] Privatize Interpolate<T> 2018-06-28 10:00:40 -07:00
John Firebaugh
b2f6acca61 [core] Move non-polymorphic Interpolate methods to base 2018-06-28 10:00:40 -07:00
John Firebaugh
bc771ee02e [core] Split Interpolator into a separate file 2018-06-28 10:00:40 -07:00
John Firebaugh
d176e9bb46 [core] Fix issues in unique_any
* Eliminate unnecessary temporary in VTableStack::move, which also fixes calling the destructor on the incorrect instance
* Make move consistent: it destructs the src, not the dest, which is always empty
* delete doesn't need a null guard
* Conversions to void* don't need a cast
2018-06-25 13:14:52 -07:00
Molly Lloyd
e1af62e87d [core] add raster-resampling property (#12176)
* update style-code for raster-resampling

* implement user-defined raster-resampling

* invert filter condition

* raster-resampling -> raster-resampling-mode for darwin language conventions
2018-06-21 14:37:17 -07:00
Lloyd Sheng
eb70b89849 [core] Measuring tiles requesting/parsing time using logging (#12152)
* Tile timing

* Refactor logging code

* Keep the scope of `messageStream` constrained

* Make log message more clear

* Fix crash issue if onlineResponse.data is null
2018-06-21 11:24:14 +08:00
Konstantin Käfer
2b2de05612 [core] allow logging error codes and formatting strings at the same time 2018-06-12 17:41:16 +02:00
Konstantin Käfer
d66251234d [core] don't use floating point versions of pow/log
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
2018-06-04 10:43:21 +02:00
Anand Thakker
464fefab18 Accept constant expressions in non-dds properties (#11960)
Closes #11940
2018-05-23 09:54:49 -04:00
Ansis Brammanis
ba07c873aa [core] re-assign ids when lng jumps to avoid flicker 2018-05-22 14:58:11 -04:00
Ansis Brammanis
5e36f669ac [core] avoid symbol flickering when longitude is wrapped 2018-05-22 14:58:11 -04:00
Fabian Guerra
30376f3ce1 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
2018-05-17 11:47:31 -04:00
Lucas Wojciechowski
a4e2c1af1f [core] Convert "legacy" filters directly into expressions (#11610)
Ports the specialized filter-* expressions from GL JS, adding them to src/mbgl/style/expression/compound_expression.cpp
2018-05-10 12:37:14 -07:00
Asheem Mamoowala
4344812ef5 [core] Streaming TileCover for polygonal regions (#11267)
A per-tile streaming algorithm for tile cover on points, lines, and polygons. Works for individual zoom levels, and not zoom ranges.
2018-04-26 07:43:38 -07:00
Anand Thakker
352d63d2ce Don't enforce ["zoom"] constraints for filters (#11672)
* Don't enforce ["zoom"] constraints for filters

Fixes #11594

* Add a couple of comments

* Fix ambiguous constructor call

* ParsingContext(optional<Type>) => ParsingContext(Type)
2018-04-12 16:02:48 -04:00
Anand Thakker
8d26f74091 Fix style parsing bug for constant expressions (#11606)
* 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
2018-04-09 17:59:18 -04:00
Asheem Mamoowala
dc495e1c9d [core] Add Projection matrix to CustomLayerRenderParameters to transform web mercator world coordinates to GL coordinates. 2018-04-05 18:04:25 -07:00
Asheem Mamoowala
099fcc3b3c Use a host interface for CustomLayer instead of function pointers (#11553)
Use a host interface for CustomLayer instead of function pointers

Co-authored-by: Julian Rex <julian.rex@mapbox.com>
2018-04-02 16:15:25 -07:00
Minh Nguyễn
d066e94103 [core] Fixed to-rgba with zero opacity 2018-03-30 15:36:32 -07:00
John Firebaugh
9499a2bda7 [core] Don't resolve tokens after evaluating a text-field or icon-image expression (#11509) 2018-03-22 16:44:12 -07:00
Lucas Wojciechowski
8a3deab733 [core] Add expression filter support (#11251)
* 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
2018-03-09 11:12:14 +01:00
John Firebaugh
54f3dc961e Relax type checking for "length" 2018-03-01 17:02:26 -08:00
Chris Loer
75feda12f1 [core] Implement Expression::serialize()
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`
2018-02-28 16:09:09 -08:00
Anand Thakker
b16893f903 Correctly parse constant expressions in dds style properties (#11282)
* Correctly parse constant expressions in dds style properties

Closes #10849

* Clarify
2018-02-21 21:39:33 -05:00
Vladimir Agafonkin
82de856c94 [core, ios, macos, android, node] Heatmap layer (#11046)
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>
2018-02-15 17:38:23 +02:00
Molly Lloyd
8a283b0306 [core] add support for mapzen terrarium (#11154)
* add support for mapzen terrarium

* Encoding --> DEMEncoding, avoid if statement when unpacking elevation values

* add Terrarium test

* update submodule

* remove redundant checks
2018-02-14 13:17:55 -08:00
Chris Loer
a11b277bc1 [core] Rename "onLowMemory" to "reduceMemoryUse".
Android still calls "reduceMemoryUse" only while handling a low memory event.
iOS, on the other hand, calls "reduceMemoryUse" every time it enters the background.
2018-02-14 10:55:16 -08:00
Thiago Marcos P. Santos
fb65d25831 [core] Make RendererObserver a public interface
Needed by backends implementing asyncronous rendering
2018-02-09 20:28:54 +02:00
Asheem Mamoowala
6c5e457590 Add options for Custom Geometry Source types to enable clipping and wrapping geometry (#11041) 2018-02-07 12:07:31 -08:00
Konstantin Käfer
26a00f6a31 [core] prioritize Thread::pause() calls 2018-02-06 18:49:06 +01:00
Konstantin Käfer
93c4a23636 [core] change RunLoop processing to check queue on every iteration 2018-02-06 18:49:06 +01:00
Konstantin Käfer
78f8fd88b4 [core] factor out RunLoop::wake() 2018-02-06 18:49:06 +01:00
Konstantin Käfer
3ef7dab1a8 [core] use the RunLoop's schedule call directly
RunLoop already has a queue, and has the ability to schedule weak mailboxes, so we can remove the duplicate code.
2018-02-06 18:49:06 +01:00
Minh Nguyễn
fb5b8d34f2 Reimplement style values atop NSExpression (#10726)
* [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
2018-01-24 00:04:02 -08:00
Molly Lloyd
f3294200c6 [core] add raster-dem source type and hillshade layer type (#10642) 2018-01-23 10:49:23 -08:00
John Firebaugh
76ed5079a5 [core, ios, macos, android] Add data-driven-styling support for text-font 2018-01-10 15:31:12 -08:00
John Firebaugh
cedda5ef4f [core] Handle NaN input to interpolate and step 2018-01-10 13:45:00 -08:00
John Firebaugh
0eb4b5cc0e [core] Omit inferred type annotations for 'coalesce' arguments 2018-01-09 17:27:02 -08:00
John Firebaugh
a13027c1b6 [core] Improve typing for !=, == expressions 2018-01-09 16:10:51 -08:00
Thiago Marcos P. Santos
d00e56ada0 [windows][core] Add std::tuple replacement for Windows
Windows STL + Clang can't build our IndexedTuple class.
2018-01-08 22:58:20 +02:00
Thiago Marcos P. Santos
af9bb97e47 [windows][core] Add missing != operator to Tileset 2018-01-08 22:58:20 +02:00
Thiago Marcos P. Santos
5b789aa4d6 [windows][core] Include what you use 2018-01-08 22:58:20 +02:00
Asheem Mamoowala
10a44050f4 Support TileJSON bounds property (#10701)
* [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.
2018-01-05 06:35:31 -08:00