Commit Graph

3542 Commits

Author SHA1 Message Date
Chris Loer
b414c607c3 Don't crash on placing symbols with 0 renderable glyphs
Fixes issue #11729. Close relative of issue #10956.
It is possible for us to receive Glyphs from the server that are valid, but have an invalid bitmap. In that case, the glyphs will be present in the `GlyphMap` used for shaping, but not present in the `GlyphPositions` used in `getGlyphQuads`. `SymbolInstance::hasText` looked at the shaping instead of the actual quads.
`symbol_projection.cpp` should never try to project a label without any quads, but we'll also try to make it so that it doesn't crash if it does.
2018-04-19 10:47:51 -07: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
Ł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
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
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
Ł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
dc495e1c9d [core] Add Projection matrix to CustomLayerRenderParameters to transform web mercator world coordinates to GL coordinates. 2018-04-05 18:04:25 -07:00
Asheem Mamoowala
099fcc3b3c Use a host interface for CustomLayer instead of function pointers (#11553)
Use a host interface for CustomLayer instead of function pointers

Co-authored-by: Julian Rex <julian.rex@mapbox.com>
2018-04-02 16:15:25 -07:00
Chris Loer
a2399a57a2 [core] Make FeatureIndex own GeometryTileData.
Prevents querying a FeatureIndex built against a separate set of data, which can lead to invalid index exceptions.
The GeometryTileWorker 'data' member can still change independently of the data in the feature index, at the time 'setData' is called. The GeometryTileWorker maintains ownership of its local data (which may be used to re-parse) and clones the data for use by the FeatureIndex in the foreground.
2018-04-02 10:39:22 -07:00
Chris Loer
11961d5c31 [core] Consolidate GeometryTile symbol/nonSymbolBuckets
Conversion to one-phase tile loading removed any need to track them separately.
2018-04-02 10:39:22 -07:00
Chris Loer
7f42e3970e [core] Convert GeometryTileWorker to "one-phase" loading
Modest simplification refactoring (issue #10457).
Also, fixes issue #11538, which was caused in part by a hole in the vestigial two-phase loading.
2018-04-02 10:39:22 -07:00
Minh Nguyễn
d066e94103 [core] Fixed to-rgba with zero opacity 2018-03-30 15:36:32 -07:00
Minh Nguyễn
f4d9fb816d [core] Round-trip linear interpolators 2018-03-30 15:36:30 -07:00
Chris Loer
e5a3a7a451 [core] Fix potential race condition crash in symbol querying..
Second half of fix for issue #11538.

If a global placement took place between the time a tile's non-symbol layout updated and the time new symbol buckets arrived, the tile's new FeatureIndex would be committed, but the global CollisionIndex would be generated against the old symbolBuckets. The mismatch could cause the CollisionIndex to contain indices that didn't exist in the new FeatureIndex, and attempting to access them would generate an out-of-bounds exception.
2018-03-29 09:04:23 -07:00
Chris Loer
f9b6d5f09c [core] Fix potential race condition crash in symbol querying..
First half of fix for issue #11538.

Testing `if (pendingData)` didn't work if there _was_ a data update, but the update was "the data for this tile is now null". In that case, the tile's FeatureIndex would be updated, but the tile's data member would remain unchanged.

In the case of a tile's data being deleted, the matching FeatureIndex would have an empty set of bucketLayerIDs, but the _old_ data would still be in place for querying, and the symbolBuckets might not be updated yet (pending onPlacement). In this case `bucketLayerIDs.at(indexedFeature.bucketName)` could throw an out-of-range exception.
2018-03-29 09:04:23 -07:00
John Firebaugh
9499a2bda7 [core] Don't resolve tokens after evaluating a text-field or icon-image expression (#11509) 2018-03-22 16:44:12 -07:00
Chris Loer
673f9e3648 [core] Double maximum label width by reducing glyph precision.
Fixes issue #11507.
Port of GL JS PR #6375.
2018-03-22 13:24:26 -07:00
Chris Loer
4dc191b8da [core] Avoid flashing on pitched overzoomed tiles.
Clamps perspective ratios in shaders.
Fixes issue #11487.
Port of GL JS PR #6365.
2018-03-21 13:26:30 -07:00
Ansis Brammanis
ef1dcc0d5b [core] don't hide icons if text is an empty string 2018-03-19 15:31:38 -07:00
John Firebaugh
449c68e329 [core] Update mapbox-gl-js 2018-03-14 15:26:28 -07:00
John Firebaugh
2912a1423d [core] Stringify expression syntax, not function syntax 2018-03-14 15:26:28 -07:00
Asheem Mamoowala
a57be420b0 [core] TileJSON conversion clamps bounds longitude to [-180,180], per spec 2018-03-09 12:00:12 -08:00
Lucas Wojciechowski
8a3deab733 [core] Add expression filter support (#11251)
* WIP

* WIP

* WIP

* Remove Filter::operator()(const Feature&)

* WIP

* WIP

* WIP

* WIP

* Hook up expression filter evaluator

* Replace `shared_ptr` with &reference

* Fill in implementation of `void operator()(const ExpressionFilter&)`

* Fix failing tests

* Switch back to a shared_ptr per chat with @anandthakker

* Fix benchmark compilation

* Shot in the dark to fix CI

* Shot in the dark to fix CI (part 2)

* Shot in the dark to fix CI (part 3)

* In src/mbgl/style/conversion/filter.cpp, add a port of isExpressionFilter and use it to decide in Converter<Filter>::operator() whether to parse the incoming JSON as an ExpressionFilter or one of the legacy filter types

* Remove bool Filter::operator()(const GeometryTileFeature&) const

*  Ensure the map zoom is passed into filtering operations wherever applicable

* Add expression filter tests

* Addressed PR feedback

* Implement `NSPredicate *operator()(mbgl::style::ExpressionFilter filter)`

* Fix formatting& nit
2018-03-09 11:12:14 +01:00
Łukasz Paczos
dfdfbc0990 [android] calculating camera's LatLng for bounds without map padding (#11410) 2018-03-08 15:55:47 +01:00
Anand Thakker
8ed540ea7b Port fix for "at" expression off-by-1 error (#11375)
* Port fix for "at" expression off-by-1 error

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

* Consistency

* Add ignores for symbol positiong differences in real-world tests
2018-03-02 16:38:46 -05:00
John Firebaugh
54f3dc961e Relax type checking for "length" 2018-03-01 17:02:26 -08:00
John Firebaugh
15ba70b5ff Infer type assertions for object
Cross-ports https://github.com/mapbox/mapbox-gl-js/pull/6243.
2018-03-01 17:02:26 -08:00
Ivo van Dongen
1f73c9999e [core] blacklist vao usage on mali t720 (sapphire 650)
Avoids problems on (amongst others) Samsung Galaxy J3
2018-03-01 12:21:32 +01:00
Ivo van Dongen
fdd9890461 [core] check opengl error state after custom layer invocations 2018-03-01 12:21:32 +01:00
Chris Loer
75feda12f1 [core] Implement Expression::serialize()
Issue #10714
- Each expression stores its operator as a string, and default serialization is [operator, serialize(child1), ...]
- Custom implementations of `serialize` for Expression types that don't follow the pattern
- expression::Value -> mbgl::Value converter
- node_expression bindings to expose `serialize`
2018-02-28 16:09:09 -08:00
Konstantin Käfer
dfeb5b25d3 [core] continue loading style even if we mutate it
When we load a stale style from cache, and the user immediately starts mutating it, we should continue loading the style so that we'll get a fresh copy of the data into our cache and avoid perpetually showing the stale style.
2018-02-23 16:55:22 +01:00
Chris Loer
b79a1cc82e [core] Don't reuse heatmap render texture on viewport resize.
Fixes issue #11228.
2018-02-22 09:10:13 -08:00
Asheem Mamoowala
054d4d5ad6 [core] Support a range of zooms in TileRange. Accounts for TilePyramid requesting parent tiles of ideal zoom tiles. 2018-02-20 14:23:42 -05:00
Vladimir Agafonkin
82de856c94 [core, ios, macos, android, node] Heatmap layer (#11046)
Co-Authored-By: Konstantin Käfer <mail@kkaefer.com>
Co-Authored-By: Anand Thakker <anandthakker@users.noreply.github.com>
Co-Authored-By: Minh Nguyễn <1ec5@users.noreply.github.com>
2018-02-15 17:38:23 +02:00
Ansis Brammanis
1fdec7a5c1 [core] fix opacity of duplicate labels with -allow-overlap: true 2018-02-15 09:36:29 -05:00
Molly Lloyd
8a283b0306 [core] add support for mapzen terrarium (#11154)
* add support for mapzen terrarium

* Encoding --> DEMEncoding, avoid if statement when unpacking elevation values

* add Terrarium test

* update submodule

* remove redundant checks
2018-02-14 13:17:55 -08:00
Molly Lloyd
a386cac452 [core] add maxzoom uniform for raster-dem tilesets (#11134)
* add maxzoom uniform to support external tilesets

* update git sha for gl-js

* try and fix android crash

* name default maxzoom constant
2018-02-14 11:28:51 -08:00
Chris Loer
a11b277bc1 [core] Rename "onLowMemory" to "reduceMemoryUse".
Android still calls "reduceMemoryUse" only while handling a low memory event.
iOS, on the other hand, calls "reduceMemoryUse" every time it enters the background.
2018-02-14 10:55:16 -08:00
Chris Loer
f721779963 [core] fix onLowMemory to release GL buffers
Context cleanup must be called _after_ render sources release tiles.
2018-02-14 10:55:16 -08:00
Asheem Mamoowala
aefc3daeed TileJSON Bounds allows values inclusive of world extents 2018-02-12 16:56:20 -08:00
Thiago Marcos P. Santos
fb65d25831 [core] Make RendererObserver a public interface
Needed by backends implementing asyncronous rendering
2018-02-09 20:28:54 +02:00
Asheem Mamoowala
6c5e457590 Add options for Custom Geometry Source types to enable clipping and wrapping geometry (#11041) 2018-02-07 12:07:31 -08:00
Molly Lloyd
e03f7a4d1f [core] align raster-dem tiles to pixel grid (#11119)
* align raster-dem tiles to pixel grid

* revert ignored hillshade tests
2018-02-06 10:56:42 -08:00
Chris Loer
d3deb6d71b [core] Don't crash on line labels with 0 glyphs.
Fixes issue #10956.
2018-02-06 09:12:21 -08:00
Chris Loer
14db958ae5 [core] Account for overscaling in debug collision circles.
Fixes issue #11116.
Port of GL JS issue $6041.
2018-02-06 08:46:15 -08:00
Asheem Mamoowala
671dfefc1e Reset tileset-based render sources when any tileset properties changed. (#11042) 2018-02-05 19:31:03 -05:00
Tobrun
e2a4dffcb6 [android] - blacklist adreno 2xx for VAO support 2018-01-31 12:58:22 +01:00
Konstantin Käfer
191c0124c7 [core] don't force downloading of Open Sans fonts
When a SymbolLayer doesn't have a text-font defined, we automatically add Open Sans/Arial Unicode MS. However, when the SymbolLayer is only used for rendering icons, it doesn't have text-field defined either. In those cases, we still force downloading Open Sans/Arial Unicode MS during offline pack creation. If the user doesn't use this font, this change should save ~15MB and a few seconds in download time.
2018-01-25 17:21:18 -08:00
Konstantin Käfer
c148a7a061 [core] align implementations of local and asset file source 2018-01-25 13:45:47 -08:00
Konstantin Käfer
fcc3808c83 [core] align raster imagery rendering to pixel rid to avoid blurriness 2018-01-24 17:02:18 -08:00