Commit Graph

229 Commits

Author SHA1 Message Date
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
Nadia Barbosa
3e4afbc788 [iosapp] Move token setting to build script
[ios] Switch to script-based token insertion for benchmarking app

[ios] Update Developing.md

[iosapp, benchmark app] Look for token file outside of version-controlled directory

[iosapp, benchmark app] Remove remaining code for access token checking from app delegates

Feedback edits for @friedbunny
2019-05-01 18:30:46 -07:00
Julian Rex
9bd59bf041 [ios, macos] Fixes for static analyzer warnings (#14453) 2019-04-30 17:08:37 -04:00
Jason Wray
7263c7973b [ios] Remove events=true from new SKU requests 2019-04-29 15:12:38 -07:00
Fabian Guerra Soto
8389e746b6 [ios, macos] Add Mapbox Maps SDK metrics manager. (#13997)
Added MGLSDKMetricsManager to keep track of SDK related events such as tile download times.

* [ios, macos] Add tile download performance event.

* [ios, macos] Modify the performance event format.

* [ios, macos] Add Mapbox Maps SDK events manager.

* [ios, macos] Remove events delegate.

* [ios, macos] Remove deprecated macro.

* [ios, macos] Rename MGLEventsManager to MGLMetricsManager.

* [ios, macos] Make MGLMetricsDelegate follow delegate convention.

* [ios, macos] Remove mbgl-filesource target dependency on MGLMetricsManager.

* [ios, macos] Update metrics manager documentation.

* [ios, macos] Add device metadata.

* [ios, macos] Rename MGLMetricsManager to MGLSDKMetricsManager.
2019-04-09 16:10:14 -07:00
Jordan Kiley
1aa705c2f6 [ios] Add iOS bindings and example for missing icons event. (#14302)
Added a new mapView delegate method that allows reload a style icon in case it couldn't load it from the style.

Added an iosapp test example.
2019-04-03 12:37:56 -07:00
Langston Smith
42144ce1dc [android, iOS, macOS] Adding Galician translation from Transifex (#14095)
* [android] adding galician strings

* [ios] adding galician strings

* [ios, macos] Added Galician localization to Xcode projects

* [ios, macos] Converted Galician localization to UTF-8

* [android, ios, macos] Updated changelogs
2019-03-13 09:42:52 -07:00
Lloyd Sheng
60ceac5efc [iOS] Enable developers to change position of ornaments (#13911)
* APIs for change position of ornaments

* Use anchors APIs and emove iOS8 layout code

* Add ornaments layout tests
2019-03-11 23:06:16 +08:00
Jason Wray
1c99b199c6 [ios] Fix string-bool casting warning in MBXOfflinePacksTableViewController 2019-02-14 10:51:49 -08:00
Julian Rex
5ba4a6a980 [ios] Reverts "Enable customize positions of mapview ornaments (#13556)" (#13870)
This reverts commit e22d28c285.
2019-02-05 13:50:12 -05:00
Lloyd Sheng
e22d28c285 [ios] Enable customize positions of mapview ornaments (#13556)
* APIs for customize positions of ornaments

* Adopt anchors layout

* Remove iOS8 layout code
2019-01-30 15:39:29 +08:00
Fabian Guerra Soto
7069ecb2a1 [ios, macos] Add Czech and Hungarian translations. (#13782)
Added Czech translations.
2019-01-23 14:08:35 -08:00
Minh Nguyễn
6ca2f6c97f [ios] Display map on connected displays
Whenever an external display is connected, show a map synchronized with the main map on the main display.
2019-01-14 15:07:43 -08:00
tobrun
4e86bca5ab [all] - update licenses to 2019 2019-01-04 08:58:09 +01:00
Chris Loer
387fa1800f [ios, macos] Add "includesIdeographicGlyphs" option to MGLOfflineRegion. 2018-12-21 15:13:48 -08:00
Jason Wray
7cdbe6664a [ios, macos] Update for streets-v8 data and coalesced name fields in v11 styles 2018-12-07 21:46:46 -05:00
Jason Wray
46edc91656 [ios] Reorganize iosapp debug settings 2018-11-27 14:39:41 -05:00
Jason Wray
c7f9f1582f [ios] Add frame duration graph view to iosapp 2018-11-27 14:39:29 -05:00
Julian Rex
53bbf9d699 [ios] Added teardown of core objects when receiving UIApplicationWillTerminateNotification (#13367) 2018-11-20 14:31:09 -05:00
Jason Wray
ddcecdf7f7 [darwin] Rename variables to avoid shadow declarations
Per GCC_WARN_SHADOW.
2018-11-20 11:48:18 -05:00
Fabian Guerra Soto
c8fbcfd322 [ios, macos] Logging. (#13235)
* [ios, macos] Update the logging subsystem to platform agnostic.

* [ios, macos] Add coordinate to string function.

* [ios, macos] Add BOOL to string function.

* [ios, macos] Add tracing logs.

* [ios, macos] Add tracing logs to generated style classes.

* [ios, macos] Split logging categories accordingly to MGLLoggingLevel.

* [ios, macos] Log network requests.

* [ios, macos] Migrate NSAssert to MGLAssert.

* [ios, macos] Include MGLLoggingConfiguration to filesource-files.txt.

* [ios, macos] Fix logger string specifier for the line parameter.

* [ios, macos] Add logs to shapes classes.

* [ios, macos] Add logs to offline classes.

* [ios, macos] Add logs to annotation classes.

* [ios, macos] Add logs to foundation classes.

* [ios, macos] Fix snapshotter size logging.

* [macos] Add logs to map view.

* [ios, macos] Fix string from boolean prefix, add custom function for NSCAssert.

* Log size test

* [ios, macos] Add logging conditional compilation flag.

* [ios, macos] Rename function NSStringFromMGLTransition to MGLStringFromMGLTransition.

* [ios, macos] Remove verbose logging for release builds.

* [ios, macos] Rename NSStringFromCLLocationCoordinate2D to MGLStringFromCLLocationCoordinate2D.

* [ios, macos] Clean unnecesary blank lines in MGLLight.mm set methods.

* [ios, macos] Fix logging grammar, format, function names.

* [ios, macos] Remove compilation flag, rename flags.
2018-11-14 15:42:18 -08:00
Fabian Guerra
064d8b9aa8 Add a custom logging for the Mapbox Maps SDK for iOS. 2018-10-26 12:45:14 -07:00
Minh Nguyễn
6786ca6bf7 [ios, macos] Updated world tour locations 2018-10-08 13:47:22 -07:00
Fabian Guerra Soto
41dd886ce5 [ios, macos] Add Italian settings translations. (#12908)
* [ios, macos] Update transifex Root directory.

* [ios] Update Settings.bundle italian translation.
2018-10-02 09:36:08 -07:00
Minh Nguyễn
a030f1474f [ios, macos] Distinguish between viewing distance and altitude
+[MGLMapCamera cameraLookingAtCenterCoordinate:fromDistance:pitch:heading:] incorrectly treated the distance as an altitude. Due to backwards compatibility concerns, this method can’t be fixed in place. Instead, separate +[MGLMapCamera cameraLookingAtCenterCoordinate:correctlyFromDistance:pitch:heading:] and +[MGLMapCamera cameraLookingAtCenterCoordinate:altitude:pitch:heading:] methods have been added.
2018-10-01 18:12:03 -07:00
Nadia Barbosa
a991eec597 [ios] Remove Settings target; move Settings.bundle to iosapp
[ios] Remove copying of Settings.bundle from packaging script

[ios] Move Settings bundle under ios/app in file system

[ios] Copy bundle to iosapp in packaging script

[ios] Remove stranded Root.strings from SDK

[ios] Add English localization to example Settings.bundle
2018-09-19 14:16:22 -07:00
Jason Wray
511fca7210 [ios] Add fall-through single tap to iosapp 2018-02-07 16:53:33 -05: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
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
Jordan Kiley
673144786b [ios] updated predicates (#12178) 2018-06-19 16:53:10 -07:00
Jason Wray
e24930a036 [ios] Support safe area in iosapp
* [ios] Refactor iosapp two-map option; fix constraint

* It's NO in objc; enable second map scale bar
2018-06-08 23:13:12 -07:00
Julian Rex
9e4a16d7ee [ios] Updated MGLScaleBar to use rendered UIImages instead of MGLScaleBarLabel (#11921) 2018-05-24 10:29:56 -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
Konstantin Käfer
f6da3ba9be iOS: Add custom layer example to debugging app (#7734) 2018-05-03 12:48:58 -07:00
Minh Nguyễn
ea59ba8209 [android, ios, macos] Added Korean localization 2018-05-02 12:57:14 -07: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
2e22593962 [ios] Mark -presentCalloutFromRect:inView:constrainedToView:animated: unavailable (#11738) 2018-04-19 15:47:58 -04:00
Fabian Guerra Soto
cec46070c6 [ios, macos] Add NSExpression convenience constructors and helper methods. (#11278)
* [ios, macos] Refactor convinience expression initializers.

# Conflicts:
#	platform/darwin/src/NSExpression+MGLAdditions.h
#	platform/darwin/src/NSExpression+MGLAdditions.mm
#	platform/ios/app/MBXViewController.m

* [ios, macos] Add MGL_MATCH convenience method.

# Conflicts:
#	platform/darwin/src/NSExpression+MGLAdditions.h
#	platform/darwin/src/NSExpression+MGLAdditions.mm
#	platform/darwin/test/MGLExpressionTests.mm

* [ios, macos] Add Swift friendly convenience methods name syntax..

# Conflicts:
#	platform/darwin/src/NSExpression+MGLAdditions.h

* [ios, macos] Update runtime styling examples.

# Conflicts:
#	platform/ios/app/MBXViewController.m

* [ios, macos] Add NSExpression variable expressions properties.

* [ios, macos] Clarify convenience initializer names.

* [ios, macos] Update Style Authors guides.

* [ios, macos] Fix cherry-pick merge.

* [ios, macos] Update convenience initializers documentation.
2018-04-16 20:48:04 -04:00
Minh Nguyễn
ecc43c871a [android, ios, macos] Added European Portuguese localization 2018-04-16 17:26:44 -07:00
Minh Nguyễn
e16ce7d879 Localize expressions more thoroughly (#11651)
* [ios] Removed changelog entry for Terrarium

The broader feature is new to v4.0.0 as well.

* [ios, macos] Localize expressions more thoroughly

Replaced the MGLStyle.localizesLabels property with a -localizeLabelsIntoLocale: method that allows the caller to specify the locale to localize into. Also exposed a per-expression localization method for developers who want to vary behavior from layer to layer.

* [macos] Offer English labels if preferred language is unsupported

* [ios, macos] Removed dead code

* [ios] Use new localization method in iosapp

* [ios, macos] Fixed local name labels

* [ios, macos] Convert tokens to key path expressions in stop dictionaries

* [ios, macos] Streamlined token upgrading

Separated token upgrading into a separate process that only happens as part of the MGLSymbolStyleLayer.text and MGLSymbolStyleLayer.iconImageName properties’ getters, so that it’s easy to remove later when mbgl changes obviate this workaround. Removed the replacesTokens parameter to the expression localization methods.

* [ios, macos] Preserve whitespace between tokens

* [ios, macos] Moved token replacement to a consistent category

Fixed a build warning.

* [ios, macos] Replace tokens in all string-typed getters

For consistency, replace tokens with key paths in all string-typed style paint and layout properties.

* [ios, macos] Test token replacement

Added tests for replacement of tokens with key paths in expressions. Fixed token replacement for raw strings in stop dictionaries. Avoid sticking a single string inside an mgl_join: call.

* [ios, macos] Test token replacement, localization

Added unit tests of token replacement and localization of expressions. Only NSExpression is responsible for resolving the preferred language now, since NSLocale tends to tack a region code onto the locale identifier and the NSExpression method can be called independently anyways. Added a private variation of +[MGLVectorTileSource preferredMapboxStreetsLanguage] that takes an array of preferred languages. Fixed localization of non-expressions in stop dictionaries.

* [ios, macos] Dictionary keys aren’t necessarily zoom levels
2018-04-16 15:24:33 -07:00
Jason Wray
be3fc4413a [ios] Change MGLAnnotationView.scalesWithViewingDistance default value to NO 2018-04-12 16:49:30 -04: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
8c5eb6ca9c Install aftermarket expression functions (#11472)
* [ios, macos] Introduced more ergonomic expression concatenation syntax

* [ios, macos] Fixed mgl_join:

* [ios, macos] Simplified expression document headings

* [ios, macos] Documented mgl_join:

* [ios, macos] Convert length operator to length: for strings

Only works for literal strings.

* [ios, macos] Implemented type conversion using CAST()

* [ios, macos] Aftermarket let expressions

* [ios, macos] Refactored aftermarket expression functions

Refactored the installation of aftermarket expression functions to use macros. It is no longer necessary to handwrite the type encoding of a function. Also added aftermarket functions for interpolating and stepping.

* [ios, macos] Updated documentation, tests, demo apps

* [ios, macos] Added generic expression function

* [ios, macos] Add MGL_MATCH function placeholder.

* [ios, macos] Add MGL_SWITCH expression operator.

* [ios, macos] Add mgl_coalesce: as expression function.

* [ios, macos] Update style documentation.

* [ios, macos] Add conventional custom function support.

* [ios, macos] Updated example code

* [ios, macos] Add mgl_coalesce conventional custom function support.

* [ios, macos] Add aftermarket function to 'has' operator.

* [ios, macos] Add documentation for lookup and feature operators.

* [ios, macos] Documented simple lookup

* [ios, macos] Renamed, reversed has expression

Renamed mgl_hasProperty:properties: to mgl_does:have: for better readability and consistency with the conventional mgl_has: function. Documented both forms of mgl_has:.

* [ios, macos] Restored OEM conditionals where available

This is the preferred syntax for simple conditionals on iOS 9 and above, because you can inline the predicate instead of wrapping it in a constant value expression, which means you can write a conditional in a single format string.

* [ios, macos] Update style docs.

Co-authored-by: Fabian Guerra <fabian.guerra@mapbox.com>
2018-03-29 10:25:05 -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
4acd671a65 [ios] Add camera limit debug option to iosapp
Adapted from cdff47276d/Examples/ObjectiveC/BlockingGesturesDelegateExample.m
2018-03-14 15:46:43 -04: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
ab27e24ab0 [ios] Restore iosapp's HUD visibility, adjust placement 2018-02-27 18:27:42 -05:00