Commit Graph

14444 Commits

Author SHA1 Message Date
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
Tobrun
1d93ffc5eb [android] - refactor marker selection and listener invocation, reformatted code (#7304) 2016-12-08 14:37:15 +01:00
Tobrun
7cf10ee524 [android] - remove location enabled flag from MapboxMap (#7308)
* [android] - remove location enabled flag from MapboxMap, decouple TrackingSettings from MyLocationViewSettings using a FocalPointChangeListener interface, Move state related to tracking modes to MyLocationView (shared object between MyLocationViewSettings and FocalPointChangeListener).

* fixup tests
2016-12-08 14:37:01 +01:00
Fredrik Karlsson
89d4c40d92 [ios, macos] renamed raster-hue-rotate 2016-12-08 11:36:39 +01:00
Jesse Bounds
01ff94a6eb [ios, macos] Warn about special characters in predicates (#7317) 2016-12-07 14:06:02 -08:00
Tobrun
3d2dc47191 [android] - only apply screen density to instance variables of MapboxMapOptions. (#7327) 2016-12-07 21:56:40 +01:00
Jesse Bounds
497953c34e [ios, macos] Fix typo in exception name for style source identifier (#7315) 2016-12-07 10:47:06 -08:00
Bruno de Oliveira Abinader
aa9bf7139c [qt, macos] Remove workaround for a bug in Qt 5.7 2016-12-07 17:46:09 +01:00
Fredrik Karlsson
508f020eb5 Prevent stopless functions (#7309)
* [ios, macos] prevent stopless functions

* [ios, macos] removed unused bridging header and fixed naming
2016-12-07 17:19:15 +01:00
Konstantin Käfer
11229d72f5 [build] bump mason to update Android compile flags 2016-12-07 15:28:13 +01:00
Fredrik Karlsson
3b7e98d0b1 [ios, macos] fixed compiler warnings 2016-12-07 12:52:59 +01:00
Konstantin Käfer
6be56ff9c2 [render] allow passing URLs to mbgl-render 2016-12-07 10:46:43 +01:00
Konstantin Käfer
dc1bda435f [core] add util::isURL() for checking whether a string starts with a URL scheme 2016-12-07 10:46:43 +01:00
Minh Nguyễn
178130267e [ios, macos] Corrected -setNeedsDisplay documentation
Followup to #7250.
2016-12-07 00:31:30 -08:00
Minh Nguyễn
a39f53df22 [ios, macos] Migrate MGLCustomStyleLayerAdditions to style layer API (#7250)
* [ios, macos] Replaced custom style layer API with MGLOpenGLStyleLayer

Replaced the custom style layer API on MGLMapView with an equally unsupported MGLOpenGLStyleLayer API that nonetheless is consistent with the broader runtime styling API and is compatible with macOS.

Fixed an unrecognized selector crash when wrapping a layer of unrecognized type coming from mbgl.

* [macos] Added lime green layer demo to macosapp

Reprised the demo removed from iosapp in #5091.

* [ios, macos] Rationalized MGLOpenGLStyleLayer API

MGLStyle now strongly references any MGLOpenGLStyleLayer object that’s added to it, in order to prevent pointers from going stale and make it easy for layer drawing code to get more information about the map view. Replaced the MGLOpenGLStyleLayer callback blocks with overridable instance methods. Added internal documentation for each method. Subclassed MGLOpenGLStyleLayer as LimeGreenStyleLayer inside macosapp.

Consolidated -addToMapView: into -addToMapView:belowLayer: to ensure that MGLRedundantLayerException gets raised even if the layer is being inserted rather than added to the bottom of the stack.

* [core] Clarified that rendering happens on the main thread

* [ios, macos] Fixed removing and re-adding MGLOpenGLStyleLayer

Don’t allow index-based layer removal to circumvent -removeFromMapView:, which MGLOpenGLStyleLayer relies on to synchronize the style’s array of MGLOpenGLStyleLayers. When obtaining an MGLOpenGLStyleLayer, get the instance already added to the style instead of creating a new one to wrap the underlying CustomLayer.
2016-12-07 00:01:11 -08:00
Minh Nguyễn
4c2aec2355 [ios, macos] More ways to reshape an MGLMultiPoint (#7251)
* [ios, macos] Completed API for mutating multipoints

Added the complete set of methods for mutating the vertices of an MGLMultiPoint. Also rewrote MGLMultiPoint documentation to refer to vertices instead of points.

* [ios, macos] Removed inaccurate MGLOverlay commentary

This paragraph is full of references to features that exist in MKOverlay but not MGLOverlay.

* [ios, macos] Lazily compute multipoint bounds

Invalidate the bounds whenever the coordinates change, but don’t recompute the bounds until they’re requested. Simplified -intersectsOverlayBounds: for immutable overlay classes.

Added a utility function for testing whether two MGLCoordinateBounds intersect, based on mbgl::LatLngBounds::intersects().

Removed unused color conversion code.
2016-12-06 23:36:55 -08:00
Minh Nguyễn
9f9422deb8 [ios] s/iconSize/iconScale/
Followup to #7310.
2016-12-06 21:28:04 -08:00
Minh Nguyễn
88f91a48ae [ios, macos] Template images as style images
Convert template images to SDF icons and back when storing them as style images.
2016-12-06 16:20:14 -08:00
John Firebaugh
cc6e5c9df9 [core] Move CrossFadedPropertyEvaluator to its own file 2016-12-06 15:05:45 -08:00
John Firebaugh
05b0dcd0f8 [core] Move evaluation algorithm to Function 2016-12-06 15:05:45 -08:00
John Firebaugh
0adf830b9a [core] Inline friend equality operators 2016-12-06 15:05:45 -08:00
Minh Nguyễn
e6d51c384d [ios, macos] Note corresponding style spec properties
Documentation for attributes whose names we’ve overridden now mention the original style specification property name, with a link to the style specification documentation for the property.
2016-12-06 22:18:03 +01:00
Fredrik Karlsson
903246b256 [ios, macos] renamed dasharray and icon size 2016-12-06 22:18:03 +01:00
Chris Voll
e7c30de021 [other] fix spelling on month in node.js changelog 2016-12-06 22:15:36 +01:00
Tobrun
e706ede0b4 [android] - remove overlay SurfaceView examples (#7278) 2016-12-06 19:40:40 +01:00