Commit Graph

1434 Commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
f3fc87261c [core] Coordinate is now GeometryCoordinate
Also introduced GeometryCoordinates (vector of GeometryCoordinate
items), to better cope with GeometryCollection.
2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
411a562061 [core] Enforce constants usage
Use 'LATITUDE_MAX', 'LONGITUDE_MAX', 'DEG2RAD' and 'RAD2DEG' whenever
possible.
2016-03-01 20:58:54 +00:00
Thiago Marcos P. Santos
f683b10e10 [core] Build fix
Fix no viable conversion on OSX.
2016-02-26 04:21:28 +02:00
Thiago Marcos P. Santos
59a45b8400 [core] Add timeout for clock skew
If the server keeps sending replies considered from the client in the
past (there is no way to tell if the server or client clock is wrong),
the client will try to interpolate a valid expiration time based
on the delta of the expiration intervals sent by the server.

If the intervals are always the same, exponential backoff kicks in
until we get a different expiration time from what we already have.
2016-02-26 03:52:02 +02:00
John Firebaugh
065cda83fa [core] Limit total number of offline Mapbox tiles 2016-02-24 13:38:14 -08:00
John Firebaugh
65c06e6270 [core] status.requiredResourceCountIsIndeterminate ⇢ status.requiredResourceCountIsPrecise
Change the name and reverse the sense. Naming things in the positive is better than naming them in the negative.
2016-02-24 13:38:14 -08:00
John Firebaugh
5a6cee0dd0 [core] Add a descriptive comment about maximumCacheSize 2016-02-24 13:38:14 -08:00
Minh Nguyễn
17f44d7bd9 Merge branch 'release-ios-v3.1.0' 2016-02-24 09:06:43 -08:00
Bruno de Oliveira Abinader
ee72e93f94 [gl] Moved VAO helpers to common header 2016-02-18 13:27:35 +02:00
John Firebaugh
d66d145c6e [core] Remove RunLoop::{ref,unref} 2016-02-16 12:48:50 -08:00
Ansis Brammanis
47dc38bf4a [core] less slanted dashed lines near sharp corners
port https://github.com/mapbox/mapbox-gl-js/pull/2043 from -js
2016-02-15 12:55:41 -08:00
Gabriel Miklós
d742c2d3eb [core] Add support for updating point annotations 2016-02-12 16:47:24 -08:00
John Firebaugh
13e2acbc75 [ios, osx] Consolidate remaining files in platform/{ios,osx} 2016-02-12 14:53:52 -08:00
Konstantin Käfer
5726d2b357 [core] use std::move() to prevent copies 2016-02-11 12:17:33 +01:00
John Firebaugh
a9e0c1b99a [core] Eliminate maximumCacheEntrySize
Instead, the eviction policy accounts for the actual size needed for an incoming put.
2016-02-10 15:40:20 -08:00
John Firebaugh
db3620c58f [core] Implement an eviction policy for OfflineDatabase
When inserting an cached resource, or removing a region, remove least-recently used resources and tiles, not used by offline regions, until the used database size, as calculated by multiplying the number of in-use pages by the page size, is less than the maximum cache size minus 5 times the page size.

In addition, OfflineDatabase may be configured to ignore cache puts of individual resources larger than a certain size.

This policy is similar but not identical to the former SQLiteCache policy:

* It accounts for offline, by exempting resources required by offline regions from eviction.
* It must delete from two tables (resources and tiles), rather than one. Currently the strategy is naive: evict 50 rows at a time from each table.
* It makes maximumCacheSize and maximumCacheEntrySize completely independent. The SQLiteCache implementation evicted when `usedSize > maximumCacheSize - 2 * maximumCacheEntrySize`. This evicts when `usedSize > maximumCacheSize - 5 * pageSize`.
* It uses a non-unlimited default value for maximumCacheSize: 50 MB. We should have always had a limit in place; "a cache without an eviction policy is a resource leak".
2016-02-10 15:40:20 -08:00
John Firebaugh
5d42321b73 [core] Make {Default,Online}FileSource::Impl more similar 2016-02-10 15:40:20 -08:00
John Firebaugh
c91b44b02f Add binary for smoke-testing offline downloads 2016-02-10 15:40:20 -08:00
John Firebaugh
c3c4c7b9a6 [core] Interface and implementation for offline 2016-02-10 15:40:20 -08:00
John Firebaugh
e9302c797f [all] Don't interpret 404s on non-tile resources as "no content" 2016-02-10 15:40:20 -08:00
John Firebaugh
7eb1a91c4e [all] Do not set Response data for 404s
For AssetFileSource and the node FileSource this was already the case; this makes the other implementations consistent.
2016-02-10 15:40:20 -08:00
John Firebaugh
cdedb66387 [core] Reimplement existing caching within an offline-capable database schema 2016-02-10 15:40:20 -08:00
John Firebaugh
dbb8e58aea [core] Moving caching logic to DefaultFileSource
This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource, and no more.
2016-02-10 15:40:20 -08:00
Minh Nguyễn
bd59ab9a52 [core, ios, osx] Only constrain after adding to a window
Introduced a setter/getter for constrain mode. On iOS and OS X, the zoom level inspectable causes the zoom level to be set independently from the longitude and latitude. Thus, the latitude inspectable had no effect because the latitude was constrained to 0 at z0. Temporarily removing the heightwise constraint allows the map to center on the intended location before zooming, which is the usual case for storyboards and XIBs. On iOS, the only guarantee we have timing-wise is that all the inspectables are applied after initialization but before the view is added to a window. So we reimpose the heightwise constraint as soon as the view is added to a window, that is, before the user has a chance to pan the map out of bounds.

Fixes #3868.
2016-02-10 15:15:29 -08:00
Konstantin Käfer
33b63f0ef6 [glfw] add "C" button to show stencil clip masks 2016-02-10 11:35:17 +01:00
Konstantin Käfer
e74987b07f [core] move GL value objects from gl_config.hpp to gl_values.hpp
Also removes duplicate code from gl_helper.hpp by reusing the GL values that we already have anyway.
2016-02-08 12:50:00 +01:00
Konstantin Käfer
5c3b01ffcf [core] move util/gl_helper.hpp to gl/gl_helper.hpp 2016-02-08 12:50:00 +01:00
Konstantin Käfer
2f06ca74e2 [core] move platform/gl.hpp to gl/gl.hpp 2016-02-08 12:50:00 +01:00
John Firebaugh
4d29c7d5ce [core] Remove Response::Error::Reason::Canceled
There is no such thing as a cancelled response, only cancelled requests. A request that is cancelled does not have its callback called with a Response.
2016-02-04 13:18:14 -08:00
John Firebaugh
bc1f4b1fc0 [core] Comparison operators for LatLngBounds 2016-02-03 18:09:06 -08:00
Brad Leege
87bac32a33 [core] #509 - Creating and using MIN_ZOOM and MAX_ZOOM constants 2016-02-03 18:57:22 -06:00
John Firebaugh
235210c648 [core] Make bool conversions explicit
Implicit bool conversions are bad; they'll be used e.g. for a == b and a != b if those operators are not defined. This was happening at 032c8fba3c/src/mbgl/map/transform.cpp (L132-L132), for example.
2016-02-03 10:02:25 -08:00
John Firebaugh
37c27f3a8f [core] Improve LatLngBounds API
* Use "named constructors": empty, world, hull
* Make the two-argument constructor lenient (i.e., it is a hull operation)
* Add various accessors
* Enforce a single empty representation
2016-02-02 23:04:18 -08:00
John Firebaugh
032c8fba3c [core] Remove unused 2016-02-02 20:20:47 -08:00
John Firebaugh
b78bc7c555 [core] Remove superflous inlines 2016-02-02 18:53:37 -08:00
John Firebaugh
7c00432528 [core] Remove unused 2016-02-02 18:53:37 -08:00
John Firebaugh
82d67d6912 [core] Remove unused 2016-02-02 18:53:37 -08:00
Ansis Brammanis
4e0d1070f6 [core] support tiles with non-4096 extents
Convert all geometries to the maximum extent supported by our buffers
and then use that constant extent everywhere else.
2016-02-02 14:49:03 -08:00
Minh Nguyễn
7694eebe88 [ios] Renamed -showAnnotations:withEdgeInsets:animated:
Renamed -showAnnotations:withEdgeInsets:animated: to -showAnnotations:edgePadding:animated: for consistency with other methods. Reworded documentation comments to avoid hard-coding too many specifics that are prone to getting outdated.
2016-02-01 20:55:55 -08:00
Jordan Moncharmont
909832624e Custom edgeInsets for fitting in showAnnotations
Keeps sensible defaults already in place, but allows callers to override.
2016-02-01 20:55:55 -08:00
John Firebaugh
8aa3359ff0 [core] Don't use struct
It makes forward declarations inconsistent and liable to change, for no real gain.
2016-02-01 16:32:59 -08:00
John Firebaugh
2920020fb8 [core] Change TileData pixelRatio to an integer 2016-01-29 17:16:06 -08:00
John Firebaugh
b41a73e1c1 [core] Rationalize Resource initialization 2016-01-29 14:50:15 -08:00
John Firebaugh
849e8b32b4 [core] Ensure that FileSource has access to tile URL, pixelRatio, x, y, z 2016-01-29 14:50:15 -08:00
Minh Nguyễn
6995452541 [ios] Restored toggleDebug
Restored (but deprecated) a method removed in #3100 to avoid a major version bump.
2016-01-28 22:36:58 -08:00
Minh Nguyễn
6b3b3f3ff6 [ios] Debug mask
Ported MGLMapDebugMaskOptions from the OS X SDK. Deprecated debugActive and -cycleDebugOptions.
2016-01-28 22:23:07 -08:00
Ansis Brammanis
b738087080 [osx] setMaximumZoomLevel, setMinimumZoomLevel
adds:
setMaximumZoomLevel
setMinimumZoomLevel

and makes `maximumZoomLevel` and `minimumZoomLevel` not readonly
2016-01-28 15:10:26 -08:00
Ansis Brammanis
371a210be8 [ios] getters, setters for minZoom, maxZoom
adds:
minimumZoomLevel
setMinimumZoomLevel
maximumZoomLevel
setMaximumZoomLevel
2016-01-28 15:10:26 -08:00
Ansis Brammanis
1644234179 [core] add setMaxZoom, setMinZoom
also change the default maxZoom to 20 to match -js.
2016-01-28 15:10:01 -08:00
Konstantin Käfer
e2a3c02d1a [core] destruct WorkTask data before calling the callback 2016-01-28 10:52:33 +01:00