summaryrefslogtreecommitdiff
path: root/src/mbgl/map
Commit message (Collapse)AuthorAgeFilesLines
* Add FreeCameraOptions to the Map classMikko Pulkki2020-05-025-2/+106
|
* Refactor TransformState to use internal 3d cameraMikko Pulkki2020-05-022-37/+100
|
* [core] Fix performance-unnecessary-value-param errors in header filesThiago Marcos P. Santos2020-04-172-2/+2
| | | | As reported by clang-tidy-8.
* [core] Fix readability-redundant-member-init errors in header filesThiago Marcos P. Santos2020-04-171-1/+1
| | | | As reported by clang-tidy-8.
* [core] Fix readability-avoid-const-params-in-decls errors in header filesThiago Marcos P. Santos2020-04-171-3/+3
| | | | As reported by clang-tidy-8.
* [build] Fix undefined behavour sanitizer (#16375)zmiao2020-04-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [build] Fix integer overflow runtime error for core part Temporarily remove circle ci UBSAN build precondition * [build] Enable all of the ubsans [build] Check runtime error [build] Update UBSAN_OPTION * [build] Add UBSAN blacklist [build] Ignore system libraries [build] Ignore vendor library * [build] Fix implicit conversion runtime error in core * [build] Fix division by zero runtime error * [build] Add unfixed error to ubsan blacklist * [build] Make UBSAN halt on error Revert "Temporary remove build precondition" * [build] Fix division by zero error * [build] Make UBSAN officially work without FIXME prefix * [build] Fix implicit conversion from int64_t to uint64_t * [build] Rename style test json file name * Address review findings
* Refactor tileCover to support lod tilesMikko Pulkki2020-04-062-1/+11
|
* [core] Fix readability-* errorsThiago Marcos P. Santos2020-03-301-3/+6
| | | | As reported by clang-tidy-8.
* [core] Fix modernize-return-braced-init-list errorsThiago Marcos P. Santos2020-03-231-1/+1
| | | | As reported by clang-tidy-8.
* [core] Fix performance-unnecessary-value-param errorsThiago Marcos P. Santos2020-03-235-20/+35
| | | | As reported by clang-tidy-8.
* [core] Introduce Renderer::clearData() instead of keepRenderData map optionsMikhail Pozdnyakov2020-03-203-15/+2
| | | | | | | | | | `Renderer::clearData()` is a better API than the removed `MapOptions::keepRenderData()`: - gives more flexibility to the client - similar to the existing `Renderer::reduceMemoryUse()` - the `MapOptions::keepRenderData()` API implementation could not handle the raise condition, which happened if the new still image request had come before all tiles from the previous requests were loaded. Co-authored-by: Dane Springmeyer <dane@mapbox.com>
* Add additional transformState::latLngToScreenCoordinate getter (#16311)galinelle2020-03-192-2/+7
| | | | | | This change adds a latLngToScreenCoordinate overload, to retrieve the projected vec4 in additional to the ScreenCoordinate object, that is useful to detect whether the projected latLng is in front or behind the camera.
* [core][tile|static mode] Introduce MapOptions::keepRenderData() flagMikhail Pozdnyakov2020-03-183-2/+15
| | | | Render orchestrator stores the render data between render frames if this flag is set.
* [core] Use weak annotation managerAlexander Shalamov2020-03-051-20/+18
| | | | | | | Map and renderer / orchestrator should be able to run on a separate threads, however, legacy AnnotationManager is shared between Map and Renderer, therefore is not a thread safe. Until AnnotationManager is deprecated and removed from a code-base, use it only via weak pointers.
* [core] FileSourceManager::getFileSource() returns PassRefPtrMikhail Pozdnyakov2020-02-261-1/+3
|
* [core] Return pitch bounds in degreesJuha Alanen2020-02-261-2/+2
|
* [core] Add min and max pitch optionsJuha Alanen2020-02-255-5/+79
|
* style::Style::getImage() returns optional<style::Image>Mikhail Pozdnyakov2020-02-111-3/+1
|
* [core] Loading images to style optimizationMikhail Pozdnyakov2020-02-111-1/+0
| | | | | | This change enables attaching images to the style with batches and avoids massive re-allocations. Thus, it improves UI performance especially at start-up time.
* [core] Simplify Placement::addLayer()Mikhail Pozdnyakov2020-01-221-1/+2
|
* [core] Modularize FileSource codebase (#15768)Alexander Shalamov2020-01-132-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [core] Introduce FileSourceManager and use it for default platform impl - Add `FileSourceManager` interface that provides access to `FileSource` instances and means of registering / unregistering `FileSource` factories - Split `DefaultFileSource` into smaller parts - Add `DatabaseFileSource` interface and it's default implementation - Remove inter-dependencies between concrete `FileSource` classes * [build] Add files to next build system * [core] Add generic property setters / getters * [core] Remove setOnlineStatus from OnlineFileSource interface * [core] Hide threading implementation details from DatabaseFileSource interface * [core] Make DB file source methods virtual * [core] Add documentation for DatabaseFileSource and rename one method * [core] Use simple callback instead of ActorRef * [core] Remove ActorRef from OnlineFileSource public header * [core] Add callback to FileSource::forward async API * [core] Pass OfflineRegionDefinition by value * [core] Update tests to use modular file sources * [core] Update unit tests * [core] Update unit tests after rebase * [core] Backport low prio fix for cached requests * [core] Backport pack database * [core] Return removed factory from unRegisterFileSourceFactory * [core] Rename shadowed args in onlinefilesource * [core] Remove simple std::function callback aliases * [core] Expose online file source property keys in public header file * [test-runner] Add proxy file source test runner * [cache] Update mbgl-cache utility to use new file source * [metrics] Rebaseline binary size metrics * [offline] Update offline utility * [core] Update changelog
* [android][core] Add `Map::latLngBoundsForCameraUnwrapped` and jni binding ↵Peng Liu2020-01-091-0/+21
| | | | | | | | | for `getVisibleCoordinateBounds`. (#16069) * [android] Add getVisibleCoordinateBounds method. * Fix Map::latLngBoundsForCamera, add Android binding for getVisibleRegionBounds. * Add unit tests for CameraToLatLngBoundsWithRotation and CameraToLatLngBoundsCrossDateLine. * Move API breaking changes to a new method name latLngBoundsForCameraUnwrapped.
* Include padding when testing camera scale in cameraForLatLngBoundsAleksandar Stojiljkovic2019-12-171-1/+4
| | | | | Repurpose LatLngBoundsToCameraWithBearingAndPitch to test scaling and camera setup, both with and without padding. This adds testing of path not covered in mapbox/mapbox-gl-native-ios#59.
* correct insets camera management - see ↵Romain Quidet2019-12-171-16/+3
| | | | https://github.com/mapbox/mapbox-gl-native-ios/issues/59
* [core] Refactoring transform state (#15956)zmiao2019-12-054-189/+518
| | | | | | | | | | * [core] Refactoring transform state class * [core] update matrix in transform, Fix precision * [core] Make matrix mutable so that we only update them when needed * [core] Add getters for matrices
* [core] Remove Map::cycleDebugOptionsBruno de Oliveira Abinader2019-12-041-24/+0
|
* [core] Fix MapSnapshotter build failure on WindowsAnder Conselvan de Oliveira2019-11-132-8/+4
| | | | | | | | MSVC implementation of std::promise is buggy and only works with types that can be default-constructed. To avoid a compilation failure in the instantiation of ask() inside MapSnapshotter::getRegion(), which creates a std::promise<LanLngBounds>, make LatLngBounds' default constructor public.
* [core] Add batch conversion of latLngs to/from screenCoords (#15891)zmiao2019-11-071-0/+18
| | | | | | * [core] Add batch conversion of latLng vs screenCoord * [core] Take the simple approach
* [core] Fix performance-move-const-argThiago Marcos P. Santos2019-09-251-1/+1
|
* [core] Update MapObserver::onDidFinishRenderingFrame() APIMikhail Pozdnyakov2019-09-121-1/+1
|
* [core, ios] Call transitionFinishFn for jumpTo. (#15473)Julian Rex2019-09-051-0/+9
|
* [core] make padding optional when camera position is requested.Łukasz Paczos2019-08-295-6/+6
| | | | When padding is not provided, the current one that's cached in the TransformState is going to be returned.
* [core] Fix tileCover / TileCoordinate fromScreenCoordinate(#15442)Aleksandar Stojiljkovic2019-08-232-3/+13
| | | | | | | Remove unecessary tile coordinate unproject -> project step. Unproject+project isn't always a noop and this was the issue leading to wrong cover calculation in high pitch values. Fixes: https://github.com/mapbox/mapbox-gl-native/issues/15442
* [core] Export symbol placement update status from MapObserverMikhail Pozdnyakov2019-08-232-3/+3
|
* Changelog entries and a nit for #15281Aleksandar Stojiljkovic2019-08-081-1/+1
|
* [core] Reuse flyTo constant screen velocity calculation for easeTo ↵Aleksandar Stojiljkovic2019-08-082-18/+26
| | | | | | | | | | | | | implementation. When using flyTo for easeTo: Limit zoom out to min(startZoom, targetZoom). Reduce cinematic zoom in animation at the end of transition, Linear zoom interpolation. The patch also sets linear interpolation for flyTo edgeInsets animation, as it looks more appropriate to follow the approach taken for pitch and bearing. Fixes: #15144
* [core] easeTo: linear interpolation over zoom instead of scaleAleksandar Stojiljkovic2019-08-081-6/+5
| | | | Fixes: 15144
* [core] Limit pitch based on edge insets. Fix max Z calculation in getProjMatrix.Aleksandar Stojiljkovic2019-08-013-16/+38
| | | | | | | | | | | | | Patch partly fixes #15163 in a way that it doesn't allow loading tens of thousands of tiles and attempt to show area above horizon: Limit pitch based on edge insets. It is not too bad - current limit of 60 degrees stays active until center of perspective is moved towards the bottom, to 84% of screen height. The plan is to split removal of 60 degrees limit to follow up patch. Fix max Z calculation in getProjMatrix. TransformState::getProjMatrix calculation of farZ was complex with possibility to lead to negative z values. Replacing it with simpler, precise calculation: furthestDistance = cameraToCenterDistance / (1 - tanFovAboveCenter * std::tan(getPitch())); TransformState::getProjMatrix calculation of farZ was an aproximation. Replacing it with simpler, but precise calculation. Related to: #15163
* [core] Fix collision with content insetsAleksandar Stojiljkovic2019-07-172-8/+8
| | | | | | | | | | | | | | | Viewport center offset usage was wrongly submitted in #14664. It was part of alternative approach that used enlarged viewport. Existing and added tests were not sufficient to spot the regression, since the collision check padding is usually larger than the center offset x and y. Annotation picking has tolerance of only 10 pixels but no annotation integration test was using content insets. Usage of offset is not needed because `posMatrix` in e.g. `CollisionIndex::projectPoint(const mat4& posMatrix, const Point<float>& point)` already incorporates center offset (projection matrix) and the code in current master was just offsetting all by the value. Modified [ios] MGLAnnotationViewIntegrationTests.testSelectingAnnotationWithCenterOffset to use different insets. It verifies the fix. Fixes [iOS] Annotations are not selectable (added via iosapp menu) #15106: In case of #15106, view's original content insets is {top:88, bottom:34}, causing that center offset is {x:0, y:27} and selection with tolerance of 10 wouldn't select annotation. After tapping the view, so that the header gets removed, view's content insets get changed to {top:44, bottom:34}, center offset is {x:0, y:5} and annotation selection would work, as described in #15106. Fixes: #15106
* [core] decrease the minimum pixel distance required to interpolate during ↵Łukasz Paczos2019-07-091-1/+1
| | | | | | camera animation The changes introduced in #9199 changed the minimum required pixel distance between start and end points to >= 1px in order to interpolate, which in scenarios of big zoom changes and low pixel density can result in animation to the previous position and then a jump to the target.
* [core] TilePyramind uses TransformState::getScale()Mikhail Pozdnyakov2019-06-101-0/+3
|
* [core] Offset viewport center when edge insets are specifiedAleksandar Stojiljkovic2019-05-284-62/+67
| | | | | | | | | | | | | | | | | | | | | The change is implemented in TransformState::getProjMatrix, the rest of the code is making sure that existing API contracts stay and there are tests verifyingrendering and render query processing only items within screen and given tolerance around screen edges. MapView: don't bake edge insets into relalculated camera center. Keep edge insets as property of camera in TransformState (similar to pitch, zoom, bearing) independent from specified camera center. Interpolate edge insets in animation. iOS Demo app: "Turn On/Off Content Insets" pitch the camera and navigate to convenient location in Denver, where streets are parallel to cardinal directions, to illustrate viewport center offset when edge insets are set. Tests: ViewFrustumCulling: although Annotations are deprecated, queryRenderedFeatures related tests in Annotations would need to get ported and decided to add the edge insets related query tests next to them. Verify frustum culling (render+queryRenderedFeatures) With different camera and edge insets setups. TODO: port Annotations tests. Transform.Padding: Verify that coordinates take proper place on screen after applying edge insets. LocalGlyphRasterizer: verify text rendering when applying padding. Related to #11882: both use projection matrix elements [8] and [9]. Alternative approach to this was to increase and offset map origin so that the screen would be a sub-rectangle in larger map viewport. This approach has a drawback of unecessary processing the items that are outside screen area. Fixes #12107, #12728, navigation-sdks/issues/120
* [core] Forward ImageManagerObserver::onRemoveUnusedStyleImages to ↵Alexander Shalamov2019-05-212-0/+9
| | | | MapObserver interface
* [core] GeometryTile and TileLoader keep strong reference to FileSourceMikhail Pozdnyakov2019-05-141-1/+1
| | | | Thus we fix a potential bug: if `Renderer` outlives the `Map` it will hold a stale reference to the `FileSource` instance.
* Refactor: coordinatePointMatrix skip recomputation (#14507)Aleksandar Stojiljkovic2019-05-132-6/+6
| | | | | | | | coordinatePointMatrix is always used with getZoom(): Projection::worldSize(scale) / std::pow(2, z) is computed as scale * util::tileSize / std::pow(2, z) scale is equal to std::pow(2, z). ____________________________________=> Projection::worldSize(scale) / std::pow(2, z) => util::tileSize.
* [core] Make the BackgroundScheduler a singletonThiago Marcos P. Santos2019-05-103-10/+3
| | | | | | | | | | - Do not carry it over everywhere as parameter, it is a shared instance anyway and the lifecycle is pretty much the app lifecycle from the moment we instantiate a map. - Rename to BackgroundScheduler because it is a Scheduler that will do tasks in the background, we don't make assumptions if it is a thread pool or a single thread. - Most importantly, remove the dependency from `core` on `platform`.
* [core] clang-tidy fixesKonstantin Käfer2019-04-051-1/+1
|
* add onStyleImageMissing to allow dynamically loaded or generated images (#14253)Ansis Brammanis2019-04-022-0/+11
| | | Also make `Style#updateImage(...)` much faster when the image doesn't change size. This can be useful for asynchronously generating images.
* [core] Include pixelRatio property in MapOptionsSudarsana Babu Nagineni2019-03-284-8/+18
| | | | Move pixelRatio property from Map constructor to MapOptions.
* [core] Add setter/getter for size property in MapOptionsSudarsana Babu Nagineni2019-03-284-19/+16
|