summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLVectorSource.mm
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'ios-v3.6.2' into masterFabian Guerra2017-08-281-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # cmake/core-files.cmake # include/mbgl/renderer/renderer_backend.hpp # platform/android/CHANGELOG.md # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/IconManager.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java # platform/android/dependencies.gradle # platform/darwin/src/MGLStyle.mm # platform/ios/CHANGELOG.md # platform/ios/app/Info.plist # platform/ios/app/MBXViewController.m # platform/ios/ios.xcodeproj/project.pbxproj # platform/macos/CHANGELOG.md # src/mbgl/gl/attribute.cpp # src/mbgl/gl/attribute.hpp # src/mbgl/gl/context.hpp # src/mbgl/gl/types.hpp # src/mbgl/gl/value.cpp # src/mbgl/gl/value.hpp # src/mbgl/map/backend_scope.cpp # src/mbgl/programs/attributes.hpp # src/mbgl/programs/program.hpp # src/mbgl/programs/segment.cpp # src/mbgl/programs/segment.hpp # src/mbgl/programs/symbol_program.hpp # src/mbgl/programs/uniforms.hpp # src/mbgl/renderer/buckets/symbol_bucket.hpp # src/mbgl/renderer/painter.cpp # src/mbgl/renderer/painter.hpp # src/mbgl/renderer/painter_background.cpp # src/mbgl/renderer/painter_circle.cpp # src/mbgl/renderer/painter_clipping.cpp # src/mbgl/renderer/painter_debug.cpp # src/mbgl/renderer/painter_fill.cpp # src/mbgl/renderer/painter_fill_extrusion.cpp # src/mbgl/renderer/painter_line.cpp # src/mbgl/renderer/painter_raster.cpp # src/mbgl/renderer/painter_symbol.cpp # src/mbgl/shaders/line.cpp # src/mbgl/shaders/line_pattern.cpp # test/renderer/backend_scope.test.cpp
* | [ios][macos] rendering interface changesIvo van Dongen2017-07-181-1/+2
| |
* | [all] Promote Style to public APIJohn Firebaugh2017-06-221-2/+3
|/
* [all] Push querySourceFeatures back out to MapJohn Firebaugh2017-05-021-1/+6
| | | | Once Source and RendererSource are split, Source will no longer have access to tiles.
* [darwin] Simplify MGLSource initialization and pointer managementJohn Firebaugh2017-04-131-59/+8
| | | | Introduce `-[MGLSource initWithPendingSource:]`, allowing the base class to track the owned `_pendingSource` pointer and implement `-addToMapView:` and `-removeFromMapView:` without any casts.
* [darwin] Remove unnecessary MGLTileSource initializersJohn Firebaugh2017-04-131-2/+2
|
* [macos, ios] query source featuresIvo van Dongen2017-03-091-0/+23
|
* [ios, macos] Make source removal consistent with layer removalJesse Bounds2017-02-231-3/+12
| | | | | | | | | | | | | | | This refactors the source removal methods to make them consistent with the way layers are removed. This makes removal of nonexistent sources and removal of sources of a different type but same identifier as a previously added source a no-ops. As with layers, the check at the top of the method to ensure that the raw pointer is the same as the one in mbgl for the same identifier string should make it impossible to attempt to remove a source of a different type than the one in mbgl for the same identifier. However, for consistency with the layer implementation, the reinterpret_cast has been replaced with a dynamic_cast and check for nullptr.
* [core, ios, macos] Return null when removing nonexistent sourceJesse Bounds2017-02-231-2/+4
|
* [core] remove trailing whitespace, add trailing newlines, add space after //Konstantin Käfer2017-01-271-1/+1
|
* Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.7Minh Nguyễn2017-01-161-0/+6
|\
| * [ios, macos] Fixed iosbench buildMinh Nguyễn2016-12-231-0/+1
| | | | | | | | Fixed a stale include in iosbench. MGLMapView(Private) forward-declares mbgl::Map instead of including mbgl.hpp, which iosbench has no access to.
| * [ios, macos] Added URL accessor to MGLTileSourceMinh Nguyễn2016-12-201-0/+5
|/
* [ios, macos] Simplify MGLSource and subclasses (#7377)Minh Nguyễn2016-12-131-49/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Audited source headers for nullability * [macos] Made MGLTileSet public * [ios, macos] Replaced MGLTileSet with MGLTileSource MGLRasterSource and MGLVectorSource now share a common abstract superclass, MGLTileSource. MGLTileSet has been removed. MGLTileSource is modeled after mbgl::style::RasterSource and mbgl::style::VectorSource. It has initializers that incorporate the parameters of MGLTileSet’s initializers, but it lacks getters for everything but the attribution string. MGLTileSet’s properties have been converted into options that can be passed into MGLTileSource’s initializers in a dictionary. Properly implement rawSource as a covariant property so that it doesn’t end up getting autosynthesized as a shadow ivar. This prevents concrete subclasses of MGLSource from setting _rawSource directly but getting a different value out of self.rawSource. Marked -[MGLSource init] as unavailable and ensured that concrete subclasses of MGLSource have the right set of initializers marked as designated initializers. Documentation comments for each concrete source class identify the corresponding source type in the style specification. Clarified the purpose of MGLTileSetScheme, now known as MGLTileCoordinateSystem. * [ios, macos] Clarified tile size interpretation Sticking to a default value of 256 for mapbox: URLs, but other URLs get the standard 512 value. * [ios, macos] rawSource is always set * [ios, macos] Cleaned up MGLShapeSource initialization rawSource is never nil, so there’s no need for a -commonInit method. Extracted -geoJSONOptions from MGLShapeSource into a standalone function for easier testing. * [ios, macos] Synchronized headers in project Realphabetized headers in groups. Added headers missing from one project or the other. * [ios, macos] Added MGLShape methods to (de)serialize GeoJSON data Added a class initializer and instance method to MGLShape that deserialize and serialize the shape as GeoJSON data, respectively. The new initializer handles parsing errors gracefully. Removed methods specific to GeoJSON data from MGLShapeSource, in an effort to reduce parallel state. Developers are now expected to go through the new MGLShape initializer to get an MGLShape representation. Alternatively, a local file URL can be passed into the other MGLShapeSource initializer. * [ios, macos] Typo in assertion message * [ios, macos] Simplified GeoJSON serialization Every MGLShape now knows its most specific mbgl::GeoJSON representation. * [ios, macos] Reremoved MGLFeaturePrivate mbgl::GeoJSON, which is a variant, allows a single GeoJSON representation method to traffic in whatever type is needed for a particular shape class. This change removes some hidden private protocols, which are a bug waiting to happen. * [ios, macos] Fixed covariant rawLayer property Properly implement rawLayer as a covariant property so that it doesn’t end up getting autosynthesized as a shadow ivar. This prevents concrete subclasses of MGLStyleLayer from setting _rawLayer directly but getting a different value out of self.rawLayer. * [ios, macos] Use MGLAttributionInfo for source attribution Made MGLAttributionInfo public. Replaced MGLTileSource’s attribution property with an attributionInfos property set to an array of MGLAttributionInfo objects. Added an MGLTileSourceOption for specifying an array of MGLAttributionInfo objects instead of an HTML string (either is acceptable when creating an MGLTileSource). * [ios, macos] Corrected method references in documentation
* [ios, macos] Source-driven attribution (#5999)Minh Nguyễn2016-12-081-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Source-driven attribution Refactored MGLSource initialization. Implemented a new private class, MGLAttributionInfo, that parses an HTML attribution string from TileJSON and stores the resulting structured data. Added methods to MGLTileSet and MGLStyle to aggregate MGLAttributionInfos. On macOS, update the attribution view as soon as the source attribution changes. On iOS, fetch the current attribution information when displaying the action sheet. Removed hard-coded attribution strings. * [macos] Respect inline formatting in attribution HTML Apply a default font and color to attribution HTML as it is imported into an attributed string. Pass the attributed string into MGLAttributionButton as is, without stripping formatting. Avoid overriding the font and color after importing the HTML, in case these attributes are explicitly specified rather than intrinsic to a hyperlink. Constrain the top of the attribution view to all the attribution buttons, in case one of them needs additional headspace. * [ios, macos] Display unlinked attribution strings Unlinked attribution strings are represented on macOS as buttons that have the default cursor and do nothing when clicked. On iOS, they are action sheet buttons that do nothing but dismiss the action sheet. * [macos] Fixed random Auto Layout exception Auto Layout randomly finds itself unable to satisfy constraints when updating attribution, due to some spurious constraints between attribution buttons. Regenerate the entire attribution view every time the source attribution changes. * [ios, macos] Thoroughly dedupe attribution infos Also added a test to verify parity with the GL JS implementation. This implementation avoids sorting. * [ios, macos] Trim whitespace from attribution strings Also added parsing tests. * [ios, macos] Added attribution parsing tests for styles Included an emoji test to ensure that attribution strings are interpreted as UTF-8, to avoid mojibake. Included a test of removing the underline from a leading copyright symbol. * [ios, macos] Derive feedback link from source MGLAttributionInfo now detects feedback links in the attribution HTML code, and it is responsible for tailoring the feedback URL to the current viewport. Removed the hard-coded feedback action from the attribution sheet on iOS in favor of a source-derived feedback title and URL. Moved the feedback action from macosapp to MGLMapView; applications are now expected to hook an Improve This Map menu item to an MGLMapView action.
* [ios, macos] Raise NSException if layer or source added more than onceJesse Bounds2016-12-021-0/+6
| | | | | | | | | | | | | | When MGLSource and MGLLayer instances are added to the style, they lose ownership of their std::unique_ptr<T> after it is moved to the mbgl level. Subsequent attempts to add such instances result in a C++ exception. This adds logic in the Darwin platform to raise a NSException if the source and layer addToMapView methods are called more than once and the pointer is invalid. In addition, the documentation in MGLStyle for addSource: and addLayer: has been update to warn developers to avoid adding the same instance twice and, for that matter, instances with the same identifier.
* [core, ios, macos] Added layers and sources properties to MGLStyleMinh Nguyễn2016-11-281-2/+0
| | | | | | | | Added new layers and sources properties to MGLStyle that contain all the style’s layers and sources, respectively. These properties are KVC-compliant with all the mutable to-many methods. Layers are ordered from topmost to bottommost, for consistency with Cocoa APIs where front/first means top and back/last means bottom. Also added storage for mbgl::style::Source in MGLSource proper for wrapping AnnotationSource. Until the style finishes loading, its name property is set to nil. Fixes #6003.
* [ios, macos] Added debug descriptions for runtime styling classesMinh Nguyễn2016-11-231-0/+6
|
* [ios, macos] Take back source and layer ownership on removal (#7048)Jesse Bounds2016-11-141-0/+8
| | | | | If a source or layer is removed from the style, recapture the unique pointer ownership. This makes it safe to add back sources and layers after they have been removed.
* [ios, macos] Make source ownership consistent and GeoJSON content properties ↵Jesse Bounds2016-10-261-2/+20
| | | | | | | | | | | | | | | | | | | writable Use common initialization logic to create an unique pointer to an mbgl source object, up front, when a MGL source is created. Keep a raw pointer to the unique pointer that is pointed at the mbgl source instance when a MGL source is created or when a MGL source is obtained by identifier from MGLStyle. Once the transfer of ownership of the mbgl source takes place, the unique ptr is null. The raw pointer can be used internally for future work that involves mutating the source. This also changes the URL, features, and geoJSONData content properties for MGLGeoJSON source to be writable. If they are set with valid data after a source has been added to the map then the map will update to reflect the new data.
* [ios, macos] Revamped MGLStyleLayer, MGLSource inheritanceMinh Nguyễn2016-10-061-6/+6
| | | | | | | | | | 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.
* [ios, macos] Add tile template option to raster and vector sourcesJesse Bounds2016-09-221-3/+28
| | | A new MGLTileSet class that wraps all available core Tileset options can be created and passed into the sources. The sources pass that tileset object along to core.
* [ios, macos] Use NSDictionary for geojson source options.Jesse Bounds2016-09-021-1/+1
| | | | | | | | | | | | This removes a previous implementation of geojson options that used a new type to transfer the data around. Added in its place is an options API that takes an NSDictionary that works similarly to NSAttributedString and many other Cocoa APIs that take options. The options parser now expects the developer to send values of the type noted in the documentation and it simply converts the NSNumber to the correct type (integer, double, or bool) for mbgl. However, an exception is raised if the value is not an NSNumber.
* [ios, macos] fixes #5974 Move style classes API to MGLStyleFredrik Karlsson2016-08-181-2/+2
|
* [ios, macos] Fixes #5975 Add source getter to MGLStyleFredrik Karlsson2016-08-181-0/+24