summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorTobrun <tobrun@mapbox.com>2017-06-02 23:41:14 +0200
committerGitHub <noreply@github.com>2017-06-02 23:41:14 +0200
commit2d039d3c6b0f62a7545563f7ef4e966aed8ba410 (patch)
tree353d2106c561c3329886691334a953d4b450840d /platform/ios
parente82649139b69a4794b944b4a61822dd82a4d6abc (diff)
downloadqtlocation-mapboxgl-2d039d3c6b0f62a7545563f7ef4e966aed8ba410.tar.gz
Merge release-ios-v3.6.0-android-v5.1.0 to master (#9170)
* [android] Update release script to support CircleCI builds (#8950) * update release script to trigger builds on circleci now * update release script to trigger builds on circleci now * [core] When a layer is added, reload its source's tiles * [android] - keep observer when timeout occurs, make observer param nullable, fixup log messages (#8919) * [android] - avoid crashing when deleting already deleted region (#8920) * [android] - update LOST to 2.3.0 (#8872) * [android] - update proguard config, allow debug mimification, update OkHttp to latest version (#8944) * [core, android, ios, macos, qt] v10 default styles Upgraded from v9 default styles to v10 wherever the developer expects to get the latest and greatest, as well as in a couple tests where it may be beneficial to ensure that we can handle a two-digit version number in the style URL. Cherry-picked from ed54849e9909e7f7cd8724b39b2bc94f16cf9a11. * [ios, macos] Updated documented default style version MGLStyleDefaultVersion is just for Streets now. Deleted style version documentation tests because not all styles are on the same version. Cherry-picked from ca97dd8cf4c70a5ed380c99700749fd3239715f0. * [ios, macos] Undeprecated unversioned style URL factory methods Undeprecated the unversioned style URL factory methods in MGLStyle for consistency with the Android and Qt SDKs. Added warnings about using them with the runtime styling API. Refactored mbgl::util::default_styles to track different versions for different styles. Cherry-picked from 9e384b78fbcf46d66d390122eefdf273f91b314e. * [core, android, ios, macos] Added Traffic Day/Night to default styles The Styles API section of the Mapbox API Documentation site now lists Traffic Day v2 and Traffic Night v2, so this change adds those styles to all the places where styles are listed. Also switched iosapp and macosapp to unversioned style factory methods since MGLStyleDefaultVersion is no longer applicable for all styles. Cherry-picked from 4d6f54553d277c0af24a0b8ff03d2dd7e9284ca2. * [android] Release android-v5.1.0-beta.2 (#8976) * [android] url getter on sources * [android] fix ui test filter in makefile * [android] - build SNAPSHOT from release branch (#8958) * [android] - update changelog for 5.1.0-beta.2 * [android] - bump version number * [android] - Camera change listener v2.0 * [core] allow filesource url transform reset * [android] Update attribution wordmark (#8774) * Update wordmark on android * Moved attribution i icon to the right of mapbox word (in mapview preview image) * update padding and margin * [android] update hardcoded branch name * revert version to 5.1.0-SNAPSHOT * [android] - MarkerView deselect events with OnMarkerViewClickListener integration (#8996) * [android] - publish SNAPSHOT from release 5.1.0 branch (#8995) * [ios, macos] edited identity interpolation mode documentation (#8657) * [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. * [ios] Telemetry button in modal view controllers (#9027) Fixes #8980. * [android] - bump tools and support lib version due to SNAPSHOT dependencies (#9046) * [android] - bump tools and support lib version for SNAPSHOT dependencies * revert unsupported Circle CI build tools version * [core] Make destructor virtual to avoid object splicing during destruction * [core] add error for non-virtual destructor deletes + add virtual dtors * [android] - remove marker from selected markers when removing marker from annotation manager. (#9047) * Observe layout guides (#7716) * [ios] observe layout guides * [ios] update changelog * [ios, macos] Change == to = in style function initializers * [ios] Add annotation view initializer with annotation and reuse id (#9029) * [ios] Remove annotation view from container view when annotation removed (#9025) The annotation container view keeps an array of annotation views that is separate from the array of subviews that is a property of the UIView parent class. This removes an annotation view from that container view array when the associated annotation is removed. This avoids issue related to previously removed annotation views continuing to be involved in map view logic around annotation view selection due to taps. * [android] - correct bearing conversion when animating the map with jumpTo, easeTo and animateTo. (#9050) * [ios, macos] Updated `maximumZoomLevel` description, cherry-picked #8818 (#8842) Cherry-picked from a3e4e67ea68c455178d5c5ef3d864972fcf41147. * [ios] Updated podspecs and changelog for v3.5.3 (#8870) Cherry-picked from 25c19902a22e240da4e7ebf1974125b7e67bd21e. * [ios] Update podspecs and changelog for iOS v3.5.4 Cherry-picked from db7bb509e95d737199efa73a47bdcc973966ed97. * [ios, macos] Updated changelogs * [ios, macos] changed TRUE -> 'true' (#9059) fixes #9056 * [ios, macos] Light property implementation in MGLStyle (#9043) * [ios, macos] Add MGLLight to MGLStyle * [ios, macos] Implement Objc bindings for Light object * [ios, macos] Remove rawLight from MGLLight and re-implement it as value class * [ios, macos] Fix build on macos * [ios, macos] Add MGLLight documentation, Move MGLLightPosition to MGLLight * [ios, macos] Add MGLLight tests. * [ios, macos] Update changelogs * [ios, macos] Fix misspelling * [ios, macos] Fix MGLLightAnchor enum property names * [ios, macos] Update documentation. Improve varialble naming. * [ios, macos] Rename MGLLightPosition to MGLSphericalPosition * [ios, macos] Update data types of MGLSphericalPosition * [android] - horizontally rotated in snapshot (#9083) * Cherry-pick arabic text to release branch v3.6.0 (#9071) * [core] Throttle tiles to redo symbol placement at most once every 300ms. Fixes issue #8435 and prepares for pitch-scaling changes in issue #8967. * [core] Disable letter-spacing for Arabic labels (issue #9057) * [ios,macos] multipolygon coordinate (#8713) * [ios] MGLMultiPolygon's coordinate property implemented * [ios,macos] Add polylabalel to project config * [ios,macos] Change coordinate property for MGLPolyline,MGLPolygon,MGLMultiPolygon * [macos] Change project configuration to support polilabel * [ios,macos] Add MGLLocationCoordinate2DFromPoint * [ios, macos] Update changelogs * [ios, macos] remove unnecesary variables * [ios, macos] Add radians conversions * [ios, macos] Add coordinate calc to MGLPolyline * [ios, macos] Move radian fuctions to MGLGeometry_Private.h * [ios, macos] Fix code style * [ios, macos] Fix code indentation * [ios, macos] Fix radian per meters constant * [ios, macos] Add test scenarios to testPolyline * [ios, macos] Fix test accuracy * [ios, macos] More robust Streets localization Added Arabic, Portuguese, and Simplified Chinese to the list of languages with specialized fields in the Mapbox Streets source. Rely on NSBundle to select the most appropriate locale based on the user’s preferred languages. * [ios] Fallback to Mapbox.bundle as the framework bundle (#9074) Fixes an issue where localizations could not be found when using static builds. Throws exception if our bundle can't be found. * [ios] Move image resources to an asset catalog & switch to PDFs * [ios, macos] Updated changelogs Reorganized the changelogs with a new packaging section. Added blurbs about #9062, #8713, #9060, and #9031. * [ios] Update pods spec for iOS v3.6.0-beta.1 * [macos] Enable View ‣ Traffic Night Enable the View ‣ Traffic Night menu item and check it when that style is active. * [android] - stop location updates when toggle MyLocationView state (#9099) * [android] - LatLngBounds bearing default value (#9102) * [ios, macos] Fix MGLLight.achor to accept style functions * [ios] Fix annotation initializers for subclasses of MGLAnnotationView (#9104) Use a common init function in both of the provided initializers so that subclasses of `MGLAnnotationView` written in Swift don't need to override `init(annotation, reuseIdentifier)` * [ios] Moved `MGLLight` in jazzy table of contents (#9111) * [android] - logo placement for creating a Mapview programatically (#9094) * [android] - Correct logo placement for creating a Mapview programatically, fixup non default placements * Fixed NIGHTY_TWO_DP typo to NINETY_TWO_DP * [android] - add binding support for Light (#9013) * [android] Update Lost to final version 3.0.0 (#9112) * update lost to final version 3.0.0 * bump MAS version to 2.1.1 * [android] - convert dp to pixels when getting meters per pixel at. (#9048) * Release Android v5.1.0-beta.3 (#9115) * [android] - Changelog update for Android release v5.1.0-beta.3 * update CI & version * reset release properties * [android] - harden orientation changes (#9128) * [ios] Remove filter of single metric event * [ios] remove layout guide observers * Migrate to GL JS–powered feedback form (#9078) * [ios, macos] Updated feedback URL * [ios, macos] Add referrer, heading, pitch to feedback URL * [ios, macos] Updated changelogs for feedback changes * [ios] Vary referrer by platform * [android] - javadoc update for 5.1.0 release (#9138) * [android] - javadoc update for 5.1.0 release * oxford comma * Grammar/spelling tweaks * grammar tweak * grammar tweak * Grammar tweaks * Grammar tweaks * [android] fix missing access token variable issue (#9151) * [ios] Update pods spec for iOS v3.6.0-beta.2 * [android] Cherry picking 9133 (#9145) * [android] Fix tracking mode + camera race condition (#9133) * [android] fix tracking mode + camera race condition * fix resetTrackingModesIfRequired bug (comparing current camera position with target camera position * cherry pick #9133 and update CHANGELOG * add null check to prevent null pointer exception * add null check in custom location engine activity to prevent null pointer exception (#9159) * [core] Make TransformState LatLngBounds optional * [ios] Make annotation view rotation alignment configurable (#9147) This commit adds `rotatesWithMap` property on `MGLAnnotationView`. This property, when set to `YES` fixes the annotation to a map such that view follows map's rotation angle. This is useful when user wants to display rotation-dependent annotations (e.g. sector lights). * [android] - validate if gestures should execute (#9173)
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/CHANGELOG.md22
-rw-r--r--platform/ios/Mapbox-iOS-SDK-symbols.podspec2
-rw-r--r--platform/ios/Mapbox-iOS-SDK.podspec2
-rw-r--r--platform/ios/app/MBXViewController.m21
-rw-r--r--platform/ios/docs/guides/Tile URL Templates.md99
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj116
-rw-r--r--platform/ios/jazzy.yml2
-rw-r--r--platform/ios/originals/compass.sketchbin0 -> 4881 bytes
-rw-r--r--platform/ios/resources/Compass.pngbin1139 -> 0 bytes
-rw-r--r--platform/ios/resources/Compass@2x.pngbin1892 -> 0 bytes
-rw-r--r--platform/ios/resources/Compass@3x.pngbin3398 -> 0 bytes
-rw-r--r--platform/ios/resources/Images.xcassets/Compass.imageset/Contents.json12
-rw-r--r--platform/ios/resources/Images.xcassets/Compass.imageset/compass.pdfbin0 -> 4574 bytes
-rw-r--r--platform/ios/resources/Images.xcassets/Contents.json6
-rw-r--r--platform/ios/resources/Images.xcassets/default_marker.imageset/Contents.json12
-rw-r--r--platform/ios/resources/Images.xcassets/default_marker.imageset/default_marker.pdfbin0 -> 2601 bytes
-rw-r--r--platform/ios/resources/Images.xcassets/mapbox.imageset/Contents.json12
-rw-r--r--platform/ios/resources/Images.xcassets/mapbox.imageset/mapbox.pdfbin0 -> 8823 bytes
-rw-r--r--platform/ios/resources/default_marker.pngbin1010 -> 0 bytes
-rw-r--r--platform/ios/resources/default_marker@2x.pngbin1995 -> 0 bytes
-rw-r--r--platform/ios/resources/default_marker@3x.pngbin2998 -> 0 bytes
-rw-r--r--platform/ios/resources/mapbox.pngbin2347 -> 0 bytes
-rw-r--r--platform/ios/resources/mapbox@2x.pngbin5290 -> 0 bytes
-rw-r--r--platform/ios/resources/mapbox@3x.pngbin8245 -> 0 bytes
-rw-r--r--platform/ios/src/MGLAPIClient.m2
-rw-r--r--platform/ios/src/MGLAnnotationView.h43
-rw-r--r--platform/ios/src/MGLAnnotationView.mm57
-rw-r--r--platform/ios/src/MGLMapView.mm253
-rw-r--r--platform/ios/src/MGLMapboxEvents.m7
-rw-r--r--platform/ios/src/MGLScaleBar.mm6
-rw-r--r--platform/ios/src/Mapbox.h1
-rw-r--r--platform/ios/test/MGLAnnotationViewIntegrationTests.swift23
-rw-r--r--platform/ios/test/MGLAnnotationViewTests.m23
33 files changed, 490 insertions, 231 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index ceb371118d..977dd1b418 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -2,7 +2,13 @@
Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started.
-## master
+## 3.6.0
+
+### Packaging
+
+* Xcode 8.0 or higher is now recommended for using this SDK. ([#8775](https://github.com/mapbox/mapbox-gl-native/pull/8775))
+* Fixed an issue in the static framework where localizations would never load. ([#9074](https://github.com/mapbox/mapbox-gl-native/pull/9074))
+* Updated MGLMapView’s logo view to display [the new Mapbox logo](https://www.mapbox.com/blog/new-mapbox-logo/). ([#8771](https://github.com/mapbox/mapbox-gl-native/pull/8771), [#8773](https://github.com/mapbox/mapbox-gl-native/pull/8773))
* The previously-deprecated support for style classes has been removed. For interface compatibility, the API methods remain, but they are now non-functional.
* Added an `overlays` property to `MGLMapView`. ([#8617](https://github.com/mapbox/mapbox-gl-native/pull/8617))
@@ -16,26 +22,36 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Added class methods to MGLStyle that correspond to the new [Traffic Day and Traffic Night](https://www.mapbox.com/blog/live-traffic-maps/) styles. ([#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301))
* MGLSymbolStyleLayer’s `iconImageName`, `iconScale`, `textFontSize`, `textOffset`, and `textRotation` properties can now be set to a source or composite function. ([#8544](https://github.com/mapbox/mapbox-gl-native/pull/8544), [#8590](https://github.com/mapbox/mapbox-gl-native/pull/8590), [#8592](https://github.com/mapbox/mapbox-gl-native/pull/8592), [#8593](https://github.com/mapbox/mapbox-gl-native/pull/8593))
* Fixed an issue where setting the `MGLVectorStyleLayer.predicate` property failed to take effect if the relevant source was not in use by a visible layer at the time. ([#8653](https://github.com/mapbox/mapbox-gl-native/pull/8653))
+* Fixed an issue preventing programmatically added style layers from appearing in already cached tiles. ([#8954](https://github.com/mapbox/mapbox-gl-native/pull/8954))
* Fixed an issue causing a composite function’s highest zoom level stop to be misinterpreted. ([#8613](https://github.com/mapbox/mapbox-gl-native/pull/8613), [#8790](https://github.com/mapbox/mapbox-gl-native/pull/8790))
* Fixed an issue where re-adding a layer that had been previously removed from a style would reset its paint properties. Moved initializers for `MGLTileSource`, `MGLStyleLayer`, and `MGLForegroundStyleLayer` to their concrete subclasses; because these classes were already intended for initialization only via concrete subclasses, this should have no developer impact. ([#8626](https://github.com/mapbox/mapbox-gl-native/pull/8626))
* Feature querying results now account for any changes to a feature’s size caused by a source or composite style function. ([#8665](https://github.com/mapbox/mapbox-gl-native/pull/8665))
+* Letter spacing is now disabled in Arabic text so that ligatures are drawn correctly. ([#9062](https://github.com/mapbox/mapbox-gl-native/pull/9062))
### Annotations
+* Added a new initializer to `MGLAnnotationView` so that it is possible to create a new instance with an associated annotation object. ([#9029](https://github.com/mapbox/mapbox-gl-native/pull/9029))
+* Added a new `rotatesToMatchCamera` property to `MGLAnnotationView` that, when set to true, causes the annotation view to rotate along with the map's rotation angle giving the appearance that the annoation view is pinned to the map. ([#9147](https://github.com/mapbox/mapbox-gl-native/pull/9147))
* Fixed an issue causing a view-backed annotation to disappear immediately instead of animating when the annotation’s `coordinate` property is set to a value outside the current viewport. ([#8565](https://github.com/mapbox/mapbox-gl-native/pull/8565))
* Fixed an issue in which `MGLMapView` overrode the tint colors of its annotation views. ([#8789](https://github.com/mapbox/mapbox-gl-native/pull/8789))
+* Fixed an issue causing annotation views to persist in the map’s annotation container view even after their associated annotations were removed. ([#9025](https://github.com/mapbox/mapbox-gl-native/pull/9025))
+* The `MGLPolyline.coordinate` and `MGLPolygon.coordinate` properties now return the midpoint and centroid, respectively, instead of the first coordinate. ([#8713](https://github.com/mapbox/mapbox-gl-native/pull/8713))
### User interaction
* Added a scale bar to `MGLMapView` that indicates the scale of the map. ([#7631](https://github.com/mapbox/mapbox-gl-native/pull/7631))
* Fixed an issue where gesture recognizers associated with map view interactivity were not disabled when their related interactions were disabled. ([#8304](https://github.com/mapbox/mapbox-gl-native/pull/8304))
+* Fixed an issue preventing the Mapbox Telemetry confirmation dialog from appearing when opened from within a map view in a modal view controller. ([#9027](https://github.com/mapbox/mapbox-gl-native/pull/9027))
+* Corrected the size of MGLMapView’s compass. ([#9060](https://github.com/mapbox/mapbox-gl-native/pull/9060))
+* The Improve This Map button in the attribution action sheet now leads to a feedback tool that matches MGLMapView’s rotation and pitch. `-[MGLAttributionInfo feedbackURLAtCenterCoordinate:zoomLevel:]` no longer respects the feedback URL specified in TileJSON. ([#9078](https://github.com/mapbox/mapbox-gl-native/pull/9078))
### Other changes
-* Xcode 8.0 or higher is now recommended for using this SDK. ([#8775](https://github.com/mapbox/mapbox-gl-native/pull/8775))
-* Updated MGLMapView’s logo view to display [the new Mapbox logo](https://www.mapbox.com/blog/new-mapbox-logo/). ([#8771](https://github.com/mapbox/mapbox-gl-native/pull/8771), [#8773](https://github.com/mapbox/mapbox-gl-native/pull/8773))
+* Fixed a crash that occurred when accessing the `MGLMultiPolygon.coordinate` property. ([#8713](https://github.com/mapbox/mapbox-gl-native/pull/8713))
* Fixed a crash or console spew when MGLMapView is initialized with a frame smaller than 64 points wide by 64 points tall. ([#8562](https://github.com/mapbox/mapbox-gl-native/pull/8562))
+* Fixed an issue that caused the compass and scale bar to underlap navigation and tab bars. ([#7716](https://github.com/mapbox/mapbox-gl-native/pull/7716))
* The error passed into `-[MGLMapViewDelegate mapViewDidFailLoadingMap:withError:]` now includes a more specific description and failure reason. ([#8418](https://github.com/mapbox/mapbox-gl-native/pull/8418))
+* Improved CPU and battery performance while animating a tilted map’s camera in an area with many labels. ([#9031](https://github.com/mapbox/mapbox-gl-native/pull/9031))
* Fixed an issue rendering polylines that contain duplicate vertices. ([#8808](https://github.com/mapbox/mapbox-gl-native/pull/8808))
## 3.5.4 - May 9, 2017
diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec
index f8b20777fa..3116ede9f5 100644
--- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec
+++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
- version = '3.6.0-alpha.1'
+ version = '3.6.0-beta.2'
m.name = 'Mapbox-iOS-SDK-symbols'
m.version = "#{version}-symbols"
diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec
index 15658e6241..f6bc3030ab 100644
--- a/platform/ios/Mapbox-iOS-SDK.podspec
+++ b/platform/ios/Mapbox-iOS-SDK.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |m|
- version = '3.6.0-alpha.1'
+ version = '3.6.0-beta.2'
m.name = 'Mapbox-iOS-SDK'
m.version = version
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 7cbe9d594f..7f3adfb78b 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -1396,19 +1396,20 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
- (NSString *)bestLanguageForUser
{
- NSArray *supportedLanguages = @[ @"en", @"es", @"fr", @"de", @"ru", @"zh" ];
- NSArray<NSString *> *preferredLanguages = [NSLocale preferredLanguages];
- NSString *bestLanguage;
-
- for (NSString *language in preferredLanguages) {
- NSString *thisLanguage = [[NSLocale localeWithLocaleIdentifier:language] objectForKey:NSLocaleLanguageCode];
- if ([supportedLanguages containsObject:thisLanguage]) {
- bestLanguage = thisLanguage;
- break;
+ // https://www.mapbox.com/vector-tiles/mapbox-streets-v7/#overview
+ NSArray *supportedLanguages = @[ @"ar", @"en", @"es", @"fr", @"de", @"pt", @"ru", @"zh", @"zh-Hans" ];
+ NSArray<NSString *> *preferredLanguages = [NSBundle preferredLocalizationsFromArray:supportedLanguages forPreferences:[NSLocale preferredLanguages]];
+ NSString *mostSpecificLanguage;
+
+ for (NSString *language in preferredLanguages)
+ {
+ if (language.length > mostSpecificLanguage.length)
+ {
+ mostSpecificLanguage = language;
}
}
- return bestLanguage ?: @"en";
+ return mostSpecificLanguage ?: @"en";
}
- (IBAction)startWorldTour
diff --git a/platform/ios/docs/guides/Tile URL Templates.md b/platform/ios/docs/guides/Tile URL Templates.md
new file mode 100644
index 0000000000..f61d2ea33a
--- /dev/null
+++ b/platform/ios/docs/guides/Tile URL Templates.md
@@ -0,0 +1,99 @@
+<!--
+ This file is generated.
+ Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
+-->
+# Tile URL Templates
+
+`MGLTileSource` objects, specifically `MGLRasterSource` and `MGLVectorSource`
+objects, can be created using an initializer that accepts an array of tile URL
+templates. Tile URL templates are strings that specify the URLs of the vector
+tiles or raster tile images to load. A template resembles an absolute URL, but
+with any number of placeholder strings that the source evaluates based on the
+tile it needs to load. For example:
+
+* `http://www.example.com/tiles/{z}/{x}/{y}.pbf` could be
+ evaluated as `http://www.example.com/tiles/14/6/9.pbf`.
+* `http://www.example.com/tiles/{z}/{x}/{y}{ratio}.png` could be
+ evaluated as `http://www.example.com/tiles/14/6/9@2x.png`.
+
+Tile URL templates are also used to define tilesets in TileJSON manifests or
+[`raster`](https://www.mapbox.com/mapbox-gl-js/style-spec/#sources-raster-tiles)
+and
+[`vector`](https://www.mapbox.com/mapbox-gl-js/style-spec/#sources-vector-tiles)
+sources in style JSON files. See the
+[TileJSON specification](https://github.com/mapbox/tilejson-spec/tree/master/2.2.0)
+for information about tile URL templates in the context of a TileJSON or style
+JSON file.
+
+Tile sources support the following placeholder strings in tile URL templates,
+all of which are optional:
+
+<table>
+<thead>
+<tr><th>Placeholder string</th><th>Description</th></tr>
+</thead>
+<tbody>
+<tr>
+ <td><code>{x}</code></td>
+ <td>The index of the tile along the map’s x axis according to Spherical
+ Mercator projection. If the value is 0, the tile’s left edge corresponds
+ to the 180th meridian west. If the value is 2<sup><var>z</var></sup>−1,
+ the tile’s right edge corresponds to the 180th meridian east.</td>
+</tr>
+<tr>
+ <td><code>{y}</code></td>
+ <td>The index of the tile along the map’s y axis according to Spherical
+ Mercator projection. If the value is 0, the tile’s tile edge corresponds
+ to arctan(sinh(π)), or approximately 85.0511 degrees north. If the value
+ is 2<sup><var>z</var></sup>−1, the tile’s bottom edge corresponds to
+ −arctan(sinh(π)), or approximately 85.0511 degrees south. The y axis is
+ inverted if the <code>options</code> parameter contains
+ <code>MGLTileSourceOptionTileCoordinateSystem</code> with a value of
+ <code>MGLTileCoordinateSystemTMS</code>.</td>
+</tr>
+<tr>
+ <td><code>{z}</code></td>
+ <td>The tile’s zoom level. At zoom level 0, each tile covers the entire
+ world map; at zoom level 1, it covers ¼ of the world; at zoom level 2,
+ <sup>1</sup>⁄<sub>16</sub> of the world, and so on. For tiles loaded by
+ a <code>MGLRasterSource</code> object, whether the tile zoom level
+ matches the map’s current zoom level depends on the value of the
+ source’s tile size as specified in the
+ <code>MGLTileSourceOptionTileSize</code> key of the <code>options</code>
+ parameter.</td>
+</tr>
+<tr>
+ <td><code>{bbox-epsg-3857}</code></td>
+ <td>The tile’s bounding box, expressed as a comma-separated list of the
+ tile’s western, southern, eastern, and northern extents according to
+ Spherical Mercator (EPSG:3857) projection. The bounding box is typically
+ used with map services conforming to the
+ <a href="http://www.opengeospatial.org/standards/wms">Web Map Service</a>
+ protocol.</td>
+</tr>
+<tr>
+ <td><code>{quadkey}</code></td>
+ <td>A quadkey indicating both the tile’s location and its zoom level. The
+ quadkey is typically used with
+ <a href="https://msdn.microsoft.com/en-us/library/bb259689.aspx">Bing Maps</a>.
+ </td>
+</tr>
+<tr>
+ <td><code>{ratio}</code></td>
+ <td>A suffix indicating the resolution of the tile image. The suffix is the
+ empty string for standard resolution displays and <code>@2x</code> for
+ Retina displays, including displays for which <code>UIScreen.scale</code>
+ is 3.
+ </td>
+</tr>
+<tr>
+ <td><code>{prefix}</code></td>
+ <td>Two hexadecimal digits chosen such that each visible tile has a
+ different prefix. The prefix is typically used for domain sharding.</td>
+</tr>
+</tbody>
+</table>
+
+For more information about the `{x}`, `{y}`, and `{z}` placeholder strings,
+consult the
+[OpenStreetMap Wiki](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames).
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index 215d31810d..b6d422d0fc 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -9,6 +9,13 @@
/* Begin PBXBuildFile section */
1753ED421E53CE6F00A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */; };
1753ED431E53CE6F00A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */; };
+ 1F06668A1EC64F8E001C16D7 /* MGLLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F0666881EC64F8E001C16D7 /* MGLLight.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 1F06668D1EC64F8E001C16D7 /* MGLLight.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F0666891EC64F8E001C16D7 /* MGLLight.mm */; };
+ 1F7454921ECBB42C00021D39 /* MGLLight.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F0666891EC64F8E001C16D7 /* MGLLight.mm */; };
+ 1F7454931ECBB43F00021D39 /* MGLLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F0666881EC64F8E001C16D7 /* MGLLight.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 1F7454961ECD450D00021D39 /* MGLLight_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F7454941ECD450D00021D39 /* MGLLight_Private.h */; };
+ 1F7454971ECD450D00021D39 /* MGLLight_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F7454941ECD450D00021D39 /* MGLLight_Private.h */; };
+ 1F7454A91ED08AB400021D39 /* MGLLightTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F7454A61ED08AB400021D39 /* MGLLightTest.mm */; };
1F95931D1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931C1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm */; };
30E578171DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; };
30E578181DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; };
@@ -165,6 +172,7 @@
408AA8571DAEDA1700022900 /* NSDictionary+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 408AA8551DAEDA0800022900 /* NSDictionary+MGLAdditions.h */; };
408AA8581DAEDA1E00022900 /* NSDictionary+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 408AA8561DAEDA0800022900 /* NSDictionary+MGLAdditions.mm */; };
408AA8591DAEDA1E00022900 /* NSDictionary+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 408AA8561DAEDA0800022900 /* NSDictionary+MGLAdditions.mm */; };
+ 409D0A0D1ED614CE00C95D0C /* MGLAnnotationViewIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409D0A0C1ED614CE00C95D0C /* MGLAnnotationViewIntegrationTests.swift */; };
409F43FD1E9E781C0048729D /* MGLMapViewDelegateIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 409F43FC1E9E781C0048729D /* MGLMapViewDelegateIntegrationTests.swift */; };
40CF6DBB1DAC3C6600A4D18B /* MGLShape_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40CF6DBA1DAC3C1800A4D18B /* MGLShape_Private.h */; };
40CFA6511D7875BB008103BD /* MGLShapeSourceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 40CFA6501D787579008103BD /* MGLShapeSourceTests.mm */; };
@@ -193,6 +201,8 @@
7E016D861D9E890300A29A21 /* MGLPolygon+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E016D831D9E890300A29A21 /* MGLPolygon+MGLAdditions.m */; };
7E016D871D9E890300A29A21 /* MGLPolygon+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E016D831D9E890300A29A21 /* MGLPolygon+MGLAdditions.m */; };
920A3E5D1E6F995200C16EFC /* MGLSourceQueryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 920A3E5C1E6F995200C16EFC /* MGLSourceQueryTests.m */; };
+ 960D0C361ECF5AAF008E151F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 960D0C351ECF5AAF008E151F /* Images.xcassets */; };
+ 960D0C371ECF5AAF008E151F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 960D0C351ECF5AAF008E151F /* Images.xcassets */; };
9620BB381E69FE1700705A1D /* MGLSDKUpdateChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 9620BB361E69FE1700705A1D /* MGLSDKUpdateChecker.h */; };
9620BB391E69FE1700705A1D /* MGLSDKUpdateChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 9620BB361E69FE1700705A1D /* MGLSDKUpdateChecker.h */; };
9620BB3A1E69FE1700705A1D /* MGLSDKUpdateChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */; };
@@ -326,15 +336,6 @@
DA88485C1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.h in Headers */ = {isa = PBXBuildFile; fileRef = DA88484D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.h */; };
DA88485D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88484E1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m */; };
DA8848601CBAFC2E00AB86E3 /* Mapbox.h in Headers */ = {isa = PBXBuildFile; fileRef = DA88485E1CBAFC2E00AB86E3 /* Mapbox.h */; settings = {ATTRIBUTES = (Public, ); }; };
- DA88486D1CBAFCC100AB86E3 /* Compass.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848631CBAFCC100AB86E3 /* Compass.png */; };
- DA88486E1CBAFCC100AB86E3 /* Compass@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848641CBAFCC100AB86E3 /* Compass@2x.png */; };
- DA88486F1CBAFCC100AB86E3 /* Compass@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848651CBAFCC100AB86E3 /* Compass@3x.png */; };
- DA8848701CBAFCC100AB86E3 /* default_marker.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848661CBAFCC100AB86E3 /* default_marker.png */; };
- DA8848711CBAFCC100AB86E3 /* default_marker@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848671CBAFCC100AB86E3 /* default_marker@2x.png */; };
- DA8848721CBAFCC100AB86E3 /* default_marker@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848681CBAFCC100AB86E3 /* default_marker@3x.png */; };
- DA8848731CBAFCC100AB86E3 /* mapbox.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848691CBAFCC100AB86E3 /* mapbox.png */; };
- DA8848741CBAFCC100AB86E3 /* mapbox@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA88486A1CBAFCC100AB86E3 /* mapbox@2x.png */; };
- DA8848751CBAFCC100AB86E3 /* mapbox@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA88486B1CBAFCC100AB86E3 /* mapbox@3x.png */; };
DA8848841CBB033F00AB86E3 /* FABAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848801CBB033F00AB86E3 /* FABAttributes.h */; };
DA8848851CBB033F00AB86E3 /* FABKitProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848811CBB033F00AB86E3 /* FABKitProtocol.h */; };
DA8848861CBB033F00AB86E3 /* Fabric+FABKits.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848821CBB033F00AB86E3 /* Fabric+FABKits.h */; };
@@ -348,15 +349,6 @@
DA8933DB1CCD31D400E68420 /* Foundation.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA8933BA1CCD2CA100E68420 /* Foundation.strings */; };
DA8933DC1CCD31D400E68420 /* Foundation.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = DA8933BD1CCD2CAD00E68420 /* Foundation.stringsdict */; };
DA8933E01CCD31DF00E68420 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA89339F1CCC951200E68420 /* Localizable.strings */; };
- DA8933E11CCD31DF00E68420 /* Compass.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848631CBAFCC100AB86E3 /* Compass.png */; };
- DA8933E21CCD31DF00E68420 /* Compass@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848641CBAFCC100AB86E3 /* Compass@2x.png */; };
- DA8933E31CCD31DF00E68420 /* Compass@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848651CBAFCC100AB86E3 /* Compass@3x.png */; };
- DA8933E41CCD31DF00E68420 /* default_marker.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848661CBAFCC100AB86E3 /* default_marker.png */; };
- DA8933E51CCD31DF00E68420 /* default_marker@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848671CBAFCC100AB86E3 /* default_marker@2x.png */; };
- DA8933E61CCD31DF00E68420 /* default_marker@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848681CBAFCC100AB86E3 /* default_marker@3x.png */; };
- DA8933E71CCD31DF00E68420 /* mapbox.png in Resources */ = {isa = PBXBuildFile; fileRef = DA8848691CBAFCC100AB86E3 /* mapbox.png */; };
- DA8933E81CCD31DF00E68420 /* mapbox@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA88486A1CBAFCC100AB86E3 /* mapbox@2x.png */; };
- DA8933E91CCD31DF00E68420 /* mapbox@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA88486B1CBAFCC100AB86E3 /* mapbox@3x.png */; };
DA8933F01CCD387900E68420 /* strip-frameworks.sh in Resources */ = {isa = PBXBuildFile; fileRef = DA8933EF1CCD387900E68420 /* strip-frameworks.sh */; };
DA8963371CC549A100684375 /* glyphs in Resources */ = {isa = PBXBuildFile; fileRef = DA8963331CC549A100684375 /* glyphs */; };
DA8963381CC549A100684375 /* sprites in Resources */ = {isa = PBXBuildFile; fileRef = DA8963341CC549A100684375 /* sprites */; };
@@ -545,6 +537,10 @@
/* Begin PBXFileReference section */
1753ED411E53CE6F00A9FD90 /* MGLConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLConversion.h; sourceTree = "<group>"; };
+ 1F0666881EC64F8E001C16D7 /* MGLLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLight.h; sourceTree = "<group>"; };
+ 1F0666891EC64F8E001C16D7 /* MGLLight.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLight.mm; sourceTree = "<group>"; };
+ 1F7454941ECD450D00021D39 /* MGLLight_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLight_Private.h; sourceTree = "<group>"; };
+ 1F7454A61ED08AB400021D39 /* MGLLightTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLLightTest.mm; path = ../../darwin/test/MGLLightTest.mm; sourceTree = "<group>"; };
1F95931C1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLNSDateAdditionsTests.mm; path = ../../darwin/test/MGLNSDateAdditionsTests.mm; sourceTree = "<group>"; };
20DABE861DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Foundation.strings"; sourceTree = "<group>"; };
20DABE881DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
@@ -644,6 +640,7 @@
4085AF081D933DEA00F11B22 /* MGLTileSetTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLTileSetTests.mm; path = ../../darwin/test/MGLTileSetTests.mm; sourceTree = "<group>"; };
408AA8551DAEDA0800022900 /* NSDictionary+MGLAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+MGLAdditions.h"; sourceTree = "<group>"; };
408AA8561DAEDA0800022900 /* NSDictionary+MGLAdditions.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSDictionary+MGLAdditions.mm"; sourceTree = "<group>"; };
+ 409D0A0C1ED614CE00C95D0C /* MGLAnnotationViewIntegrationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MGLAnnotationViewIntegrationTests.swift; sourceTree = "<group>"; };
409F43FC1E9E781C0048729D /* MGLMapViewDelegateIntegrationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MGLMapViewDelegateIntegrationTests.swift; sourceTree = "<group>"; };
40CF6DBA1DAC3C1800A4D18B /* MGLShape_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLShape_Private.h; sourceTree = "<group>"; };
40CFA6501D787579008103BD /* MGLShapeSourceTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLShapeSourceTests.mm; path = ../../darwin/test/MGLShapeSourceTests.mm; sourceTree = "<group>"; };
@@ -668,6 +665,7 @@
7E016D821D9E890300A29A21 /* MGLPolygon+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MGLPolygon+MGLAdditions.h"; sourceTree = "<group>"; };
7E016D831D9E890300A29A21 /* MGLPolygon+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MGLPolygon+MGLAdditions.m"; sourceTree = "<group>"; };
920A3E5C1E6F995200C16EFC /* MGLSourceQueryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLSourceQueryTests.m; path = ../../darwin/test/MGLSourceQueryTests.m; sourceTree = "<group>"; };
+ 960D0C351ECF5AAF008E151F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
9620BB361E69FE1700705A1D /* MGLSDKUpdateChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSDKUpdateChecker.h; sourceTree = "<group>"; };
9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = MGLSDKUpdateChecker.mm; sourceTree = "<group>"; };
9660916B1E5BBFD700A9A03B /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -836,15 +834,6 @@
DA88484D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFaux3DUserLocationAnnotationView.h; sourceTree = "<group>"; };
DA88484E1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLFaux3DUserLocationAnnotationView.m; sourceTree = "<group>"; };
DA88485E1CBAFC2E00AB86E3 /* Mapbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mapbox.h; path = src/Mapbox.h; sourceTree = SOURCE_ROOT; };
- DA8848631CBAFCC100AB86E3 /* Compass.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Compass.png; sourceTree = "<group>"; };
- DA8848641CBAFCC100AB86E3 /* Compass@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Compass@2x.png"; sourceTree = "<group>"; };
- DA8848651CBAFCC100AB86E3 /* Compass@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Compass@3x.png"; sourceTree = "<group>"; };
- DA8848661CBAFCC100AB86E3 /* default_marker.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = default_marker.png; sourceTree = "<group>"; };
- DA8848671CBAFCC100AB86E3 /* default_marker@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "default_marker@2x.png"; sourceTree = "<group>"; };
- DA8848681CBAFCC100AB86E3 /* default_marker@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "default_marker@3x.png"; sourceTree = "<group>"; };
- DA8848691CBAFCC100AB86E3 /* mapbox.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mapbox.png; sourceTree = "<group>"; };
- DA88486A1CBAFCC100AB86E3 /* mapbox@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mapbox@2x.png"; sourceTree = "<group>"; };
- DA88486B1CBAFCC100AB86E3 /* mapbox@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mapbox@3x.png"; sourceTree = "<group>"; };
DA8848801CBB033F00AB86E3 /* FABAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FABAttributes.h; sourceTree = "<group>"; };
DA8848811CBB033F00AB86E3 /* FABKitProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FABKitProtocol.h; sourceTree = "<group>"; };
DA8848821CBB033F00AB86E3 /* Fabric+FABKits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Fabric+FABKits.h"; sourceTree = "<group>"; };
@@ -1039,6 +1028,9 @@
35599DB81D46AD7F0048254D /* Categories */,
353933F01D3FB6BA003F57D7 /* Layers */,
35136D491D4277EA00C20EFD /* Sources */,
+ 1F0666881EC64F8E001C16D7 /* MGLLight.h */,
+ 1F0666891EC64F8E001C16D7 /* MGLLight.mm */,
+ 1F7454941ECD450D00021D39 /* MGLLight_Private.h */,
DAAF72291DA903C700312FA4 /* MGLStyleValue.h */,
DAAF722A1DA903C700312FA4 /* MGLStyleValue_Private.h */,
35599DEA1D46F14E0048254D /* MGLStyleValue.mm */,
@@ -1069,6 +1061,7 @@
children = (
3575798F1D513EF1000B822E /* Layers */,
40CFA64E1D78754A008103BD /* Sources */,
+ 1F7454A61ED08AB400021D39 /* MGLLightTest.mm */,
357F09091DF84F3800941873 /* MGLStyleValueTests.h */,
3599A3E51DF708BC00E77FB2 /* MGLStyleValueTests.m */,
DA2207BE1DC0805F0002F84D /* MGLStyleValueTests.swift */,
@@ -1128,6 +1121,7 @@
isa = PBXGroup;
children = (
409F43FC1E9E781C0048729D /* MGLMapViewDelegateIntegrationTests.swift */,
+ 409D0A0C1ED614CE00C95D0C /* MGLAnnotationViewIntegrationTests.swift */,
);
name = "Swift Integration";
sourceTree = "<group>";
@@ -1348,17 +1342,9 @@
DA8848621CBAFCC100AB86E3 /* Kit Resources */ = {
isa = PBXGroup;
children = (
+ 960D0C351ECF5AAF008E151F /* Images.xcassets */,
DA89339F1CCC951200E68420 /* Localizable.strings */,
DAC49C5F1CD02BC9009E1AA3 /* Localizable.stringsdict */,
- DA8848631CBAFCC100AB86E3 /* Compass.png */,
- DA8848641CBAFCC100AB86E3 /* Compass@2x.png */,
- DA8848651CBAFCC100AB86E3 /* Compass@3x.png */,
- DA8848661CBAFCC100AB86E3 /* default_marker.png */,
- DA8848671CBAFCC100AB86E3 /* default_marker@2x.png */,
- DA8848681CBAFCC100AB86E3 /* default_marker@3x.png */,
- DA8848691CBAFCC100AB86E3 /* mapbox.png */,
- DA88486A1CBAFCC100AB86E3 /* mapbox@2x.png */,
- DA88486B1CBAFCC100AB86E3 /* mapbox@3x.png */,
DA8933EF1CCD387900E68420 /* strip-frameworks.sh */,
40599F001DEE1B2400182B5D /* api_mapbox_staging.der */,
40599F011DEE1B2400182B5D /* api_mapbox_com-digicert.der */,
@@ -1657,6 +1643,7 @@
DA8847F01CBAFA5100AB86E3 /* MGLAnnotation.h in Headers */,
7E016D841D9E890300A29A21 /* MGLPolygon+MGLAdditions.h in Headers */,
400533011DB0862B0069F638 /* NSArray+MGLAdditions.h in Headers */,
+ 1F06668A1EC64F8E001C16D7 /* MGLLight.h in Headers */,
4049C29D1DB6CD6C00B3F799 /* MGLPointCollection.h in Headers */,
40CF6DBB1DAC3C6600A4D18B /* MGLShape_Private.h in Headers */,
4018B1CA1CDC288E00F666AF /* MGLAnnotationView.h in Headers */,
@@ -1705,6 +1692,7 @@
353933F21D3FB753003F57D7 /* MGLCircleStyleLayer.h in Headers */,
DA8847F31CBAFA5100AB86E3 /* MGLMultiPoint.h in Headers */,
30E578171DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */,
+ 1F7454961ECD450D00021D39 /* MGLLight_Private.h in Headers */,
DAD1656C1CF41981001FF4B9 /* MGLFeature.h in Headers */,
40EDA1C01CFE0E0200D9EA68 /* MGLAnnotationContainerView.h in Headers */,
9620BB381E69FE1700705A1D /* MGLSDKUpdateChecker.h in Headers */,
@@ -1783,6 +1771,7 @@
35CE61831D4165D9004F2359 /* UIColor+MGLAdditions.h in Headers */,
DABFB8671CBE99E500D62B32 /* MGLPolygon.h in Headers */,
404C26E81D89C55D000AA13D /* MGLTileSource_Private.h in Headers */,
+ 1F7454931ECBB43F00021D39 /* MGLLight.h in Headers */,
DAAF722C1DA903C700312FA4 /* MGLStyleValue.h in Headers */,
DABFB8651CBE99E500D62B32 /* MGLOverlay.h in Headers */,
35E79F211D41266300957B9E /* MGLStyleLayer_Private.h in Headers */,
@@ -1816,6 +1805,7 @@
DA35A2BC1CCA9A6900E826B2 /* MGLClockDirectionFormatter.h in Headers */,
35D13AC41D3D19DD00AFB4E0 /* MGLFillStyleLayer.h in Headers */,
DABFB86E1CBE9A0F00D62B32 /* MGLCalloutView.h in Headers */,
+ 1F7454971ECD450D00021D39 /* MGLLight_Private.h in Headers */,
DABFB8601CBE99E500D62B32 /* MGLMapCamera.h in Headers */,
DA737EE21D056A4E005BDA16 /* MGLMapViewDelegate.h in Headers */,
DAF0D8191DFE6B2800B28378 /* MGLAttributionInfo_Private.h in Headers */,
@@ -2073,18 +2063,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- DA8848731CBAFCC100AB86E3 /* mapbox.png in Resources */,
DA8933BC1CCD2CA100E68420 /* Foundation.strings in Resources */,
- DA8848741CBAFCC100AB86E3 /* mapbox@2x.png in Resources */,
DA8933A31CCC95B000E68420 /* Localizable.strings in Resources */,
- DA88486D1CBAFCC100AB86E3 /* Compass.png in Resources */,
- DA8848721CBAFCC100AB86E3 /* default_marker@3x.png in Resources */,
- DA88486F1CBAFCC100AB86E3 /* Compass@3x.png in Resources */,
- DA88486E1CBAFCC100AB86E3 /* Compass@2x.png in Resources */,
- DA8848701CBAFCC100AB86E3 /* default_marker.png in Resources */,
- DA8848711CBAFCC100AB86E3 /* default_marker@2x.png in Resources */,
+ 960D0C361ECF5AAF008E151F /* Images.xcassets in Resources */,
DA8933F01CCD387900E68420 /* strip-frameworks.sh in Resources */,
- DA8848751CBAFCC100AB86E3 /* mapbox@3x.png in Resources */,
DAC49C5C1CD02BC9009E1AA3 /* Localizable.stringsdict in Resources */,
DA8933BF1CCD2CAD00E68420 /* Foundation.stringsdict in Resources */,
408982E91DEE208200754016 /* api_mapbox_staging.der in Resources */,
@@ -2098,16 +2080,8 @@
buildActionMask = 2147483647;
files = (
DA8933E01CCD31DF00E68420 /* Localizable.strings in Resources */,
- DA8933E11CCD31DF00E68420 /* Compass.png in Resources */,
- DA8933E21CCD31DF00E68420 /* Compass@2x.png in Resources */,
- DA8933E31CCD31DF00E68420 /* Compass@3x.png in Resources */,
- DA8933E41CCD31DF00E68420 /* default_marker.png in Resources */,
- DA8933E51CCD31DF00E68420 /* default_marker@2x.png in Resources */,
- DA8933E61CCD31DF00E68420 /* default_marker@3x.png in Resources */,
- DA8933E71CCD31DF00E68420 /* mapbox.png in Resources */,
- DA8933E81CCD31DF00E68420 /* mapbox@2x.png in Resources */,
- DA8933E91CCD31DF00E68420 /* mapbox@3x.png in Resources */,
DA8933DB1CCD31D400E68420 /* Foundation.strings in Resources */,
+ 960D0C371ECF5AAF008E151F /* Images.xcassets in Resources */,
DA8933DC1CCD31D400E68420 /* Foundation.stringsdict in Resources */,
DAC49C5D1CD02BC9009E1AA3 /* Localizable.stringsdict in Resources */,
40599F0C1DEE1B7600182B5D /* api_mapbox_staging.der in Resources */,
@@ -2166,6 +2140,7 @@
DAE7DEC21E245455007505A6 /* MGLNSStringAdditionsTests.m in Sources */,
4085AF091D933DEA00F11B22 /* MGLTileSetTests.mm in Sources */,
DAEDC4341D603417000224FF /* MGLAttributionInfoTests.m in Sources */,
+ 1F7454A91ED08AB400021D39 /* MGLLightTest.mm in Sources */,
357579851D502AF5000B822E /* MGLSymbolStyleLayerTests.mm in Sources */,
357579871D502AFE000B822E /* MGLLineStyleLayerTests.mm in Sources */,
357579891D502B06000B822E /* MGLCircleStyleLayerTests.mm in Sources */,
@@ -2176,6 +2151,7 @@
1F95931D1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm in Sources */,
DD58A4C61D822BD000E1F038 /* MGLExpressionTests.mm in Sources */,
3575798B1D502B0C000B822E /* MGLBackgroundStyleLayerTests.mm in Sources */,
+ 409D0A0D1ED614CE00C95D0C /* MGLAnnotationViewIntegrationTests.swift in Sources */,
DA2E88621CC0382C00F24E7B /* MGLOfflinePackTests.m in Sources */,
55E2AD131E5B125400E8C587 /* MGLOfflineStorageTests.mm in Sources */,
920A3E5D1E6F995200C16EFC /* MGLSourceQueryTests.m in Sources */,
@@ -2221,6 +2197,7 @@
3566C76E1D4A8DFA008152BC /* MGLRasterSource.mm in Sources */,
DA88488C1CBB037E00AB86E3 /* SMCalloutView.m in Sources */,
35136D4E1D4277FC00C20EFD /* MGLSource.mm in Sources */,
+ 1F06668D1EC64F8E001C16D7 /* MGLLight.mm in Sources */,
DA35A2B81CCA9A5D00E826B2 /* MGLClockDirectionFormatter.m in Sources */,
DAD1657A1CF4CDFF001FF4B9 /* MGLShapeCollection.mm in Sources */,
35136D451D42275100C20EFD /* MGLSymbolStyleLayer.mm in Sources */,
@@ -2328,6 +2305,7 @@
DAA4E4321CBB730400178DFB /* MGLMapView.mm in Sources */,
DAA4E41E1CBB730400178DFB /* MGLMapCamera.mm in Sources */,
FA68F14E1E9D656600F9F6C2 /* MGLFillExtrusionStyleLayer.mm in Sources */,
+ 1F7454921ECBB42C00021D39 /* MGLLight.mm in Sources */,
404C26E51D89B877000AA13D /* MGLTileSource.mm in Sources */,
355AE0021E9281DA00F3939D /* MGLScaleBar.mm in Sources */,
4018B1C81CDC287F00F666AF /* MGLAnnotationView.mm in Sources */,
@@ -2681,7 +2659,10 @@
baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
- HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)";
+ HEADER_SEARCH_PATHS = (
+ "$(mbgl_core_INCLUDE_DIRECTORIES)",
+ "$(polylabel_INCLUDE_DIRECTORIES)",
+ );
INFOPLIST_FILE = test/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -2705,7 +2686,10 @@
baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
- HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)";
+ HEADER_SEARCH_PATHS = (
+ "$(mbgl_core_INCLUDE_DIRECTORIES)",
+ "$(polylabel_INCLUDE_DIRECTORIES)",
+ );
INFOPLIST_FILE = test/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -2733,7 +2717,10 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
- HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)";
+ HEADER_SEARCH_PATHS = (
+ "$(mbgl_core_INCLUDE_DIRECTORIES)",
+ "$(polylabel_INCLUDE_DIRECTORIES)",
+ );
INFOPLIST_FILE = framework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -2767,7 +2754,10 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
- HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)";
+ HEADER_SEARCH_PATHS = (
+ "$(mbgl_core_INCLUDE_DIRECTORIES)",
+ "$(polylabel_INCLUDE_DIRECTORIES)",
+ );
INFOPLIST_FILE = framework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -2818,7 +2808,10 @@
baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */;
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
- HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)";
+ HEADER_SEARCH_PATHS = (
+ "$(mbgl_core_INCLUDE_DIRECTORIES)",
+ "$(polylabel_INCLUDE_DIRECTORIES)",
+ );
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"$(sqlite_cflags)",
@@ -2844,7 +2837,10 @@
baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */;
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
- HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)";
+ HEADER_SEARCH_PATHS = (
+ "$(mbgl_core_INCLUDE_DIRECTORIES)",
+ "$(polylabel_INCLUDE_DIRECTORIES)",
+ );
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"$(sqlite_cflags)",
diff --git a/platform/ios/jazzy.yml b/platform/ios/jazzy.yml
index e0ce29beba..31380faa2c 100644
--- a/platform/ios/jazzy.yml
+++ b/platform/ios/jazzy.yml
@@ -23,6 +23,7 @@ custom_categories:
- Working with Mapbox Studio
- Working with GeoJSON Data
- For Style Authors
+ - Tile URL Templates
- Info.plist Keys
- Gesture Recognizers
- name: Maps
@@ -59,6 +60,7 @@ custom_categories:
children:
- MGLStyle
- MGLStyleValue
+ - MGLLight
- name: Style Primitives
children:
- MGLFeature
diff --git a/platform/ios/originals/compass.sketch b/platform/ios/originals/compass.sketch
new file mode 100644
index 0000000000..f5b848cd96
--- /dev/null
+++ b/platform/ios/originals/compass.sketch
Binary files differ
diff --git a/platform/ios/resources/Compass.png b/platform/ios/resources/Compass.png
deleted file mode 100644
index 08bed0591b..0000000000
--- a/platform/ios/resources/Compass.png
+++ /dev/null
Binary files differ
diff --git a/platform/ios/resources/Compass@2x.png b/platform/ios/resources/Compass@2x.png
deleted file mode 100644
index 8473a2d1ec..0000000000
--- a/platform/ios/resources/Compass@2x.png
+++ /dev/null
Binary files differ
diff --git a/platform/ios/resources/Compass@3x.png b/platform/ios/resources/Compass@3x.png
deleted file mode 100644
index 9cf66ca483..0000000000
--- a/platform/ios/resources/Compass@3x.png
+++ /dev/null
Binary files differ
diff --git a/platform/ios/resources/Images.xcassets/Compass.imageset/Contents.json b/platform/ios/resources/Images.xcassets/Compass.imageset/Contents.json
new file mode 100644
index 0000000000..6065a93b4e
--- /dev/null
+++ b/platform/ios/resources/Images.xcassets/Compass.imageset/Contents.json
@@ -0,0 +1,12 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "compass.pdf"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/platform/ios/resources/Images.xcassets/Compass.imageset/compass.pdf b/platform/ios/resources/Images.xcassets/Compass.imageset/compass.pdf
new file mode 100644
index 0000000000..2048f96089
--- /dev/null
+++ b/platform/ios/resources/Images.xcassets/Compass.imageset/compass.pdf
Binary files differ
diff --git a/platform/ios/resources/Images.xcassets/Contents.json b/platform/ios/resources/Images.xcassets/Contents.json
new file mode 100644
index 0000000000..da4a164c91
--- /dev/null
+++ b/platform/ios/resources/Images.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/platform/ios/resources/Images.xcassets/default_marker.imageset/Contents.json b/platform/ios/resources/Images.xcassets/default_marker.imageset/Contents.json
new file mode 100644
index 0000000000..9bef658a11
--- /dev/null
+++ b/platform/ios/resources/Images.xcassets/default_marker.imageset/Contents.json
@@ -0,0 +1,12 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "default_marker.pdf"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/platform/ios/resources/Images.xcassets/default_marker.imageset/default_marker.pdf b/platform/ios/resources/Images.xcassets/default_marker.imageset/default_marker.pdf
new file mode 100644
index 0000000000..4e2e332301
--- /dev/null
+++ b/platform/ios/resources/Images.xcassets/default_marker.imageset/default_marker.pdf
Binary files differ
diff --git a/platform/ios/resources/Images.xcassets/mapbox.imageset/Contents.json b/platform/ios/resources/Images.xcassets/mapbox.imageset/Contents.json
new file mode 100644
index 0000000000..b49c53da84
--- /dev/null
+++ b/platform/ios/resources/Images.xcassets/mapbox.imageset/Contents.json
@@ -0,0 +1,12 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "mapbox.pdf"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/platform/ios/resources/Images.xcassets/mapbox.imageset/mapbox.pdf b/platform/ios/resources/Images.xcassets/mapbox.imageset/mapbox.pdf
new file mode 100644
index 0000000000..45111c31a6
--- /dev/null
+++ b/platform/ios/resources/Images.xcassets/mapbox.imageset/mapbox.pdf
Binary files differ
diff --git a/platform/ios/resources/default_marker.png b/platform/ios/resources/default_marker.png
deleted file mode 100644
index b112096c18..0000000000
--- a/platform/ios/resources/default_marker.png
+++ /dev/null
Binary files differ
diff --git a/platform/ios/resources/default_marker@2x.png b/platform/ios/resources/default_marker@2x.png
deleted file mode 100644
index d05c82bfe2..0000000000
--- a/platform/ios/resources/default_marker@2x.png
+++ /dev/null
Binary files differ
diff --git a/platform/ios/resources/default_marker@3x.png b/platform/ios/resources/default_marker@3x.png
deleted file mode 100644
index 703b172c15..0000000000
--- a/platform/ios/resources/default_marker@3x.png
+++ /dev/null
Binary files differ
diff --git a/platform/ios/resources/mapbox.png b/platform/ios/resources/mapbox.png
deleted file mode 100644
index 00bc897a58..0000000000
--- a/platform/ios/resources/mapbox.png
+++ /dev/null
Binary files differ
diff --git a/platform/ios/resources/mapbox@2x.png b/platform/ios/resources/mapbox@2x.png
deleted file mode 100644
index 206ed5883e..0000000000
--- a/platform/ios/resources/mapbox@2x.png
+++ /dev/null
Binary files differ
diff --git a/platform/ios/resources/mapbox@3x.png b/platform/ios/resources/mapbox@3x.png
deleted file mode 100644
index efd631b587..0000000000
--- a/platform/ios/resources/mapbox@3x.png
+++ /dev/null
Binary files differ
diff --git a/platform/ios/src/MGLAPIClient.m b/platform/ios/src/MGLAPIClient.m
index 22ee5c55f5..124d436197 100644
--- a/platform/ios/src/MGLAPIClient.m
+++ b/platform/ios/src/MGLAPIClient.m
@@ -117,7 +117,7 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST";
- (void)loadCertificate:(NSData **)certificate withResource:(NSString *)resource {
NSBundle *frameworkBundle = [NSBundle mgl_frameworkBundle];
- NSString *cerPath = [frameworkBundle pathForResource:resource ofType:@"der" inDirectory:frameworkBundle.mgl_resourcesDirectory];
+ NSString *cerPath = [frameworkBundle pathForResource:resource ofType:@"der"];
if (cerPath != nil) {
*certificate = [NSData dataWithContentsOfFile:cerPath];
}
diff --git a/platform/ios/src/MGLAnnotationView.h b/platform/ios/src/MGLAnnotationView.h
index 184efdb324..2802d31b05 100644
--- a/platform/ios/src/MGLAnnotationView.h
+++ b/platform/ios/src/MGLAnnotationView.h
@@ -74,6 +74,36 @@ typedef NS_ENUM(NSUInteger, MGLAnnotationViewDragState) {
- (instancetype)initWithReuseIdentifier:(nullable NSString *)reuseIdentifier;
/**
+ Initializes and returns a new annotation view object.
+
+ Providing an annotation allows you to explicitly associate the annotation instance
+ with the new view and, in custom subclasses of `MGLAnnotationView`, customize the view
+ based on properties of the annotation instance in an overridden initializer. However,
+ annotation views that are reused will not necessarily be associated with the
+ same annotation they were initialized with. Also, annotation views that are in
+ the reuse queue will have a nil value for the annotation property. Passing an annotation
+ instance to the view is optional and the map view will automatically associate annotations
+ with views when views are provided to the map via the `-[MGLMapViewDelegate mapView:viewForAnnotation:]`
+ method.
+
+ The reuse identifier provides a way for you to improve performance by recycling
+ annotation views as they enter and leave the map’s viewport. As an annotation
+ leaves the viewport, the map view moves its associated view to a reuse queue.
+ When a new annotation becomes visible, you can request a view for that
+ annotation by passing the appropriate reuse identifier string to the
+ `-[MGLMapView dequeueReusableAnnotationViewWithIdentifier:]` method.
+
+ @param annotation The annotation object to associate with the new view.
+ @param reuseIdentifier A unique string identifier for this view that allows you
+ to reuse this view with multiple similar annotations. You can set this
+ parameter to `nil` if you don’t intend to reuse the view, but it is a good
+ idea in general to specify a reuse identifier to avoid creating redundant
+ views.
+ @return The initialized annotation view object.
+ */
+- (instancetype)initWithAnnotation:(nullable id<MGLAnnotation>)annotation reuseIdentifier:(nullable NSString *)reuseIdentifier;
+
+/**
Called when the view is removed from the reuse queue.
The default implementation of this method does nothing. You can override it in
@@ -141,6 +171,19 @@ typedef NS_ENUM(NSUInteger, MGLAnnotationViewDragState) {
*/
@property (nonatomic, assign) BOOL scalesWithViewingDistance;
+/**
+ A Boolean value that determines whether the annotation view rotates together
+ with the map.
+
+ When the value of this property is `YES` and the map is rotated, the annotation
+ view rotates. This is also the behavior of `MGLAnnotationImage` objects. When the
+ value of this property is `NO` the annotation has its rotation angle fixed.
+
+ The default value of this property is `NO`. Set this property to `YES` if the
+ view’s rotation is important.
+ */
+@property (nonatomic, assign) BOOL rotatesToMatchCamera;
+
#pragma mark Managing the Selection State
/**
diff --git a/platform/ios/src/MGLAnnotationView.mm b/platform/ios/src/MGLAnnotationView.mm
index 5e0ae3b848..94d0649413 100644
--- a/platform/ios/src/MGLAnnotationView.mm
+++ b/platform/ios/src/MGLAnnotationView.mm
@@ -11,6 +11,7 @@
@property (nonatomic, readwrite, nullable) NSString *reuseIdentifier;
@property (nonatomic, readwrite) CATransform3D lastAppliedScaleTransform;
+@property (nonatomic, readwrite) CATransform3D lastAppliedRotateTransform;
@property (nonatomic, weak) UIPanGestureRecognizer *panGestureRecognizer;
@property (nonatomic, weak) UILongPressGestureRecognizer *longPressRecognizer;
@property (nonatomic, weak) MGLMapView *mapView;
@@ -19,21 +20,32 @@
@implementation MGLAnnotationView
-- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
-{
- self = [self initWithFrame:CGRectZero];
- if (self)
- {
- _lastAppliedScaleTransform = CATransform3DIdentity;
- _reuseIdentifier = [reuseIdentifier copy];
- _scalesWithViewingDistance = YES;
- _enabled = YES;
++ (BOOL)supportsSecureCoding {
+ return YES;
+}
+
+- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
+ self = [super initWithFrame:CGRectZero];
+ if (self) {
+ [self commonInitWithAnnotation:nil reuseIdentifier:reuseIdentifier];
}
return self;
}
-+ (BOOL)supportsSecureCoding {
- return YES;
+- (instancetype)initWithAnnotation:(nullable id<MGLAnnotation>)annotation reuseIdentifier:(nullable NSString *)reuseIdentifier {
+ self = [super initWithFrame:CGRectZero];
+ if (self) {
+ [self commonInitWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
+ }
+ return self;
+}
+
+- (void)commonInitWithAnnotation:(nullable id<MGLAnnotation>)annotation reuseIdentifier:(nullable NSString *)reuseIdentifier {
+ _lastAppliedScaleTransform = CATransform3DIdentity;
+ _annotation = annotation;
+ _reuseIdentifier = [reuseIdentifier copy];
+ _scalesWithViewingDistance = YES;
+ _enabled = YES;
}
- (instancetype)initWithCoder:(NSCoder *)decoder {
@@ -42,6 +54,7 @@
_annotation = [decoder decodeObjectOfClass:[NSObject class] forKey:@"annotation"];
_centerOffset = [decoder decodeCGVectorForKey:@"centerOffset"];
_scalesWithViewingDistance = [decoder decodeBoolForKey:@"scalesWithViewingDistance"];
+ _rotatesToMatchCamera = [decoder decodeBoolForKey:@"rotatesToMatchCamera"];
_selected = [decoder decodeBoolForKey:@"selected"];
_enabled = [decoder decodeBoolForKey:@"enabled"];
self.draggable = [decoder decodeBoolForKey:@"draggable"];
@@ -55,6 +68,7 @@
[coder encodeObject:_annotation forKey:@"annotation"];
[coder encodeCGVector:_centerOffset forKey:@"centerOffset"];
[coder encodeBool:_scalesWithViewingDistance forKey:@"scalesWithViewingDistance"];
+ [coder encodeBool:_rotatesToMatchCamera forKey:@"rotatesToMatchCamera"];
[coder encodeBool:_selected forKey:@"selected"];
[coder encodeBool:_enabled forKey:@"enabled"];
[coder encodeBool:_draggable forKey:@"draggable"];
@@ -98,6 +112,7 @@
super.center = center;
[self updateScaleTransformForViewingDistance];
+ [self updateRotateTransform];
}
- (void)setScalesWithViewingDistance:(BOOL)scalesWithViewingDistance
@@ -146,6 +161,26 @@
}
}
+- (void)setRotatesToMatchCamera:(BOOL)rotatesToMatchCamera
+{
+ if (_rotatesToMatchCamera != rotatesToMatchCamera)
+ {
+ _rotatesToMatchCamera = rotatesToMatchCamera;
+ [self updateRotateTransform];
+ }
+}
+
+- (void)updateRotateTransform
+{
+ if (self.rotatesToMatchCamera == NO) return;
+
+ CGFloat directionRad = self.mapView.direction * M_PI / 180.0;
+ CATransform3D newRotateTransform = CATransform3DMakeRotation(-directionRad, 0, 0, 1);
+ self.layer.transform = CATransform3DConcat(CATransform3DIdentity, newRotateTransform);
+
+ _lastAppliedRotateTransform = newRotateTransform;
+}
+
#pragma mark - Draggable
- (void)setDraggable:(BOOL)draggable
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index d97c0b6602..9a9f71d5c3 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -64,7 +64,7 @@
#import "MGLCompactCalloutView.h"
#import "MGLAnnotationContainerView.h"
#import "MGLAnnotationContainerView_Private.h"
-#import "MGLAttributionInfo.h"
+#import "MGLAttributionInfo_Private.h"
#include <algorithm>
#include <cstdlib>
@@ -131,6 +131,9 @@ const CGFloat MGLAnnotationImagePaddingForCallout = 1;
const CGSize MGLAnnotationAccessibilityElementMinimumSize = CGSizeMake(10, 10);
+// Context for KVO observing UILayoutGuides.
+static void * MGLLayoutGuidesUpdatedContext = &MGLLayoutGuidesUpdatedContext;
+
/// Unique identifier representing a single annotation in mbgl.
typedef uint32_t MGLAnnotationTag;
@@ -233,13 +236,9 @@ public:
@property (nonatomic) GLKView *glView;
@property (nonatomic) UIImageView *glSnapshotView;
@property (nonatomic, readwrite) MGLScaleBar *scaleBar;
-@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *scaleBarConstraints;
@property (nonatomic, readwrite) UIImageView *compassView;
-@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *compassViewConstraints;
@property (nonatomic, readwrite) UIImageView *logoView;
-@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *logoViewConstraints;
@property (nonatomic, readwrite) UIButton *attributionButton;
-@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *attributionButtonConstraints;
@property (nonatomic, readwrite) MGLStyle *style;
@property (nonatomic) UITapGestureRecognizer *singleTapGestureRecognizer;
@property (nonatomic) UITapGestureRecognizer *doubleTap;
@@ -294,7 +293,8 @@ public:
NSDate *_userLocationAnimationCompletionDate;
/// True if a willChange notification has been issued for shape annotation layers and a didChange notification is pending.
BOOL _isChangingAnnotationLayers;
-
+ BOOL _isObservingTopLayoutGuide;
+ BOOL _isObservingBottomLayoutGuide;
BOOL _isWaitingForRedundantReachableNotification;
BOOL _isTargetingInterfaceBuilder;
@@ -467,13 +467,11 @@ public:
// setup logo bug
//
- UIImage *logo = [MGLMapView resourceImageNamed:@"mapbox.png"];
+ UIImage *logo = [MGLMapView resourceImageNamed:@"mapbox"];
_logoView = [[UIImageView alloc] initWithImage:logo];
_logoView.accessibilityTraits = UIAccessibilityTraitStaticText;
_logoView.accessibilityLabel = NSLocalizedStringWithDefaultValue(@"LOGO_A11Y_LABEL", nil, nil, @"Mapbox", @"Accessibility label");
- _logoView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_logoView];
- _logoViewConstraints = [NSMutableArray array];
// setup attribution
//
@@ -481,9 +479,7 @@ public:
_attributionButton.accessibilityLabel = NSLocalizedStringWithDefaultValue(@"INFO_A11Y_LABEL", nil, nil, @"About this map", @"Accessibility label");
_attributionButton.accessibilityHint = NSLocalizedStringWithDefaultValue(@"INFO_A11Y_HINT", nil, nil, @"Shows credits, a feedback form, and more", @"Accessibility hint");
[_attributionButton addTarget:self action:@selector(showAttribution) forControlEvents:UIControlEventTouchUpInside];
- _attributionButton.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_attributionButton];
- _attributionButtonConstraints = [NSMutableArray array];
[_attributionButton addObserver:self forKeyPath:@"hidden" options:NSKeyValueObservingOptionNew context:NULL];
// setup compass
@@ -495,16 +491,12 @@ public:
_compassView.accessibilityTraits = UIAccessibilityTraitButton;
_compassView.accessibilityLabel = NSLocalizedStringWithDefaultValue(@"COMPASS_A11Y_LABEL", nil, nil, @"Compass", @"Accessibility label");
_compassView.accessibilityHint = NSLocalizedStringWithDefaultValue(@"COMPASS_A11Y_HINT", nil, nil, @"Rotates the map to face due north", @"Accessibility hint");
- _compassView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_compassView];
- _compassViewConstraints = [NSMutableArray array];
// setup scale control
//
_scaleBar = [[MGLScaleBar alloc] init];
- _scaleBar.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_scaleBar];
- _scaleBarConstraints = [NSMutableArray array];
// setup interaction
//
@@ -624,11 +616,11 @@ public:
- (UIImage *)compassImage
{
- UIImage *scaleImage = [MGLMapView resourceImageNamed:@"Compass.png"];
+ UIImage *scaleImage = [MGLMapView resourceImageNamed:@"Compass"];
UIGraphicsBeginImageContextWithOptions(scaleImage.size, NO, [UIScreen mainScreen].scale);
[scaleImage drawInRect:{ CGPointZero, scaleImage.size }];
- CGFloat northSize = 9;
+ CGFloat northSize = 11;
UIFont *northFont;
if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)])
{
@@ -643,7 +635,7 @@ public:
NSForegroundColorAttributeName: [UIColor whiteColor],
}];
CGRect stringRect = CGRectMake((scaleImage.size.width - north.size.width) / 2,
- scaleImage.size.height * 0.45,
+ scaleImage.size.height * 0.435,
north.size.width, north.size.height);
[north drawInRect:stringRect];
@@ -664,6 +656,48 @@ public:
_isWaitingForRedundantReachableNotification = NO;
}
+- (void)willMoveToWindow:(UIWindow *)newWindow
+{
+ [super willMoveToWindow:newWindow];
+
+ if (newWindow) {
+ [self addLayoutGuideObserversIfNeeded];
+ } else {
+ [self removeLayoutGuideObserversIfNeeded];
+ }
+}
+
+- (void)addLayoutGuideObserversIfNeeded
+{
+ UIViewController *viewController = self.viewControllerForLayoutGuides;
+ BOOL useLayoutGuides = viewController.view && viewController.automaticallyAdjustsScrollViewInsets;
+
+ if (useLayoutGuides && viewController.topLayoutGuide && !_isObservingTopLayoutGuide) {
+ [(NSObject *)viewController.topLayoutGuide addObserver:self forKeyPath:@"bounds" options:0 context:(void *)&MGLLayoutGuidesUpdatedContext];
+ _isObservingTopLayoutGuide = YES;
+ }
+
+ if (useLayoutGuides && viewController.bottomLayoutGuide && !_isObservingBottomLayoutGuide) {
+ [(NSObject *)viewController.bottomLayoutGuide addObserver:self forKeyPath:@"bounds" options:0 context:(void *)&MGLLayoutGuidesUpdatedContext];
+ _isObservingBottomLayoutGuide = YES;
+ }
+}
+
+- (void)removeLayoutGuideObserversIfNeeded
+{
+ UIViewController *viewController = self.viewControllerForLayoutGuides;
+
+ if (_isObservingTopLayoutGuide) {
+ [(NSObject *)viewController.topLayoutGuide removeObserver:self forKeyPath:@"bounds" context:(void *)&MGLLayoutGuidesUpdatedContext];
+ _isObservingTopLayoutGuide = NO;
+ }
+
+ if (_isObservingBottomLayoutGuide) {
+ [(NSObject *)viewController.bottomLayoutGuide removeObserver:self forKeyPath:@"bounds" context:(void *)&MGLLayoutGuidesUpdatedContext];
+ _isObservingBottomLayoutGuide = NO;
+ }
+}
+
- (void)dealloc
{
[_reachability stopNotifier];
@@ -672,6 +706,8 @@ public:
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_attributionButton removeObserver:self forKeyPath:@"hidden"];
+ [self removeLayoutGuideObserversIfNeeded];
+
// Removing the annotations unregisters any outstanding KVO observers.
NSArray *annotations = self.annotations;
if (annotations)
@@ -697,11 +733,6 @@ public:
{
[EAGLContext setCurrentContext:nil];
}
-
- [self.logoViewConstraints removeAllObjects];
- self.logoViewConstraints = nil;
- [self.attributionButtonConstraints removeAllObjects];
- self.attributionButtonConstraints = nil;
}
- (void)setDelegate:(nullable id<MGLMapViewDelegate>)delegate
@@ -786,105 +817,13 @@ public:
- (void)updateConstraints
{
- // scale control
- //
- [self removeConstraints:self.scaleBarConstraints];
- [self.scaleBarConstraints removeAllObjects];
-
- [self.scaleBarConstraints addObject:
- [NSLayoutConstraint constraintWithItem:self.scaleBar
- attribute:NSLayoutAttributeTop
- relatedBy:NSLayoutRelationEqual
- toItem:self
- attribute:NSLayoutAttributeTop
- multiplier:1
- constant:5+self.contentInset.top]];
-
- [self.scaleBarConstraints addObject:
- [NSLayoutConstraint constraintWithItem:self.scaleBar
- attribute:NSLayoutAttributeLeading
- relatedBy:NSLayoutRelationEqual
- toItem:self
- attribute:NSLayoutAttributeLeading
- multiplier:1
- constant:8 + self.contentInset.left]];
-
- [self addConstraints:self.scaleBarConstraints];
-
- // compass
- //
- [self removeConstraints:self.compassViewConstraints];
- [self.compassViewConstraints removeAllObjects];
-
- [self.compassViewConstraints addObject:
- [NSLayoutConstraint constraintWithItem:self.compassView
- attribute:NSLayoutAttributeTop
- relatedBy:NSLayoutRelationEqual
- toItem:self
- attribute:NSLayoutAttributeTop
- multiplier:1
- constant:5 + self.contentInset.top]];
-
- [self.compassViewConstraints addObject:
- [NSLayoutConstraint constraintWithItem:self
- attribute:NSLayoutAttributeTrailing
- relatedBy:NSLayoutRelationEqual
- toItem:self.compassView
- attribute:NSLayoutAttributeTrailing
- multiplier:1
- constant:5 + self.contentInset.right]];
-
- [self addConstraints:self.compassViewConstraints];
-
- // logo bug
- //
- [self removeConstraints:self.logoViewConstraints];
- [self.logoViewConstraints removeAllObjects];
-
- [self.logoViewConstraints addObject:
- [NSLayoutConstraint constraintWithItem:self
- attribute:NSLayoutAttributeBottom
- relatedBy:NSLayoutRelationEqual
- toItem:self.logoView
- attribute:NSLayoutAttributeBaseline
- multiplier:1
- constant:8 + self.contentInset.bottom]];
-
- [self.logoViewConstraints addObject:
- [NSLayoutConstraint constraintWithItem:self.logoView
- attribute:NSLayoutAttributeLeading
- relatedBy:NSLayoutRelationEqual
- toItem:self
- attribute:NSLayoutAttributeLeading
- multiplier:1
- constant:8 + self.contentInset.left]];
- [self addConstraints:self.logoViewConstraints];
-
- // attribution button
- //
- [self removeConstraints:self.attributionButtonConstraints];
- [self.attributionButtonConstraints removeAllObjects];
-
- [self.attributionButtonConstraints addObject:
- [NSLayoutConstraint constraintWithItem:self
- attribute:NSLayoutAttributeBottom
- relatedBy:NSLayoutRelationEqual
- toItem:self.attributionButton
- attribute:NSLayoutAttributeBaseline
- multiplier:1
- constant:8 + self.contentInset.bottom]];
-
- [self.attributionButtonConstraints addObject:
- [NSLayoutConstraint constraintWithItem:self
- attribute:NSLayoutAttributeTrailing
- relatedBy:NSLayoutRelationEqual
- toItem:self.attributionButton
- attribute:NSLayoutAttributeTrailing
- multiplier:1
- constant:8 + self.contentInset.right]];
- [self addConstraints:self.attributionButtonConstraints];
-
[super updateConstraints];
+
+ // If we have a view controller reference and its automaticallyAdjustsScrollViewInsets
+ // is set to YES, -[MGLMapView adjustContentInset] takes top and bottom layout
+ // guides into account. To get notified about changes to the layout guides,
+ // we need to observe their bounds and re-layout accordingly.
+ [self addLayoutGuideObserversIfNeeded];
}
- (BOOL)isOpaque
@@ -917,6 +856,8 @@ public:
[super layoutSubviews];
[self adjustContentInset];
+
+ [self layoutOrnaments];
if (!_isTargetingInterfaceBuilder) {
_mbglMap->setSize([self size]);
@@ -931,6 +872,39 @@ public:
[self updateUserLocationAnnotationView];
}
+- (void)layoutOrnaments
+{
+ // scale bar
+ self.scaleBar.frame = {
+ self.contentInset.left+8,
+ self.contentInset.top+5,
+ CGRectGetWidth(self.scaleBar.frame),
+ CGRectGetHeight(self.scaleBar.frame)
+ };
+
+ // compass
+ self.compassView.center = {
+ .x = CGRectGetWidth(self.bounds)-CGRectGetMidX(self.compassView.bounds)-self.contentInset.right-5,
+ .y = CGRectGetMidY(self.compassView.bounds)+self.contentInset.top+5
+ };
+
+ // logo bug
+ self.logoView.frame = {
+ self.contentInset.left+8,
+ CGRectGetHeight(self.bounds)-8-self.contentInset.bottom-CGRectGetHeight(self.logoView.bounds),
+ CGRectGetWidth(self.logoView.bounds),
+ CGRectGetHeight(self.logoView.bounds)
+ };
+
+ // attribution
+ self.attributionButton.frame = {
+ CGRectGetWidth(self.bounds)-CGRectGetWidth(self.attributionButton.bounds)-self.contentInset.right-8,
+ CGRectGetHeight(self.bounds)-CGRectGetHeight(self.attributionButton.bounds)-self.contentInset.bottom-8,
+ CGRectGetWidth(self.attributionButton.bounds),
+ CGRectGetHeight(self.attributionButton.bounds)
+ };
+}
+
/// Updates `contentInset` to reflect the current window geometry.
- (void)adjustContentInset
{
@@ -1000,7 +974,7 @@ public:
}
// Compass, logo and attribution button constraints needs to be updated.
- [self setNeedsUpdateConstraints];
+ [self setNeedsLayout];
}
/// Returns the frame of inset content within the map view.
@@ -1921,8 +1895,12 @@ public:
{
if (info.feedbackLink)
{
- url = [info feedbackURLAtCenterCoordinate:self.centerCoordinate
- zoomLevel:self.zoomLevel];
+ MGLMapCamera *camera = self.camera;
+ url = [info feedbackURLForStyleURL:self.styleURL
+ atCenterCoordinate:camera.centerCoordinate
+ zoomLevel:self.zoomLevel
+ direction:camera.heading
+ pitch:camera.pitch];
}
[[UIApplication sharedApplication] openURL:url];
}
@@ -1999,9 +1977,10 @@ public:
}];
[alertController addAction:participateAction];
- [self.window.rootViewController presentViewController:alertController
- animated:YES
- completion:NULL];
+ UIViewController *viewController = [self.window.rootViewController mgl_topMostViewController];
+ [viewController presentViewController:alertController
+ animated:YES
+ completion:NULL];
}
#pragma mark - Properties -
@@ -2065,6 +2044,10 @@ public:
[self updateCalloutView];
}
}
+ else if (context == MGLLayoutGuidesUpdatedContext && [keyPath isEqualToString:@"bounds"])
+ {
+ [self setNeedsLayout];
+ }
}
+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingZoomEnabled
@@ -3501,6 +3484,7 @@ public:
annotationView.annotation = nil;
[annotationView removeFromSuperview];
+ [self.annotationContainerView.annotationViews removeObject:annotationView];
if (annotationTag == _selectedAnnotationTag)
{
@@ -5314,18 +5298,17 @@ public:
+ (UIImage *)resourceImageNamed:(NSString *)imageName
{
- NSString *extension = imageName.pathExtension.length ? imageName.pathExtension : @"png";
- NSBundle *bundle = [NSBundle mgl_frameworkBundle];
- NSString *path = [bundle pathForResource:imageName.stringByDeletingPathExtension
- ofType:extension
- inDirectory:bundle.mgl_resourcesDirectory];
- if ( ! path)
+ UIImage *image = [UIImage imageNamed:imageName
+ inBundle:[NSBundle mgl_frameworkBundle]
+ compatibleWithTraitCollection:nil];
+
+ if ( ! image)
{
- [NSException raise:@"Resource not found" format:
+ [NSException raise:@"MGLResourceNotFoundException" format:
@"The resource named “%@” could not be found in the Mapbox framework bundle.", imageName];
}
- return [UIImage imageWithContentsOfFile:path];
+ return image;
}
- (BOOL)isFullyLoaded
diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m
index 7b28ccf1a8..4f1413d300 100644
--- a/platform/ios/src/MGLMapboxEvents.m
+++ b/platform/ios/src/MGLMapboxEvents.m
@@ -317,13 +317,6 @@ const NSTimeInterval MGLFlushInterval = 180;
return;
}
- if ([self.eventQueue count] <= 1) {
- [self.eventQueue removeAllObjects];
- [[UIApplication sharedApplication] endBackgroundTask:_backgroundTaskIdentifier];
- _backgroundTaskIdentifier = UIBackgroundTaskInvalid;
- return;
- }
-
NSArray *events = [NSArray arrayWithArray:self.eventQueue];
[self.eventQueue removeAllObjects];
diff --git a/platform/ios/src/MGLScaleBar.mm b/platform/ios/src/MGLScaleBar.mm
index 1216e400b3..cd88c1e08e 100644
--- a/platform/ios/src/MGLScaleBar.mm
+++ b/platform/ios/src/MGLScaleBar.mm
@@ -220,6 +220,12 @@ static const CGFloat MGLFeetPerMeter = 3.28084;
self.row = [self preferredRow];
+ CGSize size = self.intrinsicContentSize;
+ self.frame = CGRectMake(CGRectGetMinX(self.frame),
+ CGRectGetMinY(self.frame),
+ size.width,
+ size.height);
+
[self invalidateIntrinsicContentSize];
[self setNeedsLayout];
}
diff --git a/platform/ios/src/Mapbox.h b/platform/ios/src/Mapbox.h
index 9a9dc702ca..67a26e8ed4 100644
--- a/platform/ios/src/Mapbox.h
+++ b/platform/ios/src/Mapbox.h
@@ -19,6 +19,7 @@ FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[];
#import "MGLDistanceFormatter.h"
#import "MGLFeature.h"
#import "MGLGeometry.h"
+#import "MGLLight.h"
#import "MGLMapCamera.h"
#import "MGLMapView.h"
#import "MGLMapView+IBAdditions.h"
diff --git a/platform/ios/test/MGLAnnotationViewIntegrationTests.swift b/platform/ios/test/MGLAnnotationViewIntegrationTests.swift
new file mode 100644
index 0000000000..82a57a4009
--- /dev/null
+++ b/platform/ios/test/MGLAnnotationViewIntegrationTests.swift
@@ -0,0 +1,23 @@
+import XCTest
+import Mapbox
+
+class CustomAnnotationView: MGLAnnotationView {
+
+ override init(reuseIdentifier: String?) {
+ super.init(reuseIdentifier: reuseIdentifier)
+ }
+
+ required init?(coder aDecoder: NSCoder) {
+ super.init(coder: aDecoder)
+ }
+
+}
+
+class MGLAnnotationViewIntegrationTests: XCTestCase {
+
+ func testCreatingCustomAnnotationView() {
+ let customAnnotationView = CustomAnnotationView(reuseIdentifier: "resuse-id")
+ XCTAssertNotNil(customAnnotationView)
+ }
+
+}
diff --git a/platform/ios/test/MGLAnnotationViewTests.m b/platform/ios/test/MGLAnnotationViewTests.m
index c0978eaf65..fc4f35a9e1 100644
--- a/platform/ios/test/MGLAnnotationViewTests.m
+++ b/platform/ios/test/MGLAnnotationViewTests.m
@@ -3,11 +3,24 @@
static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer";
+@interface MGLCustomAnnotationView : MGLAnnotationView
+
+@end
+
+@implementation MGLCustomAnnotationView
+
+- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
+ return [super initWithReuseIdentifier:@"reuse-id"];
+}
+
+@end
+
@interface MGLAnnotationView (Test)
+
@property (nonatomic) MGLMapView *mapView;
@property (nonatomic, readwrite) MGLAnnotationViewDragState dragState;
-
- (void)setDragState:(MGLAnnotationViewDragState)dragState;
+
@end
@interface MGLMapView (Test)
@@ -79,13 +92,19 @@ static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReu
XCTAssertNil(_annotationView.annotation, @"annotation property should be nil");
}
+- (void)testCustomAnnotationView
+{
+ MGLCustomAnnotationView *customAnnotationView = [[MGLCustomAnnotationView alloc] initWithReuseIdentifier:@"reuse-id"];
+ XCTAssertNotNil(customAnnotationView);
+}
+
- (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id<MGLAnnotation>)annotation
{
MGLAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:MGLTestAnnotationReuseIdentifer];
if (!annotationView)
{
- annotationView = [[MGLAnnotationView alloc] initWithReuseIdentifier:MGLTestAnnotationReuseIdentifer];
+ annotationView = [[MGLAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MGLTestAnnotationReuseIdentifer];
}
_annotationView = annotationView;