| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
All `MGLSource` pointers referencing the same logical source will now be object identical; similarly for `MGLStyleLayer`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts a previous change that recreated the pending and raw
layer pointers if an identifier match caused a layer to be removed
but the removed layer was of a different type than the layer triggering
the removal
This refactors the pointer replacement to use a simpler solution that
returns early if the layer does not have a raw pointer loaded in the
mbgl map instance.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Removed UIViewController from MGLStyleLayerTests on iOS, because we aren’t really testing integration at that level. Switched to delegate-based expectation fulfillment for both MGLStyleLayerTests and MGLStyleTests, conditionalized on whether the style has already loaded, to avoid race conditions that bleed into other tests.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [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] 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, 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
|
| |
|
|
|
|
| |
Also fixed a few stray references to GeoJSON sources.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Reformatted documentation comments in public headers in the OS X SDK and public headers shared between the iOS and OS X SDKs to wrap at column 80 and avoid excessive indentation that causes SourceKitten to detect code blocks.
|
|
|
|
|
|
| |
Renamed MGLStyleCurrentVersion to MGLStyleDefaultVersion to emphasize the constant’s role as an indicator of the default version used by SDK classes, which may be behind depending on release schedules. In the documentation for each style URL method, include the actual version number instead of the constant. In unit tests, verify that this documentation is in sync with the constant.
Link each style URL method’s documentation to a forthcoming webpage on mapbox.com that describes the style in rich detail.
|
|
|
|
| |
The style ID has also changed, but the unversioned method will continue to point to the old v8 style ID.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Updated default styles from v8 to v9. Deprecated the MGLMapView class methods in favor of new methods that take a version parameter. Deprecated Emerald outright in favor of Outdoors. Replaced usage of the unversioned MGLStyle methods with the corresponding versioned methods and MGLStyleCurrentVersion to ensure consistency.
Expanded MGLStyle unit tests to also assert that MGLStyle has the right number of style URL methods and that they’re all public. Linked the OS X SDK unit test bundle to libmbgl-core.a. Removed an unnecessary dependency on osxapp.
Replaced Emerald with Outdoors in iosapp and osxapp.
Fixes the iOS and OS X side of #4577 and #4702.
|
|
|
|
| |
Now that #4641 has removed the prohibition against C99 extensions, this change removes many pragma statements that suppress warnings about variadic macros and designated initializers. Designated initializers and Elvis operators have been introduced wherever appropriate.
|
|
The iOS and OS X SDKs now share a non-UI test bundle. Moved the iOS UI test bundle into a uitest/ subdirectory and moved the OS X SDK tests into the darwin/ subdirectory.
Upgraded KIF to v3.4.2.
|