summaryrefslogtreecommitdiff
path: root/platform/darwin
Commit message (Collapse)AuthorAgeFilesLines
* [macOS] use SourceKit to ensure that all public symbols are exportedKonstantin Käfer2017-01-041-0/+83
|
* [build] add -fvisibility=hidden to macOS dynamic framework and export ↵Konstantin Käfer2017-01-0443-33/+153
| | | | required symbols
* [core, ios] replace `altitude` with `fov`Ansis Brammanis2016-12-213-4/+4
| | | | | | | | | ported from -js: eb6c6596c6a7a61363d30356674e0002153b1d19 `altitude` was a terribly-named variable that was used to indirectly control the fov. This should eliminate some confusion. `altitude` was equivalent to `cameraToCenterDistance / height`
* Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.5-masterMinh Nguyễn2016-12-20107-1789/+3914
|\ | | | | | | Also reran make style-code and manually discarded anything related to fill extrusion layers.
| * [ios, macos] Document when it's safe to call runtime styling functions (#7335)Eric Wolfe2016-12-181-7/+17
| | | | | | | | | | | | * Add notes to wait for map to finish loading before adding sources or layers * Move style loading notes to class documentation
| * [ios, macos] Highlight current topic in documentation (#7468)Minh Nguyễn2016-12-163-2/+16
| | | | | | | | | | | | * [ios, macos] Highlight current topic in docs * highlight style
| * iOS jazzy theme improvements (#7422)Maya Gao2016-12-1612-140/+274
| | | | | | some small improvements to the theme
| * Use appropriate part of speech for properties (#7457)Minh Nguyễn2016-12-1626-235/+743
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [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] Corrected return type of MGLShape factory methodMinh Nguyễn2016-12-162-2/+2
| |
| * [ios, macos] Streamlined a string formatMinh Nguyễn2016-12-131-1/+1
| |
| * [ios, macos] Simplify MGLSource and subclasses (#7377)Minh Nguyễn2016-12-1348-994/+1337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [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] handle duplicate layer errorIvo van Dongen2016-12-132-7/+49
| |
| * [ios, macos] Override references to property names in property requirements ↵Minh Nguyễn2016-12-124-26/+50
| | | | | | | | | | | | | | | | | | | | 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
| * [ios, macos] Load features into shape source if possible (#7339)Jesse Bounds2016-12-124-11/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This checks the kind of MGLShape passed into the source and, if it is a feature, it mbgl feature objects to pass to core. This keeps the feature id and attributes data intact. If the shape is a `MGLShapeCollectionFeature` it creates an `mbgl::FeatureCollection` object (also to keep feature properties). If the shape is not any sort of feature, it passes along just the geometry. This also uses the MGLFeatureFromMBGLFeature converter for the case where GeoJSON data passed in to a source contains a single feature. The converter has logic to keep the id and attributes properties intact. Before, these properties were lost because only geometry conversion was done. Finally, logic to handle (and associated tests) of nested shape collection features is removed since that is not supported by the GeoJSON spec or the core implementation. [ios] Add test of drawing plain shape to iosapp
| * [ios, macos] Expanded source documentationMinh Nguyễn2016-12-107-32/+62
| | | | | | | | Also fixed a few stray references to GeoJSON sources.
| * [ios, macos] Rename MGLGeoJSONSource to MGLShapeSource (#7334)Jesse Bounds2016-12-0917-103/+104
| |
| * [ios, macos] Silence -Wc++11-narrowing warning in open gl layer (#7355)Jesse Bounds2016-12-091-2/+2
| |
| * [ios, macos] Source-driven attribution (#5999)Minh Nguyễn2016-12-0818-48/+549
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [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] renamed raster-hue-rotateFredrik Karlsson2016-12-084-9/+12
| |
| * [ios, macos] Warn about special characters in predicates (#7317)Jesse Bounds2016-12-071-0/+6
| |
| * [ios, macos] Fix typo in exception name for style source identifier (#7315)Jesse Bounds2016-12-073-3/+3
| |
| * Prevent stopless functions (#7309)Fredrik Karlsson2016-12-075-2/+26
| | | | | | | | | | | | * [ios, macos] prevent stopless functions * [ios, macos] removed unused bridging header and fixed naming
| * [ios, macos] fixed compiler warningsFredrik Karlsson2016-12-071-2/+2
| |
| * [ios, macos] Corrected -setNeedsDisplay documentationMinh Nguyễn2016-12-071-1/+1
| | | | | | | | Followup to #7250.
| * [ios, macos] Migrate MGLCustomStyleLayerAdditions to style layer API (#7250)Minh Nguyễn2016-12-0713-60/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Replaced custom style layer API with MGLOpenGLStyleLayer Replaced the custom style layer API on MGLMapView with an equally unsupported MGLOpenGLStyleLayer API that nonetheless is consistent with the broader runtime styling API and is compatible with macOS. Fixed an unrecognized selector crash when wrapping a layer of unrecognized type coming from mbgl. * [macos] Added lime green layer demo to macosapp Reprised the demo removed from iosapp in #5091. * [ios, macos] Rationalized MGLOpenGLStyleLayer API MGLStyle now strongly references any MGLOpenGLStyleLayer object that’s added to it, in order to prevent pointers from going stale and make it easy for layer drawing code to get more information about the map view. Replaced the MGLOpenGLStyleLayer callback blocks with overridable instance methods. Added internal documentation for each method. Subclassed MGLOpenGLStyleLayer as LimeGreenStyleLayer inside macosapp. Consolidated -addToMapView: into -addToMapView:belowLayer: to ensure that MGLRedundantLayerException gets raised even if the layer is being inserted rather than added to the bottom of the stack. * [core] Clarified that rendering happens on the main thread * [ios, macos] Fixed removing and re-adding MGLOpenGLStyleLayer Don’t allow index-based layer removal to circumvent -removeFromMapView:, which MGLOpenGLStyleLayer relies on to synchronize the style’s array of MGLOpenGLStyleLayers. When obtaining an MGLOpenGLStyleLayer, get the instance already added to the style instead of creating a new one to wrap the underlying CustomLayer.
| * [ios, macos] More ways to reshape an MGLMultiPoint (#7251)Minh Nguyễn2016-12-067-83/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Completed API for mutating multipoints Added the complete set of methods for mutating the vertices of an MGLMultiPoint. Also rewrote MGLMultiPoint documentation to refer to vertices instead of points. * [ios, macos] Removed inaccurate MGLOverlay commentary This paragraph is full of references to features that exist in MKOverlay but not MGLOverlay. * [ios, macos] Lazily compute multipoint bounds Invalidate the bounds whenever the coordinates change, but don’t recompute the bounds until they’re requested. Simplified -intersectsOverlayBounds: for immutable overlay classes. Added a utility function for testing whether two MGLCoordinateBounds intersect, based on mbgl::LatLngBounds::intersects(). Removed unused color conversion code.
| * [ios, macos] Note corresponding style spec propertiesMinh Nguyễn2016-12-064-0/+18
| | | | | | | | 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-068-18/+22
| |
| * [ios, macos] MGLGeoJSONSource can now be initialized with any shapeFredrik Karlsson2016-12-0613-113/+176
| |
| * [core, ios, macos] Add image accessor to MGLStyle (#7096)Roman Blum2016-12-058-3/+96
| | | | | | | | | | | | | | | | | | | | | | | | * [core] Add interface to get image from sprite atlas * [tests] Add tests for Map::getImage * [ios, macos] WIP: get MGLImage for name from style * [ios, macos] Fixed -imageForName: Convert from sprite images to platform images using the existing encodePNG() function, which is also used for printing. Allow -imageForName: to return nil without an assertion failure. Added a basic test.
* | [ios, macos] handle duplicate layer errorIvo van Dongen2016-12-122-7/+58
| |
* | Simplified Chinese localization (#7316)YunjieLi2016-12-091-0/+291
| | | | | | | | | | | | | | | | | | | | * translated into Chinese * light edits to translations * update two changelogs; remove .stringsdict files * remove update from macos changelog
* | [darwin, android] SDK bindings for circle-stroke propertiesJohn Firebaugh2016-12-094-1/+87
| |
* | Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.4-masterMinh Nguyễn2016-12-0360-1208/+3285
|\ \ | |/
| * [ios, macos] Update MGLStyle API documentation with warnings for dupesJesse Bounds2016-12-021-12/+18
| | | | | | | | | | This adds notes to the methods for adding sources and layers to warn of the hazards of using duplicate instances or identifiers.
| * [ios, macos] Consolidate tests of MGLStyle addSource in MGLStyleTestsJesse Bounds2016-12-022-24/+38
| | | | | | | | | | | | | | | | | | This replaces the integration test of `addSource` when duplicate identifiers are used in `MGLSourceTests` with a more direct unit test in the style class's unit test file `MGLStyleTests`. Although tests of the case where the same instance are actually integration tests where the source instance itself throws, it is easier to test all of this functionality in one place using the public facing MGLStyle API.
| * [ios, macos] Raise NSException if layer or source added more than onceJesse Bounds2016-12-0212-1/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * [ios, macos] Rename MGLMapViewTests back to MGLStyleLayerTestsJesse Bounds2016-12-0211-20/+20
| |
| * [ios, macos] handle duplicate source errorIvo van Dongen2016-12-021-1/+6
| |
| * [ios, macos] renamed MGLStyleLayerTests to MGLMapViewTestsIvo van Dongen2016-12-0211-22/+22
| |
| * [ios, macos] Update style predicate documentationJesse Bounds2016-12-011-2/+5
| | | | | | | | | | Note the support of CONTAINS and the lack of support for case and diacritic operator modifiers.
| * [ios, macos] Add back support for CONTAINS operatorJesse Bounds2016-12-012-1/+18
| | | | | | | | This reverts commit 6877e3efe73fb6e103c2635f1e4b1c1866b17d5c.
| * [ios, macos] Avoid unsafe cast when removing style layers (#7227)Jesse Bounds2016-11-309-11/+507
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the code generation for style layers to add a test to check that the style object returned from mbgl can be safely cast into the expected type so ownership can be returned to the caller when removing layers. This scenario was previously possible if a layer of type T was added before a layer of type U but both layers shared the same identifier. In that case, if the pointer to the second layer of type U was used to remove a layer, a runtime exception would occur since mbgl returns the layer with type T (the first one added). Now, an exception will still occur if layers with the same identifier are manipulated as described above but it is done as part of a validation check for all public style layer methods at the Darwin platform level. The NSException attempts to warn developers about using and reusing style identifiers to avoid this issue in the first place.
| * [ios, macos] Add notes to APIs that rely on style and source ids (#6886)Jesse Bounds2016-11-301-0/+64
| | | | | | Update documentation to make the implications of identifiers clearer.
| * [ios, macos] rename style spec propertiesFredrik Karlsson2016-11-3023-907/+929
| |
| * [ios, macos] Marked C array parameters as constMinh Nguyễn2016-11-2910-17/+17
| | | | | | | | Fixes #7214.
| * [ios, macos] Fixed spurious offline storage test failureMinh Nguyễn2016-11-291-0/+1
| | | | | | | | Even if the expectation is immediately fulfilled, we still have to wait for it to be fulfilled, because the expectation only gets unregistered after waiting. The zombie expectation was fulfilling a stricter expectation in a test method.
| * [ios, macos] Key-value compliance for MGLStyleMinh Nguyễn2016-11-282-9/+24
| | | | | | | | | | | | Replaced -[MGLMapView style] with a property. Keep the MGLStyle object around for the lifetime of the style. Bracket changes to layers in willChange and didChange calls. The built-in point annotation layer is added after the style is finished loading but before the map is finished loading. Cause a second wave of change notifications to go out, about both sources and layers. Issue change notifications for style layers when shape annotations are added or removed.
| * [core, ios, macos] Added layers and sources properties to MGLStyleMinh Nguyễn2016-11-2811-19/+259
| | | | | | | | | | | | | | | | 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] Reorganized MGLStyleMinh Nguyễn2016-11-232-77/+95
| |