Commit Graph

67 Commits

Author SHA1 Message Date
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
Fredrik Karlsson
903246b256 [ios, macos] renamed dasharray and icon size 2016-12-06 22:18:03 +01:00
Minh Nguyễn
3503c0e767 Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.4-master 2016-12-03 15:36:42 -08:00
Fredrik Karlsson
17db5210bf [ios, macos] rename style spec properties 2016-11-30 11:36:39 +01:00
Jesse Bounds
13e0f9e527 [ios, macos] Refactor runtime styling enumeration properties
Correctly map SDK runtime styling enumerations to mbgl
equivalents. Also, add category methods to NSValue so enums
can be wrapped up with less of the details of how they
are layed out in memory in Objective-C.
2016-11-22 19:53:54 -08:00
Fredrik Karlsson
b4aba87892 [ios, macos] override style spec documentation 2016-11-16 11:50:36 +01: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
Fredrik Karlsson
5a828cb80f [ios, macos] override style spec documentation 2016-11-08 13:47:09 +01:00
Minh Nguyễn
dc884cd6c3 [ios, macos] Fixed syntax error in documentation comment (#6822)
Fixes #6821.
2016-10-26 00:36:23 -07:00
Minh Nguyễn
9652028915 [ios, macos] Expand changes to entire API 2016-10-17 11:47:22 -07:00
Minh Nguyễn
c78b5b1d7e [ios, macos] Simplified style property enum names
The name of each enumeration type no longer refers to the layer type that uses it.
2016-10-11 15:30:16 -07:00
Minh Nguyễn
50d2c01d7d [ios, macos] Revamped MGLStyleLayer, MGLSource inheritance
Removed the MGLStyleLayer protocol, because almost none of its members was actually implemented in every class that adopted the protocol. Removed the unused mapView backpointer property with no replacement. Renamed MGLBaseStyleLayer to MGLStyleLayer. Created the intermediate abstract classes MGLForegroundStyleLayer and MGLVectorStyleLayer to cover subsets of style layer classes with like functionality.

Moved each MGLBaseStyleLayer initializer and the corresponding properties down to an abstract subclass such that the initializer makes sense for all concrete subclasses. Moved more initializers and the predicate property up to MGLVectorStyleLayer to eliminate duplication among the concrete subclasses. Marked these initializers as designated initializers.

Removed “source” or “layer” before identifier wherever the type of identifier is apparent. Removed extra MGLGeoJSONSource initializer variants in favor of nullable parameters.

Added copious documentation comments for source and style layer classes, including several previously undocumented methods and properties. In particular, some preconditions and postconditions have been documented. Added pragma marks to break up the jazzy documentation pages into sections. Reformatted exceptions for consistency.
2016-10-06 15:19:38 -07:00
Minh Nguyễn
132954b563 [ios, macos] Loosened style doc transform regex (#6543)
Mildly decoupled the transformation from the style specification to the format required for iOS/macOS documentation so it’s harder for style specification references to other properties’ values to fall through the cracks.

Fixes #6541.
2016-09-30 18:20:47 -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
David Clark
bf18c33040 [ios, macos] Doc gen handles arrays as required property values (#6448) 2016-09-24 07:39:56 -07:00
Minh Nguyễn
a0e20a6b0f [ios, macos] Allow full hexadecimal colors in layer documentation (#6444)
* [ios, macos] Allow full hex colors in layer docs

CSS hexadecimal RGB syntax can contain all the hexadecimal digits, not just the decimal digits.

* [ios, macos] Parse colors with csscolorparser
2016-09-23 16:04:37 -07:00
Jesse Bounds
4c8d61abf1 [ios, macos] Put MGLStyleLayer inits in respective classes
Previously, we declared MGLStyleLayer initializers in the MGLStyleLayer
protocol as optional methods. This made it easy to opt in and out
of initializers that did or or did not make sense for the subclass.
However, this approach was dangerous since it was easy for an
application developer to initialize an MGLStyleLayer subclass with an
init method that was actually not implemented in that class causing
an exception at runtime.

This commit moves the init methods that each subclass supports to
each subclass so xcode (and the compiler) help the developer avoid
the previously possible runtime exception.

In addition, a new init method is added that takes the source layer
and passes that on to `mbgl::style:Layer` (but only on classes
where this is possible in core). This allows an application developer
to style a specific source layer (i.e. the contour lines of the mapbox
terrain vector source).

Finally, this refactors MGLStyleLayer classes to use an MGLSource instead of a
string identifier for the source when initializing the style.
2016-09-08 09:17:35 -07:00
John Firebaugh
fe2a26225f [core, ios, android, qt] Observe style layer mutations rather than requiring SDKs to use Map::update
This paves the way for updates to filter and layout properties to trigger a source reload, without each SDK having to participate in the implementation.
2016-09-06 14:29:22 -07:00
Minh Nguyễn
f4be8260ba [ios, macos] Specialize color properties by platform
Duplicate each color-typed property once per platform using conditional compilation macros. Let’s just hope we never have to throw CGColor into the mix.
2016-08-26 22:27:55 -07:00
Minh Nguyễn
35a1c01166 [ios, macos] Test roundtripping property functions 2016-08-26 22:27:55 -07:00
Minh Nguyễn
1e7a5ce273 [ios, macos] Test enum values, not just types 2016-08-26 22:27:55 -07:00