Commit Graph

580 Commits

Author SHA1 Message Date
Ivo van Dongen
ca0f2f925d [darwin] arbitrary offline region geometries 2018-08-20 22:49:01 +03:00
Jason Wray
790b9f5c82 [ios] Add experimental frame rate measurements to MGLMapView
Includes: average frame rate, average frame render duration, and instantaneous frame render duration.
2018-08-16 16:46:54 -04:00
Jason Wray
ec7b920603 [ios] Standardize exception definitions 2018-08-09 13:35:28 -04:00
Jason Wray
a84d59f2a2 [ios] Add MGLMapViewDecelerationRate typed enum
Improves Swiftiness by allowing type-omission, à la `mapView.decelerationRate = .fast` and such.
2018-08-09 11:05:20 -04:00
Fabian Guerra
62fb7e1987 [ios] Fix location manager null reset. 2018-08-01 10:21:34 -07:00
Jason Wray
885f6e3c02 [ios] Add preferred FPS setting; vary maximum FPS by device capability
- Add `MGLMapView.preferredFramesPerSecond`, which can be set with the provided `MGLMapViewPreferredFramesPerSecond` enum values or directly with an integer.
- Adaptively set the preferred FPS based on the capabilities of the device: the oldest and least powerful devices are now capped at 30 FPS, which results in a more consistent/smoother experience.
2018-07-31 15:20:05 -04:00
Jason Wray
cdd3553641 [darwin] Use FOUNDATION_EXTERN instead of plain extern
FOUNDATION_EXTERN is an alias for extern in most cases, but also covers us in the event that a method could be mismangled by the compiler as C++ (when we want C-style mangling, for Obj-C compatibility).
2018-07-24 18:14:32 -04:00
Fabian Guerra Soto
681e0141de [ios] Mapbox's Location Manager new API. (#12013)
* [ios] The new location manager API provides two new protocols MGLLocationManager and MGLLocationManagerDelegate to handle the location cycle and updates respectively. This enables developers to chose the appropriate location provider according to their needs, or transition between outdoors/indoors location updates.

It does provide a default implementation based on CLLocationManager.
2018-07-20 14:14:43 -07:00
Lloyd Sheng
284dd23ca4 [iOS] Fix unbalanced change delimiter crash (#12148)
Fixed a crash that occurred when the user started a gesture before the drift animation for a previous gesture was complete.
2018-07-18 14:29:06 +08:00
Julian Rex
3710ef8810 [iOS] Update annotation view touch handling (with offsets) (#12234) 2018-07-09 10:01:11 -04:00
Bobby Sudekum
4286d5869c Add pitch argument to cameraThatFits functions (#12213) 2018-07-02 16:30:18 -07:00
Randall Lee
5a837c1702 [ios] Add custom events library start-up delay (#12088)
* [ios] Add custom delay 

Adds a custom delay to the events library initialization. This is only active when using certain profile configurations.

* [ios] events library version update to v0.4.1

* Update Events Library to include missing MGL_EXPORT

* Add MMEEventsService files to Events Lib Submodule

* Change delayTime type to int64_t
2018-06-08 14:39:43 -07:00
Jason Wray
a721b74b87 [ios] Use 'Recognized' state for tap gesture handlers
Tap gestures have no `Began`/`Ended` states — they can only be `Possible` or `Recognized`.
2018-06-01 13:43:50 -04:00
Julian Rex
9e4a16d7ee [ios] Updated MGLScaleBar to use rendered UIImages instead of MGLScaleBarLabel (#11921) 2018-05-24 10:29:56 -04:00
Jason Wray
eba90df5bd [ios] Use standard callout positioning for unanimated user location changes
Animated changes to the position of the user location annotation view still need to also handle updating its callout view, otherwise the two can become out of sync.
2018-05-22 16:01:16 -04:00
Julian Rex
bef2a7ccb6 [ios,macos] Fix for infinite loop crash when setting shape to nil in MGLMapViewDelegate methods (#11614) 2018-05-21 14:14:58 -04:00
Fabian Guerra
30376f3ce1 Merge branch 'release-boba' into master
# Conflicts:
#	mapbox-gl-js
#	platform/android/CHANGELOG.md
#	platform/android/MapboxGLAndroidSDK/gradle.properties
#	platform/android/gradle/dependencies.gradle
#	platform/darwin/src/MGLVectorTileSource.mm
#	platform/darwin/src/MGLVectorTileSource_Private.h
#	platform/ios/CHANGELOG.md
#	src/mbgl/style/expression/compound_expression.cpp
2018-05-17 11:47:31 -04:00
Jason Wray
ee10088702 [ios] Fix MGLAnnotationView.rotatesToMatchCamera clobbering other transforms 2018-05-08 18:26:11 -04:00
Fabian Guerra Soto
a425995189 [ios, macos] Add to-rgba expression operator. (#11725)
* [ios, macos] Add expression support to to-rgba operator.

* [ios, macos] Update style docs.

* [ios, macos] Refactored to-rgba to to-color.

* [ios, macos] Add support for to-rgba expression operator.

* [ios, macos] Add multiple parameters support to to-color operand.

* [ios, macos] Enable to-rgba operator for MGLColor or key path expressions.

* [ios, macos] Update predicates and expressions guide to reflect cast changes.

* [ios, macos] Update changelogs.

* [ios, macos] Clarify color casting usage.
2018-05-07 12:01:29 -04:00
Fabian Guerra Soto
a365dd11da [ios, macos] Make NSPredicate+MGLAdditions public. (#11810) 2018-05-04 15:09:07 -04:00
Julian Rex
1b9c8b5ca7 [ios] Switched to use center property (instead of frame) when repositioning annotation views (when adding back into queue). (#11817) 2018-05-03 20:36:37 -04:00
Jason Wray
5a147f6335 [ios, macos] Fix possible retain cycles in blocks
Prompted by enabling CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF.
2018-04-27 18:06:42 -04:00
Jason Wray
c067865e7b [ios, macos] Update minimum deployment versions to iOS 9, macOS 10.11 (#11776)
* [ios] Remove iOS 8 conditionals

* [ios, macos] Bump pod deployment targets

* [ios, macos] Add changelog entries

* [ios, macos] Update docs

* Remove unnecessary selector-based version checks

* Update SQLite note

* [ios, macos] Replace lightweight generics macros with direct use
   Lightweight generics for Foundation collections are available everywhere with the bump to iOS 9 and macOS 10.11.

* Update deprecated macOS method
2018-04-27 12:25:49 -04:00
Julian Rex
5b5549d644 [ios, macos] Fix for camera movement when selecting visible annotations (#11731) 2018-04-24 11:01:04 -04:00
Jason Wray
fa6c6a3733 [ios] Mark -metersPerPixelAtLatitude: as unavailable
This deprecated method has its implementation removed in 4.0.0 but was not marked as unavailable.
2018-04-23 16:05:19 -04:00
Julian Rex
2e22593962 [ios] Mark -presentCalloutFromRect:inView:constrainedToView:animated: unavailable (#11738) 2018-04-19 15:47:58 -04:00
Jason Wray
72473cf6f6 [ios] Mark unused parameter of -[MGLMapView reloadStyle:] as nullable 2018-04-17 19:22:26 -04:00
Jason Wray
d4e597eb94 [ios, macos] Convert various class methods to class properties
This improves the Swift interface while having no effect on Obj-C usage.
2018-04-16 18:42:34 -04:00
Jason Wray
0529c018f3 [ios] Remove more deprecated bits for release-boba 2018-04-16 18:28:31 -04:00
Jason Wray
be3fc4413a [ios] Change MGLAnnotationView.scalesWithViewingDistance default value to NO 2018-04-12 16:49:30 -04:00
Minh Nguyễn
9faed7293b [ios, macos] Eliminated MGLAbstractShapeSource
MGLComputedShapeSource is now a direct subclass of MGLSource and sibling of MGLShapeSource.
2018-04-02 10:42:54 -07:00
Minh Nguyễn
a877b6dbe8 [ios, macos] Renamed MGLVectorSource to MGLVectorTileSource 2018-04-02 10:42:54 -07:00
Minh Nguyễn
29a8efab26 [ios, macos] Renamed MGLRasterSource to MGLRasterTileSource
Also updated various source class listings to reflect the addition of image and raster DEM sources.
2018-04-02 10:42:54 -07:00
Minh Nguyễn
59e92904c3 Eviscerate mbgl expression to Foundation JSON object conversion (#11389)
* [ios, macos] Eviscerate mbgl expression to Foundation JSON object conversion

* [ios, macos] Remove literal special case

MGLJSONObjectFromMBGLValue() is just a literal translation from C++ types to Foundation types; no need for expression-specific literal wrapping.

* [ios, macos] Implemented RGB(A) operators

* [ios, macos] More robust color conversion

* [macos] Create calibrated RGB from expression on Sierra

* [macos] Calibrate colors in expressions at runtime

* [ios, macos] Special-case number conversion without fallbacks

* [ios, macos] Test mgl_number expressions

* [ios, macos] Updated tests for aftermarket expressions

* [ios, macos] Relax roundtripping requirement for serialize()

* [ios, macos] Fixed interpolation expression tests

* [ios, macos] Removed dead code

* [ios, macos] Fixed color conversion on Sierra
2018-03-30 16:43:55 -07:00
Julian Rex
d4f2bc07ca [ios,macos] Selecting offscreen annotation pans map to fit annotation & callout view (#3249, #9790) 2018-03-21 13:51:10 -04:00
Jason Wray
d37edadacb [ios] Fix pinch drift ignoring delegate camera change response 2018-03-14 15:46:31 -04:00
Jason Wray
2230af1425 [ios] Improved heading indicator arrow visibility 2018-03-14 15:46:00 -04:00
Lloyd Sheng
4404a2669b [ios, macos] Fix an issue where a wrong annotation may selected if annotations were set close together (#11438)
* [ios] Fix an issue where wrong annotation may selected when annotations very close #10734

* [macos] Fix an issue where a wrong annotation may selected if annotations were set close together

* update the iOS change log and the macOS change log

* Fix an issue where the comment referenced to the wrong variable name
2018-03-13 11:26:15 -07:00
Jason Wray
4919099ea9 [ios] Add MGLMapView.showsScale to control scale bar visibility (#11335)
- Fixes scale bar not being visible until a camera change event.
- Adds IBInspectable for scale bar visibility.
- Add tests of the scale bar being added to the map view
2018-03-02 13:13:57 -05:00
Jason Wray
68a9e2ea92 [ios] Provide haptic feedback when user rotates to due north 2018-02-27 18:27:42 -05:00
Minh Nguyễn
0525fd1e4a [ios, macos] Unwrap coordinate bounds
Updated coordinate bounds conversion methods to use the beyond-±180 method to indicate that the bounds extends beyond the antimeridian. Also copyedited conversion documentation.
2018-02-21 10:05:30 -08:00
Jason Wray
00abd2eaa6 [ios] Fix loop when first asking for location permission (#11229) 2018-02-20 14:23:42 -05:00
Jesse Bounds
2e3145db47 Replace embedded telem implementation with mapbox-mobile-events library (#10698)
* [ios] Introduce mobile events dependency

This adds the mobile events dependency including the events library's namespaced header file so that the related compiled symbols are prefixed to make them specific to the maps SDK. A pre-compiled header file is added so that the namespaced header file is added in all places where it is needed (most importantly every events library file).

* [ios] Use new events library for telemetry events

This makes the following significant changes:

Refactors the MGLMapboxEvents singleton to delegate internally to an instance of MMEEventsManager that it keeps for itself. The MGLMapboxEvents public API is refactored to reflect this. Note: MGLMapboxEvents continues to handle checking for opt out

Uses that new events API in MGLMapboxEvents to send all telem events (and turnstile)

All embedded certs are removed since the new telem library uses public key info pinning

Legacy telemetry utility classes for location and networking are removed since those are implemented in the telem library

* [ios] Update submodules initialized by cmake

We no longer bring in SMCalloutView as a submodule so it is removed.
We now vendor the telemetry events library as a submodule so it is added.

* Update mapbox-mobile-events

* Update mobile events lib

* Set events options with MGL user defaults values

For options that historically could be set with user defaults in the Maps SDK, collect them and set the appropriate property values in the new events library.

Also, check the existence of two new optional configuration values MGLTelemetryAccessToken and MGLTelemetryBaseURL so that the events endpoint and access token can be configured and the access token can easily be set dynamically and apart from the access token for the maps API.

MGLTelemetryBaseURL replaces the legacy MGLTelemetryTestServerURL. This is ok because this value was never intended to be used by client applications. The new name better reflects the fact that the URL can be changed to any backend stack, not just a test server.

Because it is possible for the configuration values to be read from user defaults before the events manager is fully set up, this also adds a local cache for the baseURL and accessToken values so that they can be stored and applied once it is time to setup the the events manager.

* Update mapbox-mobile-events

mapbox-mobile-events was forced pushed to include https://github.com/mapbox/mapbox-events-ios/pull/28

* Rename MGLMapboxEvents singleton access method

Manager is not in the name of the class. Just call it an instance.

* Update mapbox-mobile-events

* Add comments about config value loading

* Guard against creating events for IB

* Refactor user defaults update handler

This updates the handling logic for user defaults to break apart config changes that require a check for pausing or resuming the events lib’s telemetry collection from config changes that can happen with no update to the pause/resume state.

It also ports the optimization from https://github.com/mapbox/mapbox-gl-native/pull/10803 so that the call to pause and resume is not performed unless the user defaults store has new values that have not yet been applied to the events library.

* Update mapbox-mobile-events

* Rename events submodule folder

* Fix incorrect events library refs

* Update mapbox-mobile-events

* Update user user agent id value

This value aligns with our schme of {source-sdk-platform} and will be used by the events library in the user agent and vendorid.

* Update mapbox-mobile-events

Pin to v3.0.0 (d522b18)

* Improve code comments

* [ios] Fixed a broken file reference to MGLTelemetryConfig.
2018-02-20 09:54:11 -05:00
Jordan Kiley
9459cf6a91 [ios, macos] Mark deprecated methods as unavailable (#11205)
Fixes #10735
2018-02-16 16:20:08 -08:00
Fabian Guerra
903e7989ec Merge branch 'master' into release-boba
# Conflicts:
#	platform/android/CHANGELOG.md
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java
#	platform/android/scripts/exclude-activity-gen.json
#	platform/ios/CHANGELOG.md
#	platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec
#	platform/ios/Mapbox-iOS-SDK-symbols.podspec
#	platform/ios/Mapbox-iOS-SDK.podspec
#	platform/macos/CHANGELOG.md
2018-02-15 11:54:51 -05:00
Vladimir Agafonkin
82de856c94 [core, ios, macos, android, node] Heatmap layer (#11046)
Co-Authored-By: Konstantin Käfer <mail@kkaefer.com>
Co-Authored-By: Anand Thakker <anandthakker@users.noreply.github.com>
Co-Authored-By: Minh Nguyễn <1ec5@users.noreply.github.com>
2018-02-15 17:38:23 +02:00
Chris Loer
d4df044ffe [ios] Release cached tiles on entering background.
Retain current render tiles for fast restart.
Waiting for a memory warning doesn't work because we can't make GL release calls once we're in the background.
2018-02-14 10:55:16 -08:00
Chris Loer
a11b277bc1 [core] Rename "onLowMemory" to "reduceMemoryUse".
Android still calls "reduceMemoryUse" only while handling a low memory event.
iOS, on the other hand, calls "reduceMemoryUse" every time it enters the background.
2018-02-14 10:55:16 -08:00
Fabian Guerra
b68266953f Merge tag 'ios-v3.7.4' into master
# Conflicts:
#	include/mbgl/style/conversion/tileset.hpp
#	include/mbgl/util/tileset.hpp
#	platform/android/CHANGELOG.md
#	platform/android/MapboxGLAndroidSDK/gradle.properties
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
#	platform/ios/CHANGELOG.md
#	platform/ios/ios.xcodeproj/project.pbxproj
#	platform/macos/CHANGELOG.md
#	src/mbgl/layout/symbol_projection.cpp
#	src/mbgl/renderer/tile_pyramid.cpp
#	src/mbgl/style/conversion/tileset.cpp
2018-02-13 11:40:40 -05:00
Julian Rex
9ee99c91bb [ios] Adds camera change delegate methods with reason parameter. (#11151)
Added missing notification handler for UIApplicationWillResignActiveNotification.
2018-02-12 16:37:21 -05:00