Commit Graph

87 Commits

Author SHA1 Message Date
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
Chris Loer
0b2221cb74 [android, ios, macos] Generate symbol-placement: line-center wrappers 2018-07-23 13:33:27 -07:00
John Firebaugh
6dfe56510c [darwin] Replace use of *Stops with expressions DSL 2018-06-29 15:38:11 -07: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
Jordan Kiley
0d5a33df67 [ios, macos] Moved numbers away from start of lines in documentation (#11881) 2018-05-15 10:48:21 -07: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
Jordan Kiley
f81f770741 [ios, macos] Update Style Functions guide (#11724) 2018-04-19 18:43:04 -07:00
Minh Nguyễn
3a0a3e4281 [macos] Replaced UIColor with NSColor in documentation 2018-04-16 16:27:56 -07:00
Fabian Guerra
903e7989ec Merge branch 'master' into release-boba
# Conflicts:
#	platform/android/CHANGELOG.md
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java
#	platform/android/scripts/exclude-activity-gen.json
#	platform/ios/CHANGELOG.md
#	platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec
#	platform/ios/Mapbox-iOS-SDK-symbols.podspec
#	platform/ios/Mapbox-iOS-SDK.podspec
#	platform/macos/CHANGELOG.md
2018-02-15 11:54:51 -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
Minh Nguyễn
65bab30384 [ios, macos] Documented ranges of style properties 2018-01-26 10:42:23 -08:00
Minh Nguyễn
703c73fda8 [ios, macos] Removed heatmap layer suppression from Darwin code generator 2018-01-24 10:21:01 -08: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
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
John Firebaugh
7ca62ec602 [build] Special case heatmap-color so it doesn't crash make style-code 2018-01-10 11:15:49 -08:00
Minh Nguyễn
9f89832827 [ios, macos] Fixed inconsistent indentation 2018-01-10 11:15:49 -08:00
Minh Nguyễn
f8d5b2511c [ios, macos] Qualify references to properties in enum docs
jazzy requires these property references to be qualified by class names in order to auto link them.
2018-01-10 11:15:49 -08:00
Minh Nguyễn
834e9cda58 [ios, macos] Update cross-refs to properties in doc comments 2018-01-10 11:15:49 -08:00
Lauren Budorick
2de89a99bc Implement icon-anchor property 2017-08-28 13:32:56 -07:00
Fabian Guerra Soto
67c09b18e4 MGLLight autogenerate scripts (#9260)
* [ios, macos] Add the MGLLight generation templates

* [ios, macos] Add MGLLight generation script

* [ios, macos] Add the auto-generation script for MGLLight.mm

* [ios, macos] Add the auto-generation script for MGLLightTest.mm

* [core] Add const to Position constructor.

* [ios, macos] Simplify MGLLightTest.mm autogenerate script.
2017-06-16 06:41:51 -07:00
Minh Nguyễn
30b919196b [ios, macos] Factored out tile URL template guide
Factored out redundant tile URL template documentation from the MGLRasterSource and MGLVectorSource documentation into a jazzy guide. This documentation used to live in one place, on a method on MGLTileSource, but that method had to be moved to MGLTileSource’s concrete subclasses. A jazzy guide is easier to link to, in any case.
2017-05-16 16:42:31 -07:00
Minh Nguyễn
5cc641ecad [ios, macos] Moved DDS guide examples to Swift unit test
Moved example code from DDS guide to a unit test written in Swift. The code is inserted into the guide at codegen time.
2017-05-08 14:41:21 -07:00
Lauren Budorick
f6e79d7073 [core] Render fill-extrusion layers (#8431) 2017-04-27 15:56:55 -07:00
Jesse Bounds
5d4d5dcf1b [ios, macos] Rename Data-driven styling guide (#8627)
* [ios, macos] Rename Data-driven styling guide

This turns the Data-driven styling guide into a guide for working with
style functions. This helps clarify that not all style functions are
DDS specific but keeps the discussion of this related functionality in
the same guide.
2017-04-05 12:05:29 -07:00
Jordan Kiley
789a49d46d [ios, macos] update iOS SDK guides (#8354)
- Added DDS guide
- Updated "For Style Authors" guide
2017-03-17 19:13:24 -04:00
Jesse Bounds
d25e2c772d [ios, macos] Rename MGLStyleConstantValue to MGLConstantStyleValue 2017-03-03 09:10:31 -08:00
Anand Thakker
062b18374d [core] Enable property functions for text-{field,transform} (#7944) 2017-02-17 13:16:25 -08:00
Jesse Bounds
a49301ad25 [ios, macos] Don't add documentation to NS_ENUM 2017-02-08 21:11:43 -08:00
Jason Wray
0e80318627 [ios, macos] Add more bullets to style property docs 2017-02-08 21:11:43 -08:00
Jesse Bounds
a383edaae8 [ios, macos] Add function and interpolation mode to style property docs 2017-02-08 21:11:43 -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
9c5abc1221 [build] Use style-spec from gl-js monorepo 2017-02-01 08:11:01 -08:00
Konstantin Käfer
62ea1f2185 [core] remove trailing whitespace, add trailing newlines, add space after // 2017-01-27 11:44:16 +01:00
Minh Nguyễn
7ef2843e6a Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.7 2017-01-16 11:38:35 -08:00
Minh Nguyễn
4d5036616f [ios, macos] Rewrote style layer tests
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.
2017-01-13 10:26:43 -08:00
Jesse Bounds
00bacf5951 [ios, macos] Temporarily ignore the fill extrusion layer (#7706) 2017-01-12 16:06:23 -08:00
Minh Nguyễn
a4c44c5158 [ios, macos] Cleaned up color, edge insets declarations, comments
Eliminated references to MGLColor within style layer headers.
2017-01-09 01:38:20 -08:00
Minh Nguyễn
e0f9870406 [macos] Flip offsets and translations
The screen origin is at the lower-left, so offsets and translations increase rightwards and upwards, in contrast to iOS and Web contexts, where the coordinate system increases rightwards and downwards. Duplicated style layer property declarations to reflect this difference.
2017-01-09 01:38:20 -08:00
Minh Nguyễn
d3a2ffe747 [ios, macos] Fixed links to paint properties in style spec 2017-01-07 15:54:08 -08:00
Minh Nguyễn
bf8d037fca [ios, macos] -translate → -translation 2017-01-07 15:47:31 -08:00
Minh Nguyễn
d5d6bcee0f [ios, macos] Keep style attribute NSValue categories near enum declarations
Eliminated the separate NSValue+MGLStyleLayerAddition files, moving the categories into their respective style layer headers to be closer to the enumeration declarations.
2017-01-07 14:37:53 -08:00
Minh Nguyễn
80df3090ec [ios, macos] Split NSValue+MGLStyleEnumAttributeAdditions category per style layer type
Also renamed the file to have a slightly more wieldy name.
2017-01-07 14:37:53 -08:00
Minh Nguyễn
a1bea12444 [ios, macos] Split For Style Authors guide
Information for Style Authors is now two separate guides, one for iOS and one for macOS. Both are compiled from the same template. Added language about rotation, tilting, and printing.
2017-01-04 21:48:24 -08:00
Minh Nguyễn
7e120e32b8 [ios, macos] Added guide for style authors
Added a guide to orient JSON stylesheet authors and Mapbox Studio users around the runtime styling API. An introductory section details the many considerations for designing a robust style for use with iOS and macOS devices.
2017-01-04 21:46:25 -08:00
Minh Nguyễn
1254bcdb40 [ios, macos] Update and reformat documentation for runtime styling (#7475)
* [ios, macos] Optimized changelog for runtime styling

Changelog entries related to style JSON now lead off with the analogous portion of the runtime styling API.

* [ios, macos] Autolink cross-class property references in docs

jazzy can autolink `Class.property` references in documentation comments.

* [ios, macos] Removed extra blank lines

* [ios, macos] Corrected typo in MGLMultiPoint docs

* [ios, macos] Rewrote shape and feature docs

Rewrote documentation about MGLShape, its subclasses, and MGLFeature to emphasize runtime styling uses over annotation uses, associate each type with real-world concepts, cross-reference related style layer classes, and cross-reference related or easily confused shape classes. Links to the GeoJSON specification have been updated to RFC 7946.

* [ios, macos] Expanded style layer docs

With this change, documentation about style layer classes is nominally based on the documentation in the style specification. However, all the existing layer types’ documentation has been overridden to explain what the layer looks like, relate the layer to a real-world concept, and cross-reference related geometry classes. This change also corrects the description of MGLBackgroundStyleLayer, which erroneously stated that the identifier must be “background”, whereas that only happens to be true by default for Studio template styles.

* [ios, macos] Wrap style layer docs

* [ios, macos] Removed unused code

* [ios, macos] Corrected symbol references in docs

* [ios, macos] Corrected typo in abstract class exception
2016-12-20 16:11:05 -08:00
Minh Nguyễn
a6b1773a44 Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.5-master
Also reran make style-code and manually discarded anything related to fill extrusion layers.
2016-12-20 12:41:40 -08:00
Minh Nguyễn
3f26e88c49 Use appropriate part of speech for properties (#7457)
* [ios, macos] Use appropriate part of speech for properties

Fixed overridden property references in requirements lists. Boolean-typed properties can now have getters beginning with “is”.

Renamed a number of layout properties according to the following rules: Boolean-typed properties should include a verb; other properties must be noun phrases; all properties must be grammatical.

* [ios, macos] Added style spec names as unavailable aliases

Renamed properties now have aliases based on their style specification names, marked unavailable, for wayfinding purposes.

* [ios, macos] Fixed autosynthesis warnings

* [ios, macos] Moved style layer test template to test folder

* [ios, macos] Customized iconOptional getter

* [ios, macos] Avoid autosynthesis of aliases

* [ios, macos] Test that property names are grammatical

Run property getter names through a basic battery of tests to see if they’re grammatical. Most part-of-speech tagging tests are guarded by a compile-time flag, off by default, because NSLinguisticTagger does a poor job of telling nouns from verbs, and we’ve intentionally kept many words in property names that could be read as either verbs or nouns (like “transform” or “scale”).
2016-12-16 08:09:42 -08:00
Minh Nguyễn
1ab791c3dc [ios, macos] Override references to property names in property requirements lists (#7391)
* [ios, macos] Refer to template images in documentation

SDF icons are known as template images in AppKit and UIKit.

* [ios, macos] Override property names in requirements
2016-12-12 23:05:09 -08:00