Commit Graph

715 Commits

Author SHA1 Message Date
Thomas Moenicke
b64ed75444 [build] Adding a build flag to build without GL if needed (#16120)
* [build] Adding a build flag to build without GL if needed

* [build] Moving custom layer to mbgl/gl
2020-02-03 19:10:57 +02:00
m-stephen
f9b7284276 [ios, macos]Remove iOS/macOS codes from native codes (#16031)
* add source/header

* add ios files

* add configs

* modify name

* http_file_source

* add interface delegate when map init

* fix name

* fix delegate name

* support mac os

* add mac os support

* make optional delegate when mac os

* mac/ios difference

* add ios change log

* cancel iOS/mac OS judgement

* cancel iOS/mac OS judgement

* cancel judgement in .m

* update

* update

* update http_file_source

* update ios

* update mac os

* add mac os file

* add mac os file to `.cmake`

* change names

* add log & fix format

* reset changelog commit

* update changelog

* rename iOS network manager

* Add a test configuration(same as default configuration) when mac os run tests

* re-add account type into `http_file_source`

* refactor
2019-12-14 13:38:46 +08:00
Fabian Guerra Soto
5c565a5e51 [ios] Fixes an issue that caused the ornaments ignore contentInset property. (#15584)
* [ios] Add mapView content inset tests.

* [ios] Fix an issue that caused the ornaments ignore the contentInsets.

Fixed an issue that caused ornaments ignore the contentInset. Added a new property automaticallyAdjustContentInset that has the same purpose as UIViewController. automaticallyAdjustsScrollViewInsets. This was changed due to the latter being deprecated.

* [ios] Fix automaticallyAdjustsScrollViewInsets legacy behavior.

The property automaticallyAdjustsScrollViewInsets overrode automaticallyAdjustsScrollViewInsets which caused a breaking change. This is fixed to consider the legacy property when calculating the content insets and added tests for both cases.

* [ios] Fix the contentInset value after adding padding to the camera.

Fixed an issue that caused a discrepancy between the contentInset in MGLMapView and the padding in the transformation state.

When padding is passed through methods such as setCamera it’s persisted. This fix resets the contentInsets.

* [ios] Fix pinch test.

* [ios] Update automaticallyAdjustsScrollViewInsets name and documentation.

* [ios] Update changelog.
2019-10-04 17:13:00 -07:00
Julian Rex
cab756374f [ios] Fix layout of Scale bar components (#15703)
* [ios] Add failing tests for scale bar updates.

* [ios] Remove borderLayer

* [ios] Ensure bar sections have non-fractional width

* [ios] Add RTL override

* [ios] Update constraints/layout

* [ios] Invalidate scalebars size, after the parent's layout has happened (to ensure the view dimensions are correct when re-laying out the scale bar.

* [ios] Refactor layout

* [ios] Update changelog / remove commented code.

* [ios] Remove whitespace

* [ios] Stop integration tests asserting (when scale bar is hidden). Also reduces the # of calculations (since updateConstraints and layoutSubviews can be called outside of our control).

* [ios] Moves declaration of properties for testing.

* [ios] Removes redundant property attribute

* [ios] Updated change log
2019-10-04 11:15:20 -04:00
m-stephen
8128d709b6 [ios]Add errors reporting (#15391)
* add errors reporting

* [ios] report error if rendering takes > 1 second. (#15633)
2019-09-20 10:14:44 +08:00
Thiago Marcos P. Santos
1304502f81 [build] Fix iOS nits
- Hardcoded the bundle identifier on Info.plist, CMake is not
  picking it up.
- Do not use installed headers when building the framework.
2019-09-17 12:28:55 +03:00
Mikhail Pozdnyakov
8af78ddbb9 [core] Update MapObserver::onDidFinishRenderingFrame() API 2019-09-12 00:40:08 +03:00
Jason Wray
45140af7cb [ios] Refactor way location permissions are requested 2019-09-09 17:25:42 -07:00
Jordan Kiley
39af6b48c5 [ios] Remove feature flag for rotation threshold (#15562) 2019-09-04 14:35:56 -07:00
Fabian Guerra Soto
74d6fdb533 [ios, macos] Fix content inset documentation. (#15552) 2019-09-04 12:18:22 -07:00
m-stephen
b07217bbdd [ios] Fix compass font weight being too light on iOS 13 2019-09-04 11:29:05 -07:00
Nadia Barbosa
2984535804 [ios] Allow MGLScaleBar to support dark mode on iOS 13
Add changelog PR link
2019-08-30 13:48:05 -07:00
Ander Conselvan de Oliveira
21632a66f8 [core] Remove programCacheDir parameter from ProgramParameters
Binary shader support has been removed in commit c2f974f2a5 ([core]
Remove binary shader support). This left-over parameter is not used
anywhere anymore.
2019-08-27 16:23:48 +03:00
Julian Rex
4010b1d256 [ios] Added pending completion blocks (#15122) 2019-08-25 01:02:29 -04:00
Fabian Guerra Soto
5c066f874c [ios] Improve tilt gesture recognizer detection. (#15349)
* [ios] Improve tilt gesture recognizer detection.

* [ios] Update tilt gesture detection angles.

* [ios] Fix a delay at the beginning of the drag gesture.

* [ios] Update tilt gesture recognizer tests.

* [ios] Update changelog.

* [ios] Add horizontal tilt gesture test.

* [ios] Addresses review feedback.

* [ios] Add comments to clarify the tilt gesture initialization.
2019-08-23 17:59:38 -07:00
Mikhail Pozdnyakov
ef3d04dee5 [core] Export symbol placement update status from MapObserver 2019-08-23 10:56:05 +03:00
Nadia Barbosa
7b25cb1092 [ios, macos] Clarify current best practices with animated camera changes 2019-08-22 21:54:05 -07:00
Jason Wray
0e57c7de44 [ios] Refactor NSUserDefaults key variable names 2019-08-21 12:14:20 -07:00
Jordan Kiley
6f78560f24 [ios] Add threshold for triggering the rotate gesture recognizer (#14929) 2019-08-20 22:12:08 -07:00
Jordan Kiley
5d1ed5d941 [ios] Fix bug where scale bar shows 0 mm instead of 0 (#15381) 2019-08-20 10:48:26 -07:00
Julian Rex
90e26244a5 [ios] Removes mismatched function declaration. (#15423) 2019-08-20 11:55:18 -04:00
Julian Rex
c0cd8d021d [ios] Adds annotation selection tests with rotation & scaling of the map (#15123) 2019-08-20 10:51:14 -04:00
Jordan Kiley
acfcd5c29c [ios] Document how scale bar visibility is determined (#15304)
* [ios] document scale bar visibility

* [ios] finished trailing sentence
2019-08-05 10:48:54 -07:00
Heather Stenson
5f6f20e667 [ios, macos] Change "map ID" to "tileset ID" (#15116)
* map id --> tileset id

* styles map id -> style url

* update changelog
2019-07-16 18:36:07 -07:00
Aleksandar Stojiljkovic
d968cbba15 [ios][macos] Fix center coordinate incorrect after pinch gesture
To changelog:
Fixed incorrect center coordinate after pinch regression caused by edge insets fix (#14664).

While working on #14664, missed to understand the logic used in

```
                CLLocationCoordinate2D centerCoordinate = _previousPinchCenterCoordinate;
                mbgl::EdgeInsets padding { centerPoint.y, centerPoint.x, self.size.height - centerPoint.y, self.size.width - centerPoint.x };
                self.mbglMap.jumpTo(mbgl::CameraOptions()
                                        .withCenter(MGLLatLngFromLocationCoordinate2D(centerCoordinate))
                                        .withPadding(padding));

```

Replacing this code by moveBy achieves the required translation.

Fixes: #14977, #15082
2019-07-14 22:20:56 +03:00
Jason Wray
5b488225fb [ios] Add MGLCompassButton and MGLOrnamentVisibility 2019-07-11 16:06:54 -07:00
Fabian Guerra Soto
12e0a6b0c6 [ios] Add removeStyleImage to MGLMapView (#14769)
* [ios] Add shoulRremoveStyleImage to MGLMapViewDelegate.

* [ios] Changelog update.

* [ios, macos] Update shouldRemoveStyle method documentation.
2019-07-02 16:33:09 -07:00
Jason Wray
e26a60d0c9 [ios] Remove previously deprecated unavailable methods and properties 2019-06-26 13:36:30 -07:00
Jason Wray
8a9567e072 [ios, macos] Deprecate methods in favor of new completion handler versions 2019-06-26 12:18:22 -07:00
Minh Nguyễn
f7f74a6deb [ios, macos] Added completion handlers to animated MGLMapView methods 2019-06-21 17:45:36 -07:00
Jason Wray
b98dbd2121 [ios] Require two fingers for duration of tilt gesture 2019-06-20 10:33:32 -07:00
Alf Watt
9ebd831e32 [ios] Integrate Mapbox Mobile Events 0.9.4 (#14868)
* [ios] Mapbox Events 0.9.4

* Run `scripts/generate-file-lists.js`

* Explicitly use the shared manager instead of init

* There can be only one `Scripts`
2019-06-06 13:43:23 -07:00
Jason Wray
bd3d19f5bd [ios] Update libmbxaccounts for navigation SDK override (#14802)
* Use a stringy selector... yerg.
* Bump to libmbxaccounts 1.0.0
2019-06-05 23:13:34 -07:00
Alexander Shalamov
a71ccae141 [ios] Add integtation test that verifies MGLMapViewImpl size 2019-06-05 00:03:13 -07:00
Alexander Shalamov
0ba0b8c040 [ios] Calculate size of a MGLMapViewOpenGLImpl renderable from MGLMapView bounds
Fixes: #14807
2019-06-05 00:03:13 -07:00
Jason Wray
015a64b2a2 [ios] Fix undeclared selector warning in MGLAnnotationView
`setCoordinate:` isn't available to regular MGLAnnotation, only MGLPointAnnotation.
2019-06-03 16:49:42 -07:00
Fabian Guerra Soto
402645109f [ios] Fix content insets with custom edge padding. (#14813)
* [ios] Fix content insets with custom edge padding.

* [ios, macos] Consolidated edge insets math

* [macos] Add content insets to edge padding when setting camera

* [ios, macos] Updated changelogs

* [ios, macos] Clarify setCamera:withDuration:animationTimingFunction:edgePadding method documentation.
2019-06-03 07:32:20 -07:00
Aleksandar Stojiljkovic
1637a4b694 [ios] Content insets border case fix and comment.
Allows changing camera when user duplicates content insets.

Related to previous patch and comment:
https://github.com/mapbox/mapbox-gl-native/pull/14664#pullrequestreview-243004376
Thanks @1ec5
2019-06-03 08:55:39 +03:00
Konstantin Käfer
9eb43a587b [ios,macos] refactor MGLMapViewImpl 2019-05-29 18:27:42 +02:00
Aleksandar Stojiljkovic
e5431d0181 Asymmetric viewport changelog entry
Check edge insets difference, in addition to isEqualToMapCamera in all the places in MGLMapView before map.easeTo/map.flyTo.
2019-05-28 14:38:01 +03:00
Aleksandar Stojiljkovic
9809c9f8f5 [core] Offset viewport center when edge insets are specified
The change is implemented in TransformState::getProjMatrix, the rest of the code is making sure that existing API contracts stay and there are tests verifyingrendering and render query processing only items within screen and given tolerance around screen edges.

MapView: don't bake edge insets into relalculated camera center. Keep edge insets as property of camera in TransformState (similar to pitch, zoom, bearing) independent from specified camera center. Interpolate edge insets in animation.

iOS Demo app: "Turn On/Off Content Insets" pitch the camera and navigate to convenient location in Denver, where streets are parallel to cardinal directions, to illustrate viewport center offset when edge insets are set.

Tests:
ViewFrustumCulling: although Annotations are deprecated, queryRenderedFeatures related tests in Annotations would need to get ported and decided to add the edge insets related query tests next to them. Verify frustum culling (render+queryRenderedFeatures) With different camera and edge insets setups. TODO: port Annotations tests.

Transform.Padding: Verify that coordinates take proper place on screen after applying edge insets.

LocalGlyphRasterizer: verify text rendering when applying padding.

Related to #11882: both use projection matrix elements [8] and [9].

Alternative approach to this was to increase and offset map origin so that the screen would be a sub-rectangle in larger map viewport. This approach has a drawback of unecessary processing the items that are outside screen area.

Fixes #12107, #12728, navigation-sdks/issues/120
2019-05-28 14:38:01 +03:00
Jason Wray
29140f5b11 [ios] Enable SKU tokens for all requests
Removes conditional code that relied on a plist flag. Other small cleanups.
2019-05-20 22:49:50 -07:00
Jason Wray
6e92ca5de3 [ios] Update to libmbxaccounts 0.0.5 (#14683) 2019-05-16 09:43:42 -04:00
Sam Fader
163c085c38 [ios, macos] clarified documentation for newCamera param of the shouldChangeFromCamera delegate (#14680)
* [ios, macos] clarified documentation for newCamera in shouldChangeFromCamera

* [ios, macos] clarified documentation for newCamera param of the shouldChangeFromCamera delegate part 2
2019-05-15 18:30:28 -07:00
Thiago Marcos P. Santos
06f1dc48a2 [core] Make the BackgroundScheduler a singleton
- Do not carry it over everywhere as parameter, it is a shared
  instance anyway and the lifecycle is pretty much the app lifecycle
  from the moment we instantiate a map.
- Rename to BackgroundScheduler because it is a Scheduler that will
  do tasks in the background, we don't make assumptions if it is a
  thread pool or a single thread.
- Most importantly, remove the dependency from `core` on `platform`.
2019-05-10 14:20:38 +03:00
Jason Wray
49b8e0a626 [ios] Remove obsolete telemetry gesture events 2019-05-09 14:52:44 -07:00
Minh Nguyễn
e69efb996d [ios] Interpret negative direction as unchanged when setting visible coordinates (#14575)
* [ios] Fixed negative direction when setting visible coordinates

* [ios] Document behavior of negative direction
2019-05-03 09:02:03 -07:00
Julian Rex
f7915fdc51 [ios] Static analysis fix tweaks - part 2 (#14572) 2019-05-02 14:08:48 -04:00
Julian Rex
9bd59bf041 [ios, macos] Fixes for static analyzer warnings (#14453) 2019-04-30 17:08:37 -04:00
Julian Rex
b15b78346f [ios] Check for valid superview to avoid crash on iOS 9 (#14529) 2019-04-30 16:11:14 -04:00