Commit Graph

16768 Commits

Author SHA1 Message Date
Jesse Bounds
0eac5ea91e [ios]] Remove transaction in callout view update (#7425) 2016-12-14 10:22:02 -08:00
John Firebaugh
e8a48a6d63 [node] Fix order of operations when setting zoom and center
Zoom must be set first, to avoid center potentially getting constrained.

Fixes #7351
2016-12-14 10:08:23 -08:00
John Firebaugh
ceeded2932 [core] Obtain shaders from gl-js monorepo 2016-12-14 10:02:30 -08:00
Cameron Mace
3d5983f6f6 Allows for setting the user location icon to transparent (#7393)
* allows for setting the user location icon to transparent

* removed color check
2016-12-14 12:51:04 -05:00
Thiago Marcos P. Santos
8f24119bd0 [Qt] Implement updateSource
It will create or update a source. Right now only GeoJSON sources are
mutable and can be updated using this method.
2016-12-14 14:21:20 -02:00
Tobrun
070a9b43e1 [android] - update gradle command line args for CI (#7426) 2016-12-14 12:48:59 +01:00
Minh Nguyễn
d34356ce39 [ios, macos] Streamlined a string format 2016-12-13 17:37:44 -08:00
Minh Nguyễn
ef71597932 [ios, macos] Simplify MGLSource and subclasses (#7377)
* [ios, macos] Audited source headers for nullability

* [macos] Made MGLTileSet public

* [ios, macos] Replaced MGLTileSet with MGLTileSource

MGLRasterSource and MGLVectorSource now share a common abstract superclass, MGLTileSource. MGLTileSet has been removed. MGLTileSource is modeled after mbgl::style::RasterSource and mbgl::style::VectorSource. It has initializers that incorporate the parameters of MGLTileSet’s initializers, but it lacks getters for everything but the attribution string. MGLTileSet’s properties have been converted into options that can be passed into MGLTileSource’s initializers in a dictionary.

Properly implement rawSource as a covariant property so that it doesn’t end up getting autosynthesized as a shadow ivar. This prevents concrete subclasses of MGLSource from setting _rawSource directly but getting a different value out of self.rawSource.

Marked -[MGLSource init] as unavailable and ensured that concrete subclasses of MGLSource have the right set of initializers marked as designated initializers.

Documentation comments for each concrete source class identify the corresponding source type in the style specification. Clarified the purpose of MGLTileSetScheme, now known as MGLTileCoordinateSystem.

* [ios, macos] Clarified tile size interpretation

Sticking to a default value of 256 for mapbox: URLs, but other URLs get the standard 512 value.

* [ios, macos] rawSource is always set

* [ios, macos] Cleaned up MGLShapeSource initialization

rawSource is never nil, so there’s no need for a -commonInit method. Extracted -geoJSONOptions from MGLShapeSource into a standalone function for easier testing.

* [ios, macos] Synchronized headers in project

Realphabetized headers in groups. Added headers missing from one project or the other.

* [ios, macos] Added MGLShape methods to (de)serialize GeoJSON data

Added a class initializer and instance method to MGLShape that deserialize and serialize the shape as GeoJSON data, respectively. The new initializer handles parsing errors gracefully.

Removed methods specific to GeoJSON data from MGLShapeSource, in an effort to reduce parallel state. Developers are now expected to go through the new MGLShape initializer to get an MGLShape representation. Alternatively, a local file URL can be passed into the other MGLShapeSource initializer.

* [ios, macos] Typo in assertion message

* [ios, macos] Simplified GeoJSON serialization

Every MGLShape now knows its most specific mbgl::GeoJSON representation.

* [ios, macos] Reremoved MGLFeaturePrivate

mbgl::GeoJSON, which is a variant, allows a single GeoJSON representation method to traffic in whatever type is needed for a particular shape class. This change removes some hidden private protocols, which are a bug waiting to happen.

* [ios, macos] Fixed covariant rawLayer property

Properly implement rawLayer as a covariant property so that it doesn’t end up getting autosynthesized as a shadow ivar. This prevents concrete subclasses of MGLStyleLayer from setting _rawLayer directly but getting a different value out of self.rawLayer.

* [ios, macos] Use MGLAttributionInfo for source attribution

Made MGLAttributionInfo public. Replaced MGLTileSource’s attribution property with an attributionInfos property set to an array of MGLAttributionInfo objects. Added an MGLTileSourceOption for specifying an array of MGLAttributionInfo objects instead of an HTML string (either is acceptable when creating an MGLTileSource).

* [ios, macos] Corrected method references in documentation
2016-12-13 17:36:15 -08:00
Cameron Mace
39b839f3dd added custom layer proguard rule (#7411) 2016-12-13 18:08:02 -05:00
Ivo van Dongen
b221b6c5fb [core] Swap order of Style::recalculate and Style::relayout
Style::relayout uses source.baseImpl->loaded, a flag which is updated by Style::recalculate. So recalculate first, then relayout.
2016-12-13 12:56:08 -08:00
Cameron Mace
833c5ca2be Fixed proguard rules (#7389)
* fixed proguard rules

* disabled proguard for debug testapp builds

* removed dontobfuscate and fixed gson issue
2016-12-13 14:40:51 -05:00
Minh Nguyễn
2d52dd8c0f [ios] Fixed crash on launch in iosapp
Use NSLocaleLanguageCode instead of -[NSLocale languageCode], which is newer than the minimum deployment target.
2016-12-13 10:30:04 -08:00
Thiago Marcos P. Santos
0f0f2c69d7 [Qt] Fix build when ICU is disabled 2016-12-13 16:16:53 -02:00
Jesse Bounds
9f4dd1c5f4 [ios] Fix iosapp runtime styling examples (#7395)
This fixes a few bugs in our iosapp examples that were exposed by
recent refinements to the APIs they use.
2016-12-13 10:09:54 -08:00
Ivo van Dongen
d3895b47ef [ios, macos] handle duplicate layer error 2016-12-13 10:03:05 -08:00
Ivo van Dongen
bb6973ae90 [core] guard against duplicate layer ids 2016-12-13 10:03:05 -08:00
Ivo van Dongen
18730d598d [core] use raii to guard backend deactivation 2016-12-13 10:03:05 -08:00
John Firebaugh
c12b52c6a7 [core] Fix debug rendering
* Off-by-one in DebugBucket indexing
* Must unbind VAO before binding index buffer in Context::createIndexBuffer
2016-12-13 09:42:46 -08:00
Minh Nguyễn
36616c7200 [android] Fixed typo in MapboxMap.addImage() 2016-12-13 09:28:42 -08:00
Tobrun
927dbb1315 [android] - update bitrise config. Create archivable path if non existent (#7385) 2016-12-13 10:50:34 +01:00
Tobrun
b1e9a3f4d6 [android] - Reenable MapboxMapTest for end-to-end API testing. Fix tests (#7367) 2016-12-13 08:08:41 +01:00
Tobrun
b43aa9d62d [android] - limit input fling gesture based on map tilt. (#7383) 2016-12-13 08:08:29 +01:00
Minh Nguyễn
1ab791c3dc [ios, macos] Override references to property names in property requirements lists (#7391)
* [ios, macos] Refer to template images in documentation

SDF icons are known as template images in AppKit and UIKit.

* [ios, macos] Override property names in requirements
2016-12-12 23:05:09 -08:00
Ivo van Dongen
28be37fcbe [core] Swap order of Style::recalculate and Style::relayout
Style::relayout uses source.baseImpl->loaded, a flag which is updated by Style::recalculate. So recalculate first, then relayout.
2016-12-12 16:49:02 -08:00
John Firebaugh
b0a928dcbc [core] Ensure a non-zero source tile cache size
Previously, for viewport sizes less than 512 pixels in either direction, the computed size was 0.
2016-12-12 16:49:02 -08:00
John Firebaugh
3718e1fa15 [tests] Implement "wait" command with Map#render
This ensures that a "wait" command will always fully flush pending update flags. This was not the case with the prior conditional map.loaded() logic.
2016-12-12 16:49:02 -08:00
Bruno de Oliveira Abinader
b65b2f1c29 [qt] Skip ICU if WITH_QT_I18N is set 2016-12-12 22:34:52 +02:00
Bruno de Oliveira Abinader
c0e18ad80c [core] Added BidiImpl to avoid ICU types exposure 2016-12-12 22:34:52 +02:00
Bruno de Oliveira Abinader
ce5ed9e649 [build] ICU is now configured per platform 2016-12-12 22:34:52 +02:00
Jesse Bounds
e38b4b590d [ios, macos] Load features into shape source if possible (#7339)
This checks the kind of MGLShape passed into the source and, if it
is a feature, it mbgl feature objects to pass to core. This keeps the
feature id and attributes data intact. If the shape is a
`MGLShapeCollectionFeature` it creates an `mbgl::FeatureCollection`
object (also to keep feature properties). If the shape is not any
sort of feature, it passes along just the geometry.

This also uses the MGLFeatureFromMBGLFeature converter for the case where
GeoJSON data passed in to a source contains a single feature. The
converter has logic to keep the id and attributes properties intact.
Before, these properties were lost because only geometry conversion
was done.

Finally, logic to handle (and associated tests) of nested shape
collection features is removed since that is not supported by
the GeoJSON spec or the core implementation.

[ios] Add test of drawing plain shape to iosapp
2016-12-12 10:38:49 -08:00
Tobrun
eff986bfc4 [android] - update gradle wrapper and gradle plugin (#7381) 2016-12-12 19:22:33 +01:00
Konstantin Käfer
6fb24b2082 [build] only build active architecture for Debug builds on iOS 2016-12-12 18:53:46 +01:00
Ivo van Dongen
e9f101a52f [ios, macos] handle duplicate layer error 2016-12-12 09:05:23 -05:00
Ivo van Dongen
a32e62cb0f [android] test duplicate layer id exception handling 2016-12-12 09:05:23 -05:00
Ivo van Dongen
028db7feba [core] guard against duplicate layer ids 2016-12-12 09:05:23 -05:00
Ivo van Dongen
c76a933514 [core] use raii to guard backend deactivation 2016-12-12 09:05:23 -05:00
Minh Nguyễn
3fed3c10ed [ios, macos] Expanded source documentation
Also fixed a few stray references to GeoJSON sources.
2016-12-10 14:58:01 -08:00
Jesse Bounds
7f75eb5d6a [ios, macos] Rename MGLGeoJSONSource to MGLShapeSource (#7334) 2016-12-09 16:09:10 -08:00
YunjieLi
ffd74c309e Simplified Chinese localization (#7316)
* translated into Chinese

* light edits to translations

* update two changelogs; remove .stringsdict files

* remove update from macos changelog
2016-12-09 12:25:41 -08:00
Tobrun
ee7e58fd46 [android] - invalidate camera after gesture, cleanup. (#7354) 2016-12-09 21:19:59 +01:00
Jesse Bounds
ce1d9ff5ee [ios, macos] Silence -Wc++11-narrowing warning in open gl layer (#7355) 2016-12-09 09:58:44 -08:00
John Firebaugh
82856fd08b [darwin, android] SDK bindings for circle-stroke properties 2016-12-09 09:35:21 -08:00
John Firebaugh
3b2a4216a2 [core] Implement circle-stroke properties
Also includes stubs for fill-extrusion layer, because most of the code was auto-generated.
2016-12-09 09:35:21 -08:00
Tobrun
4a2f53e6e5 [android] - fix ndk stack CI step (#7363) 2016-12-09 16:22:19 +01:00
Tobrun
970a0dab44 [android] - cleanup initialisation code for MapboxMap (#7330) 2016-12-09 15:38:09 +01:00
Thiago Marcos P. Santos
d6b8866975 [Qt] Allow strings as data source in the QML Item
Data values starting with ':' will be assumed to be a resource.
2016-12-09 11:28:31 -02:00
Thiago Marcos P. Santos
97df99c134 [Qt] Remove route before adding
This will allow to bind a GeoJSON to the source data property
without throwing an exception.
2016-12-09 11:28:31 -02:00
Minh Nguyễn
fe53af7de0 [ios, macos] Source-driven attribution (#5999)
* [ios, macos] Source-driven attribution

Refactored MGLSource initialization. Implemented a new private class, MGLAttributionInfo, that parses an HTML attribution string from TileJSON and stores the resulting structured data. Added methods to MGLTileSet and MGLStyle to aggregate MGLAttributionInfos.

On macOS, update the attribution view as soon as the source attribution changes. On iOS, fetch the current attribution information when displaying the action sheet.

Removed hard-coded attribution strings.

* [macos] Respect inline formatting in attribution HTML

Apply a default font and color to attribution HTML as it is imported into an attributed string. Pass the attributed string into MGLAttributionButton as is, without stripping formatting. Avoid overriding the font and color after importing the HTML, in case these attributes are explicitly specified rather than intrinsic to a hyperlink.

Constrain the top of the attribution view to all the attribution buttons, in case one of them needs additional headspace.

* [ios, macos] Display unlinked attribution strings

Unlinked attribution strings are represented on macOS as buttons that have the default cursor and do nothing when clicked. On iOS, they are action sheet buttons that do nothing but dismiss the action sheet.

* [macos] Fixed random Auto Layout exception

Auto Layout randomly finds itself unable to satisfy constraints when updating attribution, due to some spurious constraints between attribution buttons. Regenerate the entire attribution view every time the source attribution changes.

* [ios, macos] Thoroughly dedupe attribution infos

Also added a test to verify parity with the GL JS implementation. This implementation avoids sorting.

* [ios, macos] Trim whitespace from attribution strings

Also added parsing tests.

* [ios, macos] Added attribution parsing tests for styles

Included an emoji test to ensure that attribution strings are interpreted as UTF-8, to avoid mojibake. Included a test of removing the underline from a leading copyright symbol.

* [ios, macos] Derive feedback link from source

MGLAttributionInfo now detects feedback links in the attribution HTML code, and it is responsible for tailoring the feedback URL to the current viewport.

Removed the hard-coded feedback action from the attribution sheet on iOS in favor of a source-derived feedback title and URL. Moved the feedback action from macosapp to MGLMapView; applications are now expected to hook an Improve This Map menu item to an MGLMapView action.
2016-12-08 17:43:17 -08:00
Bruno de Oliveira Abinader
a8c2688ca3 [qt] Added copyrightsChanged() signal 2016-12-08 16:36:38 +01:00
Konstantin Käfer
0eede631ce [build] only use Identical Code Folding on platforms that support the gold linker 2016-12-08 15:38:38 +01:00