Commit Graph

12372 Commits

Author SHA1 Message Date
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
Fabian Guerra Soto
62dd097328 [ios, macos] NSPredicate expression filters. (#11587)
* [ios, macos] Add NSAndPredicateType predicate expression filter.

* [ios, macos] Add type to NSPredicate expressions.

* [ios, macos] Add Expression filter support.

* [ios, macos] Update NSPredicate expression based tests.

* [ios, macos] Refactor ExpressionFilters.

* [ios, macos] Add symmetric test to ExpressionFilters.

* [ios, macos] Update NSPredicate test to ExpressionFilters.

* [ios, macos] Re-introduce Filter tests.

* [ios, macos] Remove typed NSComparisonPredicate's comparable values.

* [ios, macos] Update style layers predicate tests.

* [ios, macos] Remove unused predicate conversion code.

* [ios, macos] Update documentation exaple's test.

* [ios, macos] Update Predicate and Expressions guide..

* [ios, macos] Remove mgl_ prefix from variable expressions.

* [ios, macos] Update predicates and expressions documentation.

* [ios, macos] Update changelogs.
2018-04-16 16:51:59 -04:00
Fabian Guerra Soto
fe4348eec3 [ios, macos] Remove mgl_ prefix from built-in expressions variables. (#11689) 2018-04-16 13:39:10 -04:00
Jason Wray
816406e038 [ios] Update playground for Swift 3.2+ 2018-04-13 16:08:14 -04:00
Nadia Barbosa
582d0e5885 Minor last fixes 2018-04-12 14:54:12 -07:00
Jason Wray
6a631855d3 Compress the compressed compression 2018-04-12 14:54:12 -07:00
Nadia Barbosa
af05ccad52 Redo images 2018-04-12 14:54:12 -07:00
Nadia Barbosa
00f5a79eaa Second round of feedback edits from @colleenmcginnis 2018-04-12 14:54:12 -07:00
Nadia Barbosa
d358e16a86 First round of feedback incorporation
Including feedback edits as suggested by @friedbunny
2018-04-12 14:54:12 -07:00
Nadia Barbosa
ca6e03111a [ios, docs] [ios, docs] Rewrite "Adding points to a map" guide 2018-04-12 14:54:12 -07:00
Fabian Guerra Soto
23f0222fd9 [ios, macos] Add predicate like expressions to NSExpression (#11632)
* [ios, macos] Add NSPredicate between function.

* [ios, macos] Add NSPredicate 'IN' expression filter support .

* [ios, macos] Add NSPredicate 'CONTAINS' expression filter support.

* [ios, macos] Refactor NSPredicate operators.

* [ios, macos] Simplify NSPredicate's expression conversion code.

* [ios, macos] Make 'match' the default predicate conversion option.
2018-04-12 17:43:01 -04:00
Jason Wray
be3fc4413a [ios] Change MGLAnnotationView.scalesWithViewingDistance default value to NO 2018-04-12 16:49:30 -04:00
Anand Thakker
352d63d2ce Don't enforce ["zoom"] constraints for filters (#11672)
* Don't enforce ["zoom"] constraints for filters

Fixes #11594

* Add a couple of comments

* Fix ambiguous constructor call

* ParsingContext(optional<Type>) => ParsingContext(Type)
2018-04-12 16:02:48 -04:00
Jason Wray
646cbc98dd [ios] Note plans to drop iOS 8 (#11663) 2018-04-12 11:31:00 -04:00
Tobrun
ff11cb2016 [android] - update changelog for release v6.0.0-beta.7 2018-04-12 11:52:43 +02:00
Łukasz Paczos
22b4ef1f4b Update layer immediately when changing its max/min zoom level (#11399)
* [android][core] update layer immediately when changing it's max/min zoom

* [core] node bindings for layer zoom range
2018-04-12 10:42:14 +02:00
Minh Nguyễn
aaba667cc3 [ios, macos] Corrected link in expression documentation 2018-04-11 20:26:02 -07:00
Minh Nguyễn
9b869c51ad [ios, macos] Renamed expression initializer to be more Swiftian 2018-04-11 20:26:02 -07:00
Jason Wray
ad803d77cb [darwin, docs] Further compress images in docs 2018-04-11 18:49:15 -04:00
Anand Thakker
f0f67b4788 Add abs, round, floor, ceil operators (#11653)
* Add abs, round, floor, ceil operators

Port of https://github.com/mapbox/mapbox-gl-js/pull/6496

* [ios, macos] Simplified abs, ceiling, floor expressions

* [ios, macos] Added rounding expression function

* [android] - binding integration for round, ceil, floor and abs expressions

* Update mapbox-gl-js to include non-integer rounding test

* Drop extra braces

* mapbox-gl-js -> master

* Update style-spec docs -> PropertyFactory.java
2018-04-11 12:03:56 -04:00
Osana Babayan
797486bc5f [android] center was calculated incorrectly for LatLngBounds with zero span (#11650) 2018-04-11 10:00:07 -04:00
Tobrun
a0d0776925 [android] - bump telemetry to 3.0.0 stable 2018-04-11 15:39:50 +02:00
Jason Wray
33d3c27ab0 [build, qt] Work around for chown'ing /usr/local
macOS 10.13 no longer allows wholesale chown'ing of /usr/local (and this
approach also works in 10.12).
2018-04-10 20:19:45 -04:00
Jason Wray
6a2e69b7b1 [docs] Update CI badges and expand license section 2018-04-10 20:19:45 -04:00
Jason Wray
7055847ca9 [build, ios] Bump CircleCI builds to Xcode 9.3 2018-04-10 20:19:45 -04:00
Julian Rex
80474b24f2 [ios] Refactor integrations tests 2018-04-10 14:56:38 -04:00
Osana Babayan
4191c4bbcb [android] LatLngBounds were not build correctly when lons were the same (#11647) 2018-04-10 12:41:59 -04:00
Tobrun
aa43dfd6c1 [android] - add convinience step expression (#11641) 2018-04-10 14:26:22 +02:00
Tobrun
ce75c3b3e7 [android] - add javadoc code examples for Android (#11540) 2018-04-10 13:45:46 +02:00
Tobrun
c2a78d0d72 [android] - add paused state to map renderer, don't render snapshot when paused (#11358) 2018-04-10 11:10:14 +02:00
Tobrun
44ce5ab087 Rework expression conversion (#11490)
* [android] - rework expression conversion
2018-04-10 11:09:42 +02:00
Łukasz Paczos
351ac83c75 [android] - fixed gesture events listeners lists documentation (#11630) 2018-04-10 09:57:00 +02:00
Anand Thakker
8d26f74091 Fix style parsing bug for constant expressions (#11606)
* Fix style parsing bug for constant expressions

Closes #10849

* Ignore tests for unported GL JS change

Refs https://github.com/mapbox/mapbox-gl-js/pull/6429

* Fuller fix

* Update mapbox-gl-js
2018-04-09 17:59:18 -04:00
Tobrun
c1dabbde8d [android] - add delete local refs calls for make jni strings 2018-04-09 20:14:45 +02:00
Ivo van Dongen
14423a225b [android] release local refs early 2018-04-09 17:46:02 +03:00
Minh Nguyễn
1af1cbe721 [ios, macos] Equate valueForKey: with valueForKeyPath: 2018-04-06 13:47:49 -07:00
Minh Nguyễn
f9e32d59ad [ios, macos] Distinguish between conditionals and expressions in case expression 2018-04-06 13:47:49 -07:00
Asheem Mamoowala
e32a0586f2 Change MGLMapPointMake to MGLMapPointForCoordinate 2018-04-06 10:06:05 -07:00
Łukasz Paczos
6f639dba20 [core] re-bind uniform locations after re-linking program (#11618)
- On some gl implementations the uniform locations are shifted after linking the program a second time, resulting in errors when using any uniform. On some implementations they are actually doubled. Re-binding the uniforms after selectively binding the vertex attributes prevents this.

(cherry picked from commit 4a0e025)
2018-04-06 16:28:36 +02:00
Asheem Mamoowala
cc01781db7 [ios, macos] Projection Matrix and LatLng projection to Mercator methods 2018-04-05 18:04:25 -07:00
Asheem Mamoowala
dc495e1c9d [core] Add Projection matrix to CustomLayerRenderParameters to transform web mercator world coordinates to GL coordinates. 2018-04-05 18:04:25 -07:00
Osana Babayan
275d753e91 [android] updated mapbox-sdk-services to 3.0.1 (#11593)
* [android] updated mapbox-sdk-services to 3.0.1

* [android] - downgrade tooling for MAS-3.0.1
2018-04-05 11:38:02 -04:00
Anand Thakker
c50a74d1c2 Remove unused lambda capture (#11602)
Fixes #11588
2018-04-05 10:57:45 -04:00
Łukasz Paczos
d5a3e5be7a Release android v6.0.0 beta.6 (#11592)
* [android] updated changelog for 6.0.0-beta.6
2018-04-05 10:53:55 +02:00
Łukasz Paczos
db3cf229f8 [android] - bumped telemetry version to 3.0.0-beta.4 (#11590) 2018-04-04 13:36:31 +02:00
Tobrun
5d8844152d Rework logical condition convenience expressions (#11555)
* [android] - rework expression logical operator api to match actual usage
2018-04-04 12:41:34 +02:00
Łukasz Paczos
25d0f7157d [android] invalidate camera position before delivering onMapReady (#11585) 2018-04-04 11:55:46 +02:00
Tobrun
1730756e87 [android] - throw illegal argument exception when attempting to convert an PropertyValue as an expression literal (#11572) 2018-04-04 11:33:37 +02:00
Julian Rex
ddd8fb7a05 [ios] Added explicit dependency to address occasional test build failures. (#11581) 2018-04-03 16:59:53 -04:00
Jason Wray
c5c02c069e [ios] Bump podspecs for ios-v4.0.0-beta.3 2018-04-02 19:33:10 -04:00