Commit Graph

1704 Commits

Author SHA1 Message Date
Fabian Guerra Soto
20712b7c84 Per-attribute transition properties on MGLStyleLayer (#8225)
* [ios, macos] new struct MGLTransition

* [ios] MGLTransition struct moved to MGLTypes.h

* [ios] MGLTransition implemented for style layer properties

* [ios, macos] added support for getting property transitions

* [ios, macos] updated to MGLDurationFromTimeInterval and MGLTimeIntervalFromDuration

* [ios, macos] added transition properties test

* [ios, macos] modified key strings imp

* [ios, macos] The impl for transition properties were changed to public methods

* [ios, macos] Changelog update

* [ios] Fixed layer space formatting

* [core] The name space was fixed for getters that returned TransitionOptions

* [ios, macos] Added rawLayer transition property tests

* [ios] Added a factory method for MGLTransition and transition-related methods to NSValue(MGLAdditions)

* [ios, macos] Copyedited changelog blurbs about transition properties
2017-03-10 11:33:31 -08:00
Ivo van Dongen
517659b1b4 [core] query source features 2017-03-10 11:08:32 -08:00
Ivo van Dongen
4d325879b8 [core] rename query options for query rendered features 2017-03-10 11:08:32 -08:00
John Firebaugh
e044e0aab9 [core] Avoid using std::function in property_setter.hpp 2017-03-08 16:50:28 -08:00
Anand Thakker
bb846fd6cd For data-driven paint setters, transition immediately to target value (#8306)
Closes #8237
2017-03-08 11:53:44 -05:00
Asheem Mamoowala
60d10dd27d [core] Add support for queryRenderedFeatures filter 2017-03-04 15:42:07 -08:00
Minh Nguyễn
ac4e13416a [core] Enable debug events in Debug configuration 2017-03-04 12:48:33 -08:00
Thiago Marcos P. Santos
f6cd017f58 [Qt] Remove legacy QOpenGL dependency from Qt5 build
OpenGL on Qt5 is offered via QtGui.
2017-03-03 17:28:07 -08:00
Bruno de Oliveira Abinader
c461dad5ee [core] Safeguard ICU UChar usage 2017-03-02 11:40:42 -08:00
Jesse Bounds
e1546644b5 [core] Cache file source base URL and access token
This caches the base URL and access token values when they are set
so that they can still be retrieved even when the thread is paused.
2017-03-01 08:25:44 -08:00
Anand Thakker
f901e776b3 [core] Implement data-driven styling for {text,icon}-{color,opacity,halo-color,halo-blur,halo-width} (#7939)
* Add symbol dds attributes and adapt style code generation

* Update to mapbox-gl-js/master

* Refactor SymbolFeature as a subclass of GeometryTileFeature

Prepares for enabling DDS on symbol paint properties by allowing the
SymbolFeatures, which we keep around after constructing SymbolLayout,
to be used in evaluating data-driven paint properties later in the
layout process.

* Draft approach for splitting icon/text paint properties

The `Program` types are set up to bind GL attributes to each of the
data-driven paint properties specified in the `PaintProperties` type
provided.  Since `SymbolPaintProperties` specifies both `Text*` and
`Icon*` properties, the symbolIcon, symbolIconSDF, and symbolGlyph
programs each attempt to bind roughly double the number of attributes
that they actually need.

This change addresses this by:
- Adding the more specific `IconPaintProperties` and `TextPaintProperties` types, which are subsets of the full `SymbolPaintProperties`.
- The symbol layer continues to use its `SymbolPaintProperties paint` member to track layer property state, but it provides helpers that construct objects of each the specific `{Icon,Text}PaintProperties::Evaluated` type, for use by the painter.
- The three symbol programs instantiate `Program<>` using the appropriate `{Icon,Text}PaintProperties` type.

* check in generated style code

* Populate paint buffers for symbol DDS properties

* Address first round of review comments

* Refactor VectorTile{Layer,Feature} to explicitly share data

* Update submodule
2017-02-28 19:54:24 -08:00
Tobrun
34fef22d95 [core] [android] - allow zooming/scaling to use AnimationOptions (#8181)
[glfw] - allow glfw binding to use AnimationOptions instead of using direction directly
2017-02-28 13:22:47 -05:00
Thiago Marcos P. Santos
4c2e720b15 [core] Add a pause/resume API to the DefaultFileSource
It will halt the networking thread completely. Expired and error'ed
tiles won't get re-requested until resume() is called again.
2017-02-25 14:03:38 +02:00
Tobrun
a0992f0550 [core] - allow moveBy to use AnimationOptions
[android] - update jni bindings for moveBy with an interpolator
2017-02-20 16:52:18 -08:00
John Firebaugh
7d3c9338c9 [core] Link BackendScopes in a list for additional assertions 2017-02-20 12:04:21 -08:00
John Firebaugh
773f330774 [core] Ensure that context resources are destroyed before context is destroyed 2017-02-20 12:04:21 -08:00
John Firebaugh
694159c49e [core] Nestable BackendScope 2017-02-20 12:04:21 -08:00
Konstantin Käfer
e2d8a83664 [core] add ability to transform URLs before they're requested from the Internet 2017-02-20 14:36:27 +01:00
Anand Thakker
062b18374d [core] Enable property functions for text-{field,transform} (#7944) 2017-02-17 13:16:25 -08:00
Anand Thakker
685f237d02 Refactor: use conversion system to convert MGLStyleFunction to mbgl core types (#8026)
This leverages the work already happening in `mbgl::style::conversion` to convert style functions from style-spec definitions into `mbgl::style::{Camera,Source,Composite}Function`s.  In particular, this allows the conversions system to handle the differing typing requirements based on whether the output type of the style function is interpolatable or non-interpolatable.
2017-02-15 17:16:54 -05:00
John Firebaugh
f030da5ccd [core] Add noexcept(false) in MBGL_CHECK_ERROR
C++11 destructors are noexcept by default, so the prior definition always called std::terminate without allowing anything to catch the exception.
2017-02-15 11:22:23 -06:00
John Firebaugh
94f011895c [core] Make Image safer
Provide Image::copy, which handles copying rectangles from a source to a destination, with thorough bounds checking.

Also fixes an indexing error in SpriteAtlas, where the top row of pixels in a wrapped image was copied from the wrong source row.
2017-02-14 12:29:01 -06:00
Jason Wray
4c311a0091 [core] Expose Map::setZoom with anchor parameter 2017-02-13 18:35:04 -05:00
John Firebaugh
a1a639120d [core] Introduce dedicated filter types for $type and $id special cases (#7971)
* [core] Introduce dedicated filter types for $type and $id special cases

* [ios, macos] Special-case $id, $type in predicates

Also support $id ≟ nil.
2017-02-09 14:18:57 -08:00
John Firebaugh
b6e5edc268 [core] Restore support for *-transition properties 2017-02-09 15:08:51 -06:00
John Firebaugh
f35ca0d9df [core, ios, macos] Refactor composite stop types and conversions 2017-02-09 11:16:26 -06:00
Thiago Marcos P. Santos
e6659242bc [core] Do not consider error'ed responses fresh
It has the unwanted side effect of not retrying anymore in case
of error.
2017-02-07 12:17:40 +01:00
Jesse Bounds
22b3834caa [ios, macos] Add support for data-driven property functions 2017-02-02 09:44:42 -08:00
Ivo van Dongen
8a5bff8ee6 [core] default value support in categorical function conversion 2017-02-02 09:44:42 -08:00
John Firebaugh
141e995806 [core] Add support for data-driven styling 2017-02-02 09:44:42 -08:00
Konstantin Käfer
62ea1f2185 [core] remove trailing whitespace, add trailing newlines, add space after // 2017-01-27 11:44:16 +01:00
Konstantin Käfer
46fe0df2a2 [core] add clone() call to Image objects 2017-01-26 15:26:55 +01:00
Thiago Marcos P. Santos
375e31891d [core] Include what you use 2017-01-20 20:24:11 +01:00
Thiago Marcos P. Santos
cbf28083e6 [Qt] Use Qt's OpenGL header 2017-01-20 16:08:04 +01:00
Minh Nguyễn
7ef2843e6a Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.7 2017-01-16 11:38:35 -08:00
John Firebaugh
0c0064c050 [core] Get rid of user-specified refs 2017-01-04 17:38:33 -08:00
John Firebaugh
59803d3025 [core] Use PropertyMap typedef 2017-01-04 17:38:33 -08:00
John Firebaugh
4d6c5b2d3b [core] Remove constexpr from Color
GCC can't cope with it.
2017-01-04 12:10:27 -08:00
John Firebaugh
83309fd369 [core] Filter operator== 2017-01-04 08:52:41 -08:00
Ansis Brammanis
38b5cb0c77 [core, ios] replace altitude with fov
ported from -js: eb6c6596c6a7a61363d30356674e0002153b1d19

`altitude` was a terribly-named variable that was used to indirectly
control the fov. This should eliminate some confusion.

`altitude` was equivalent to `cameraToCenterDistance / height`
2016-12-21 15:46:36 -08:00
Minh Nguyễn
117c8ed1d1 [core] Added URL accessor for tile sources 2016-12-20 21:05:40 -08:00
Minh Nguyễn
a6b1773a44 Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.5-master
Also reran make style-code and manually discarded anything related to fill extrusion layers.
2016-12-20 12:41:40 -08:00
Ivo van Dongen
18730d598d [core] use raii to guard backend deactivation 2016-12-13 10:03:05 -08:00
Ivo van Dongen
c76a933514 [core] use raii to guard backend deactivation 2016-12-12 09:05:23 -05: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
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
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
Roman Blum
1045934d5e [core, ios, macos] Add image accessor to MGLStyle (#7096)
* [core] Add interface to get image from sprite atlas

* [tests] Add tests for Map::getImage

* [ios, macos] WIP: get MGLImage for name from style

* [ios, macos] Fixed -imageForName:

Convert from sprite images to platform images using the existing encodePNG() function, which is also used for printing. Allow -imageForName: to return nil without an assertion failure. Added a basic test.
2016-12-05 17:16:13 -08:00
Minh Nguyễn
3503c0e767 Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.4-master 2016-12-03 15:36:42 -08:00