summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLLineStyleLayer.h
Commit message (Collapse)AuthorAgeFilesLines
* [darwin] Remove use of NS_DESIGNATED_INITIALIZER from MGLStyleLayer subclassesJohn Firebaugh2017-04-131-1/+1
| | | | It produces compiler warnings for which there seems to be no workaround, and since there's only a single initializer, NS_DESIGNATED_INITIALIZER has little benefit.
* [darwin] Simplify MGLStyleLayer initialization and pointer managementJohn Firebaugh2017-04-131-0/+15
| | | | | | Similarly to the previous commit, introduce `-[MGLStyleLayer initWithPendingLayer:]`, allowing the base class to track the owned `_pendingSource` pointer and implement `-addToMapView:` and `-removeFromMapView:` without any casts. Fixes an issue where `-[MGLStyle layerFromMBGLLayer:]` would wind up creating layers whose `_rawLayer` and `_pendingLayer` held different values.
* [ios, macos] API doc revisions (#8396)Jordan Kiley2017-03-141-1/+1
| | | | | | | | - Changed `make style-code-darwin` to `make darwin-style-code` in relevant files - Added some doc clarifications: - `MGLInterpolationModeExponential` and `MGLInterpolationModeInterval` can be used with `MGLCameraStyleFunction` (I am not sure how to accurately reflect this in the documentation for `MGLCompositeStyleFunction`) - Do not add a style layer to the style property on a map view before the style has finished loading - Create individual style layers from a `MGLShapeCollectionFeature`
* Per-attribute transition properties on MGLStyleLayer (#8225)Fabian Guerra Soto2017-03-101-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] new struct MGLTransition * [ios] MGLTransition struct moved to MGLTypes.h * [ios] MGLTransition implemented for style layer properties * [ios, macos] added support for getting property transitions * [ios, macos] updated to MGLDurationFromTimeInterval and MGLTimeIntervalFromDuration * [ios, macos] added transition properties test * [ios, macos] modified key strings imp * [ios, macos] The impl for transition properties were changed to public methods * [ios, macos] Changelog update * [ios] Fixed layer space formatting * [core] The name space was fixed for getters that returned TransitionOptions * [ios, macos] Added rawLayer transition property tests * [ios] Added a factory method for MGLTransition and transition-related methods to NSValue(MGLAdditions) * [ios, macos] Copyedited changelog blurbs about transition properties
* [ios, macos] Rename MGLStyleConstantValue to MGLConstantStyleValueJesse Bounds2017-03-031-16/+16
|
* [ios, macos] Don't add documentation to NS_ENUMJesse Bounds2017-02-081-196/+130
|
* [ios, macos] Add more bullets to style property docsJason Wray2017-02-081-85/+114
|
* [ios, macos] Add function and interpolation mode to style property docsJesse Bounds2017-02-081-27/+225
|
* [ios, macos] Update documentation examples to use new style functions (#7960)Jesse Bounds2017-02-081-4/+4
|
* [ios, macos] Add support for data-driven property functionsJesse Bounds2017-02-021-32/+32
|
* [core] remove trailing whitespace, add trailing newlines, add space after //Konstantin Käfer2017-01-271-39/+39
|
* Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.7Minh Nguyễn2017-01-161-55/+210
|\
| * [ios, macos] Make MGLMapView.style property nullable (#7664)Minh Nguyễn2017-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Made MGLMapView.style property nullable MGLMapView’s style property is now nullable (optional in Swift). The property is set to nil while the style loads and in the event that the style has failed to load. * [ios, macos] Switch to delegate method * [macos] Create MGLMapView programmatically for layer tests When MGLMapView is created via a nib, -initWithCoder: is called, causing styleURL to be set to nil, in turn causing the default Streets style to be loaded, fooling MGLStyleLayerTests into thinking one-line has been loaded. Instead, create MGLMapView programmatically, passing the intended style URL into the initializer, preventing Streets from being loaded.
| * [ios, macos] Cleaned up color, edge insets declarations, commentsMinh Nguyễn2017-01-091-2/+2
| | | | | | | | Eliminated references to MGLColor within style layer headers.
| * [macos] Flip offsets and translationsMinh Nguyễn2017-01-091-3/+19
| | | | | | | | 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.
| * [ios, macos] Fixed links to paint properties in style specMinh Nguyễn2017-01-071-3/+3
| |
| * [ios, macos] -translate → -translationMinh Nguyễn2017-01-071-13/+25
| |
| * [ios, macos] Keep style attribute NSValue categories near enum declarationsMinh Nguyễn2017-01-071-0/+49
| | | | | | | | Eliminated the separate NSValue+MGLStyleLayerAddition files, moving the categories into their respective style layer headers to be closer to the enumeration declarations.
| * [ios, macos] Insert example code in original headers (#7569)Minh Nguyễn2017-01-041-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Removed extraneous code fences * [ios] Streamlined example delimiters Use test method names as names of example blocks and test method documentation comments as front matter for examples. Set off example blocks using a syntax similar to playground markup syntax. Avoid hard-coding indentation levels. Trigger Xcode build error when an error occurs in the script. * [ios] Removed platform-specific code from examples * [ios] Fixed logic error The comment said 200 while the code said 1,500. * [ios] Formalize build phase input * [ios] Insert examples into original source documentation Rewrote the example code insertion script to work on the original source files and overwrite any existing code examples on the same symbols. The script uses SourceKitten to find the documentation comment for the symbol named by the test method. Replaced the Run Script build phase that runs the example code insertion script with a make rule that runs the same script. Inlined skeleton examples minus the contents of the code blocks. * [ios] Fixed syntax error * [ios] Ran ios-add-examples-to-docs * [ios] Avoid touching unchanged headers * [ios] Refactored example insertion script * [ios] Point jazzy at original sources * [ios] Invoke SourceKitten only once * [ios] Look for methods as well as properties * [ios] Thoroughly search for code blocks in doc comments Refactored the example code insertion script to index test methods by their names, then recursively search the SourceKitten output for documentation comments that contain Swift code blocks, replacing each code block with the associated test method body. * [ios, macos] Enabled example insertion for macOS The example code insertion script is now platform-agnostic. * [ios, macos] Fixed documentation example tests Set the map view’s style to a minimal local JSON file. Wait for the style to finish loading before running each test. Corrected CGVector type. * [ios, macos] Dry run mode The output of this mode isn’t a good indicator of whether any files would’ve needed to be changed, because the presence of a conditional compilation block in one of the test methods means this script would always change and revert the corresponding comment. * [ios] Fixed test failure The iOS implementation of MGLMapView tries to show the Streets style by default even if no access token has been set. Avoid a race condition and frequent test failure by specifying the minimal style on initialization. * [ios, macos] Ensure SourceKitten is installed before inserting example code * [ios, macos] Tear down map view after each test Keep map views from previous tests from hanging around, potentially obscuring the result of a subsequent test. Set the access token to a bogus token upfront for all style layer tests. Unified MGLStyle usage within MGLStyleTests. * [ios, macos] Reinsert examples after generating runtime styling headers
| * [ios] Add inline examples in documentation (#7337)Eric Wolfe2016-12-211-0/+2
| |
| * [ios, macos] Update and reformat documentation for runtime styling (#7475)Minh Nguyễn2016-12-201-48/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [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
* | [build] add -fvisibility=hidden to macOS dynamic framework and export ↵Konstantin Käfer2017-01-041-0/+2
|/ | | | required symbols
* Use appropriate part of speech for properties (#7457)Minh Nguyễn2016-12-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | * [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”).
* [ios, macos] Note corresponding style spec propertiesMinh Nguyễn2016-12-061-0/+2
| | | | Documentation for attributes whose names we’ve overridden now mention the original style specification property name, with a link to the style specification documentation for the property.
* [ios, macos] renamed dasharray and icon sizeFredrik Karlsson2016-12-061-1/+1
|
* [ios, macos] rename style spec propertiesFredrik Karlsson2016-11-301-35/+35
|
* [ios, macos] override style spec documentationFredrik Karlsson2016-11-161-2/+2
|
* [ios, macos] Expand changes to entire APIMinh Nguyễn2016-10-171-32/+31
|
* [ios, macos] Replaced MGLStyleAttributeValue with MGLStyleValueMinh Nguyễn2016-10-171-2/+3
| | | | MGLStyleValue is an umbrella class serving as a variant container for MGLStyleConstantValue and MGLStyleFunction. These classes use lightweight generics to indicate the underlying type. A templated C++ class concisely converts between mbgl::style::PropertyValue and MGLStyleValue.
* [ios, macos] Refer to style layer class in enum documentationMinh Nguyễn2016-10-111-0/+6
|
* [ios, macos] Simplified style property enum namesMinh Nguyễn2016-10-111-16/+16
| | | | The name of each enumeration type no longer refers to the layer type that uses it.
* [ios, macos] Renamed files to match renamed classesMinh Nguyễn2016-10-061-1/+1
|
* [ios, macos] Revamped MGLStyleLayer, MGLSource inheritanceMinh Nguyễn2016-10-061-13/+1
| | | | | | | | | | 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.
* update style generation code for new style spec enum values docs (#6508)Justin R. Miller2016-09-301-1/+34
| | | | | | 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.
* [ios, macos] flesh out iOS runtime styling docs (#6466)Justin R. Miller2016-09-271-1/+6
| | | | | | | | - fixes #5959: MGLBaseStyleLayer docs - fixes #5960: MGLSource & subclasses docs - fixes #6467: concrete layer subclass docs - move Core Graphics include - slight code & template cleanups - add ./documentation to git ignores
* Better handling for undefined icon|text-rotation-alignment (#6253)Young Hahn2016-09-211-1/+1
| | | | | | * [core, ios, android] Use `auto` value for properties with calculated defaults * Fix render tests
* [ios, macos] Put MGLStyleLayer inits in respective classesJesse Bounds2016-09-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | 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.
* [ios] Added support for filters (NSPredicate)Fredrik Karlsson2016-09-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ios, macos] cleaned up filters [ios] added a filter example [ios] utest filters [ios, macos] nested predicates [ios] refactored [ios] filter -> NSPredicate [ios] fixed mbgl::Any/AllFilter -> NSPredicate [ios] translate nested mbgl::NotIn filters [ios] cleanup and added more utests [ios] fixed a bug in the None filter conversion and improved utests [ios, macos] doc [macos] added missing category [ios, macos] additional utests [ios, macos] updated documentation
* [ios, macos] Specialize color properties by platformMinh Nguyễn2016-08-261-1/+12
| | | | 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.
* [ios, macos] More specific default value typesMinh Nguyễn2016-08-261-14/+14
| | | | The documentation for runtime style API properties now spells out the value of the default type, to help developers infer the type of the property itself.
* [ios, macos] Mark MGLStyleLayer properties null_resettableMinh Nguyễn2016-08-261-26/+26
| | | | | | If the property is unset, return the default value. Fixes #6126.
* [ios, macos] Distinguish between blackColor and clearColor (#6125)Minh Nguyễn2016-08-241-1/+1
|
* [ios, macos] Copyedit default color property documentation (#6105)Minh Nguyễn2016-08-211-1/+1
| | | | | | | | * [ios, macos] Fixed typo in color property docs * [ios, macos] Predefined colors as default color property values Use {NS,UI}Color.blackColor and {NS,UI}Color.whiteColor as aliases for common default color values.
* [ios, macos] Optional properties are nullableMinh Nguyễn2016-08-191-29/+29
| | | | null_resettable semantics aren’t currently respected: #6095.
* [ios, macos] Document style attribute interdependenciesMinh Nguyễn2016-08-191-12/+22
|
* [ios, macos] Specify unitsMinh Nguyễn2016-08-191-3/+15
| | | | Replaced pixels with points in documentation.
* [ios, macos] Fully describe default valuesMinh Nguyễn2016-08-191-5/+5
| | | | | | Also expand values in documentation comments to the full enumeration values. Fixes #5949.
* [ios, macos] Audited generated source/layer headersMinh Nguyễn2016-08-191-14/+42
| | | | Properties representing optional attributes are qualified with null_resettable. The default value is documented.
* [ios, macos] Make Xcode 7.3 the minimum required versionJason Wray2016-08-181-1/+0
| | | | | | | | | - Removes nullability shims for Xcode 6. - Removes MGLTypes.h from files where it was only being used for nullability support. - Accepts that `NS_SWIFT_NAME` is not fully supported by Xcode 7.2 and lower. - Adds documentation about Xcode 7.3 requirement.
* Runtime styling API for iOS/macOS (#5727)Fredrik Karlsson2016-08-111-0/+101
* [ios] wip runtime styling * [ios, macos] Outlined header templates * [ios, macos] cleanup and use appropiate data types * [ios, macos] removed refs to mbgl and added convenient color methods on UIColor and NSColor * [ios, macos] updated header template, included doc string * [ios, macos] outlined template for layer implementation files * [ios, macos] moved script to platform/darwin and updated comments * [ios, macos] Cleaned up the implementation template * [ios, macos] removed unused function and added support for more datatypes * [ios, macos] overhauling the type protocols * [ios, macos] removed unnecessary style classes * [ios, macos] added support for more types * [ios, macos] fixed string and number prop values * [ios, macos] enum getters * [ios, macos] added removeLayer() and removed unused layer ref * [ios, macos] fixed remaining layer types and converted style layer into a protocol * [ios, macos] fixed addLayer() and added example for line layer * [ios] GeoJSON source now works * [ios] fixed raster layer and raster source * [ios] fixed attr prop number and outlined prop function * [ios] wip functions * [ios] bool and float function fix * [ios] cleanup * [macos] fixed support for macos * [ios] fixed string functions * [ios] extended array functions * [ios] added tests and fixed a few bugs * [ios] less verbose functions and improved tests * [ios, macos] Removed unnecessary use of default arguments Default arguments aren’t supported in Node v4, and they aren’t needed here anyways, because we’re only testing for truthiness. * [ios, macos] Enum setters Rely on a macro instead of category methods to specialize the setter implementation for enum attributes, since generic types are disallowed in Objective-C method signatures and mbgl::style::PropertyType must be type-qualified. * [ios, macos] Got macOS closer to parity w/ iOS Added various classes and test classes to the macOS workspace. Also fixed lots of compiler errors and updated macosapp runtime styling example to use the new dictionary syntax for function stops. Updated all conversions from Objective-C stops to C++ stops to enumerate over the dictionary. Fixed compiler errors in enum setter implementations. Also corrected path to script in generated file comments. * [ios, macos] Added EJS templates to project * [ios, macos] Code formatting Made code format more consistent. * [ios, macos] Spelled out ID Cocoa convention is to always spell out “ID” as “identifier”, in part to avoid confusion with the id keyword. Also, URL is capitalized in most contexts, including property names. * [ios, macos] Grouped related headers together * [ios, macos] Cleaned up layer transformation Also added support for converting background layers into Objective-C. * [ios, macos] Cleaned up tests Also made the tests work on macOS by introducing a new window to host the map. * [ios, macos] Replaced TODOs with #warnings * [ios] convert array based property values * [ios, macos] color function/undefined getter * [ios, macos] fixed function/undefined getters for bool and float properties * [ios, macos] more function/undefined property getters * [ios, macos] more type conversion and cleanup * [ios, macos] disable macos runtime styling tests for now * [ios, macos] cleaned up style code script * [ios, macos] more type conversion * [ios] added a base layer to handle visibility min/max zoom * [macos] fixed base layer * [ios, macos] use accessor methods * [ios, macos] cleanup * [ios, macos] add geojson to ios and macos * [macos] rebase fix * [ios, macos] fixed enum getters and added tests for enums * [ios, macos] added an update method to base layer * [ios, macos] added some documentation * [ios, macos] docs * [ios, macos] removed refs to filters for now * [ios, macos] various tail work * [ios, macos] missing import and incorrect type