Commit Graph

43 Commits

Author SHA1 Message Date
Konstantin Käfer
2489afdd0d [build] change style code generator to sort properties alphabetically
JSON keys in our style specification don't have a defined order. This change sorts them alphabetically so that we can rely on the order remaining them same across code generation runs.
2019-05-02 17:44:18 +02:00
Konstantin Käfer
a48152a981 [build] change special casing for LineFloorWidth in shader generation 2019-05-02 17:44:18 +02:00
Mikhail Pozdnyakov
2b9a52f5e4 [core] Enable 'text-radial-offset' property 2019-03-29 16:18:41 +02:00
Mikhail Pozdnyakov
a6d8742e63 [core] Enable text-variable-anchor property 2019-03-29 16:18:41 +02:00
Konstantin Käfer
0ad2375e10 [core] remove a_/u_ prefix from attribute/uniform types 2019-03-20 15:40:47 +01:00
Alexander Shalamov
8be135231d [core] Add possibility of overriding paint properties inside format expression #14062
* [core] Add format override expression and formatted section to evaluation context

* [core] Add textColor to TaggedString's formatted section

* [core] Add FormatSectionOverrides and introduce overridable properties

* [core] Populate symbol layer paint properties for text sections

* [core] Add benchmark for style that uses text-color override

* [core] Add unit test for FormatOverrideExpression

* [core] Add unit test for FormatSectionOverrides
2019-03-13 17:14:53 +02:00
Konstantin Käfer
53628a455b [core] remove special casing in code gen 2019-03-01 09:33:37 +01:00
Chris Loer
ce76bde13d [core] Initial implementation of 'format' expression 2018-10-15 13:15:46 -07:00
Molly Lloyd
4a5dc37245 [core] Implement CrossFadedDataDrivenProperty to add support for feature expressions in *-pattern properties 2018-08-31 13:08:47 -07:00
Mikhail Pozdnyakov
fb5afd34b9 [core] Add line-gradient property
Porting of https://github.com/mapbox/mapbox-gl-js/pull/6303
See the link above for the description of the feature and
its limitations).

Based on patch from @lbud (Lauren Budorick).
2018-08-23 19:01:40 +03:00
Chris Loer
fd1767efba [core, test] Bump GL JS pin to bring gl-native back in sync with gl-js.
Requires changing `generate-style-code` to treat 'formatted' as being the same as 'string' until gl-native gets 'formatted' support with https://github.com/mapbox/mapbox-gl-native/pull/12624.
To make nitpick happy, PropertyFunction.java uses the latest "text-field" description from v8.json. It's technically correct, just kind of pointless since the "If a plain `string` is provided" clause will always be true.
2018-08-21 22:02:51 -07:00
John Firebaugh
b2f60a4bf2 [core] Eliminate setProperty & co. 2018-08-13 12:39:44 -07:00
John Firebaugh
9bdd765a02 [core] Merge DataDrivenPropertyValue into PropertyValue (#12513) 2018-07-31 14:21:47 -07:00
Mikhail Pozdnyakov
514485502d Rename HeatmapColorPropertyValue to ColorRampPropertyValue
Based on patch from @lbud (Lauren Budorick).

Give `HeatmapColorPropertyValue` a more generic name,
since the same value type will be used for both `heatmap-color`
and `line-gradient` properties.
2018-07-05 15:11:14 +03:00
Lauren Budorick
62c875e01b [core] Rework spec function/expression taxonomy
Ports https://github.com/mapbox/mapbox-gl-js/pull/6521, updating codegen scripts to parse new expression taxonomy.
2018-05-14 12:38:14 -07: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
Konstantin Käfer
13d27c700e [build] Always use style-code's writeIfModified to unify file updates 2018-01-24 08:35:31 -08:00
Konstantin Käfer
9d1fa508a3 [build] Add temporary modifications to style spec + shaders
This ensures that the generated code matches what is checked in. Remove those temporary modifications once we add the features to master.
2018-01-24 08:35:31 -08:00
John Firebaugh
7ca62ec602 [build] Special case heatmap-color so it doesn't crash make style-code 2018-01-10 11:15:49 -08:00
John Firebaugh
4b2e1cddb4 Replace compile-time polymorphism with runtime polymorphism in the conversion system 2017-10-23 09:56:43 -07:00
Lauren Budorick
2de89a99bc Implement icon-anchor property 2017-08-28 13:32:56 -07:00
Lauren Budorick
7b05606464 [core] add DataDrivenPaintProperty uniform template class to generation script (#9297) 2017-06-16 16:21:16 -07:00
Ivo van Dongen
feae5e22ee [core] generated accessor methods on light 2017-05-08 19:39:55 +03:00
Anand Thakker
f901e776b3 [core] Implement data-driven styling for {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
2017-02-28 19:54:24 -08:00
John Firebaugh
94a3c272ff [core] Update gl-js; fix $id filters with GeoJSON source 2017-02-08 19:07:53 -06:00
John Firebaugh
141e995806 [core] Add support for data-driven styling 2017-02-02 09:44:42 -08:00
John Firebaugh
9c5abc1221 [build] Use style-spec from gl-js monorepo 2017-02-01 08:11:01 -08:00
John Firebaugh
3b2a4216a2 [core] Implement circle-stroke properties
Also includes stubs for fill-extrusion layer, because most of the code was auto-generated.
2016-12-09 09:35:21 -08:00
Konstantin Käfer
2411ec83b1 [build] don't rewrite style code for every build
revert of 93166aef48

On Android, we always rewrote the style code files, which lead to gratuitous recompiles
2016-11-09 11:10:22 +01:00
Konstantin Käfer
a4d259c33f [core] move gl::Context to Backend and refactor View 2016-10-25 13:52:36 -07:00
Justin R. Miller
ee4715a821 update style generation code for new style spec enum values docs (#6508)
Documentation for enum values landed in mapbox/mapbox-gl-style-spec#510. 

This updates Android, iOS, and macOS documentation code gen scripts to capitalize on them.
2016-09-30 15:55:46 -07:00
John Firebaugh
63cce78cf1 [core] Add static getters for property default values (#6124) 2016-08-23 12:49:47 -07:00
Konstantin Käfer
c88b05e110 [core] make code generator produce GL-compatible colors
this makes sure colors are premultiplied and the RGB values are in the 0..1 range rather than in the 0..255 range.
2016-07-07 11:33:42 +02:00
John Firebaugh
16c435b151 [core, node] Implement bindings for addLayer 2016-06-24 09:39:51 -07:00
Young Hahn
24b66bc8cd Color class (#5361)
* Color class

* Switch to list initialization
2016-06-15 11:38:22 -04:00
John Firebaugh
3f5ea169f5 [node] Partial implementation of runtime styling API for node bindings 2016-06-13 17:22:05 -07:00
John Firebaugh
039b05ebb4 [core] Extract code templates to individual .ejs files 2016-06-13 17:22:05 -07:00
Young Hahn
ecd4aa1439 text-pitch-alignment (#5288)
* First pass at port of https://github.com/mapbox/mapbox-gl-js/pull/2668

* RotationAlignmentType => AlignmentType

* Handle undefined default value for text-pitch-alignment and implement inheritance for this value from text-rotation-alignment

* Update dependencies

* Move handling fo undefined default value out of camelize functions
2016-06-10 23:05:15 -04:00
John Firebaugh
47d6903f4e [core] Revert line-round-limit default to 1 (#5260)
Refs #5258, #5234.
2016-06-06 12:45:40 -07:00
John Firebaugh
c902f9098b [core] Rationalize naming for style-related code 2016-06-02 14:51:39 -07:00
John Firebaugh
67ee51360c [core] Add Filter accessors 2016-06-02 14:51:39 -07:00
John Firebaugh
cadc617c76 [core] Introduce PropertyValue<T>
PropertyValue<T> represents the three possible types of style property value: undefined, constant, or function.
2016-06-02 14:51:39 -07:00
John Firebaugh
a43940afb2 [core] Runtime style layer API 2016-06-02 14:51:39 -07:00