Commit Graph

2256 Commits

Author SHA1 Message Date
John Firebaugh
f1f53c36d0 [core] Simplify latLngToCoordinate calculation 2016-02-02 12:56:44 -08:00
John Firebaugh
f198f306f3 [core] Remove unused 2016-02-02 12:44:28 -08:00
John Firebaugh
5512d87362 [core] Remove TransformState::getNormalizedZoom
It calculated the same value as TransformState::getZoom.
2016-02-02 12:44:28 -08:00
John Firebaugh
7e18945f90 [core] Remove unused declarations 2016-02-02 12:44:28 -08:00
John Firebaugh
52689796df [core] Normalize only raster source tile URLs 2016-02-01 20:25:55 -08:00
John Firebaugh
04cc019f54 [core] Refactor TileJSON parsing for offline 2016-02-01 15:33:37 -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
John Firebaugh
4dc7ec0202 [core] Camel-case member names 2016-01-29 14:49:25 -08:00
Ansis Brammanis
0439d00313 [core] fix redoPlacement blocking main thread, fix #3727
If a workRequest exists, don't cancel it and start an new request. It's
ok to just do nothing if the request exists because a new call to
redoPlacement will be triggered after the existing request finishes.

this fixes a regression in e44db93f1c
2016-01-29 10:35:40 -08:00
John Firebaugh
d90d374203 [core] Move rapidjson document creation into StyleParser 2016-01-28 17:37:23 -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
Minh Nguyễn
8a23bdcd01 [core, ios, osx] Tilt around visual center point
The tilt gesture on both iOS and OS X now respects the content insets. On iOS, in user tracking mode, it additionally respects the user dot’s position if it’s aligned to the top or bottom of the view.
2016-01-26 18:49:01 -08:00
Ansis Brammanis
9dcaab1933 [core] bump sprite atlas to 1024x1024 2016-01-26 13:27:16 -08:00
Bruno de Oliveira Abinader
2f86467586 Cleanup std::chrono usage
Use mbgl::Duration and mbgl::{,Milli}Seconds whenever possible.
2016-01-25 15:11:18 +02:00
John Firebaugh
a877b9b192 [core] Include prior values of caching headers in Resource
This allows the FileSource interface itself to support revalidation. We could (and probably should) now rewrite HTTPContextBase implementations as FileSource implementations.
2016-01-22 18:42:53 -08:00
John Firebaugh
27134df2e4 [core] Use notModified to check for style change 2016-01-22 18:42:53 -08:00
John Firebaugh
73ddff60ad [core] Avoid storing raw glyph data in addition to parsed representation 2016-01-22 18:42:53 -08:00
John Firebaugh
bf48467b8c [core] Remove unused parts of chrono.hpp 2016-01-22 18:41:54 -08:00
John Firebaugh
cef5c331fe [core] Merge rfc1123, iso8601, and parse_date into chrono.hpp and fix their API 2016-01-22 18:41:54 -08:00
Ansis Brammanis
5cd123422e [core] fix missing icon collision boxes
port https://github.com/mapbox/mapbox-gl-js/pull/1981
2016-01-22 18:00:49 -08:00
Ansis Brammanis
ded8b62c91 [core] use nearest neigbour for some line icons
Use nearest neighbour texture filtering to draw sharper icons when the
icons are aligned with the viewport. This matches -js.
2016-01-22 14:02:09 -08:00
Ansis Brammanis
0101fc0c89 [core] trigger repaint after placement is redone
fixes #3140

This also fixes a bug where placement could be redone with a stale
PlacementConfig after the tile first finishes loading.
2016-01-22 13:57:33 -08:00
Konstantin Käfer
b22073a5b2 [core] don't use expensive fmod to get fractional part 2016-01-22 12:03:14 +01:00
Konstantin Käfer
d3967e7b05 [core] don't copy stops by value when recalculating StyleParameters 2016-01-22 12:03:14 +01:00
John Firebaugh
1c21d0fd4c [core] Use better types for modified / expires / etag 2016-01-21 11:22:11 -08:00
John Firebaugh
c33ed50c98 [core] Eliminate Response::stale and inline Response::isExpired()
Response::isExpired() had subtle and potentially confusing behavior around Seconds::zero(). It's best to inline it and comment why.
2016-01-21 11:22:11 -08:00
John Firebaugh
1766d7dcbf [core] Eliminate RequestBase
HTTPRequestBase can now itself be the base class.
2016-01-21 11:22:11 -08:00
Ansis Brammanis
ed0488d2e0 [core] improve text-max-angle check
Instead of using the absolute value of the sum of angles, use the sum of
the absolute values of angles.

This helps avoid labels on lines with sharp zig zags.

for example, the "Central Campus Mall" label in issue #2998
2016-01-20 16:58:24 -08:00
Ansis Brammanis
0fda834397 [core] implement symbol-avoid-edges
ref #3582

if `symbol-avoid-edges` is true, this prevents symbols from colliding
with tile edges.
2016-01-20 16:10:38 -08:00
Bruno de Oliveira Abinader
9cd9065031 Revert "Revert WebP support due to broken builds"
This reverts commit 6709bdcacd.

There was an issue with the script that removes '-lwebp' from WebP
linker flags, since we're statically linking. This is now fixed.
2016-01-20 10:35:44 +02:00
Ansis Brammanis
d34f8eb674 [core][ios][osx][android] make SpriteImage accept PremultipliedImage
the SpriteImage constructor signature changes from

SpriteImage(
        uint16_t width, uint16_t height, float pixelRatio,
        std::string&& data, bool sdf = false);

to

SpriteImage(PremultipliedImage&&, float pixelRatio, bool sdf = false)
2016-01-19 18:23:21 -08:00
Ansis Brammanis
26faa6a5ad [core][ios][osx][android] fix icons with non-integer width/height
ref #3031
ref #2198

For example, an icon that has:
- a pixel width of 10
- a pixel ratio of 3
- a scaled with of 3.333
is now supported.
2016-01-19 18:20:54 -08:00
John Firebaugh
9b62661b07 [core] Use experimental optional instead of mapbox::util::optional 2016-01-19 17:56:48 -08:00
John Firebaugh
6709bdcacd Revert WebP support due to broken builds
This reverts commits 2010fbb0e6, a361ce47a1, and d004bb275a.
2016-01-19 13:34:56 -08:00
Bruno de Oliveira Abinader
2010fbb0e6 [linux] Replace PNG with WebP on tile source URL
This is a hack, in the same fashion as adding {ratio} to the tile URLs.
We should update the raster tile sources to use WebP by default.
2016-01-19 16:06:37 +02:00
Minh Nguyễn
8dfba0ef0b [ios] Flip points, not edge insets 2016-01-18 16:54:58 -08:00
Minh Nguyễn
eee4764ed7 [core] Reformulated setLatLng() based on CameraOptions
This version of setLatLng() can be expressed by constraining the viewport to a 0×0 viewport around the passed-in point.
2016-01-18 16:54:58 -08:00
Minh Nguyễn
47b69100f9 [core, ios, osx, android, glfw] Flipped origin of Map::latLngForPixel(), Map::pixelForLatLng()
Map and Transform methods assume an origin at the top-left corner of the view, like iOS, Android, and GLFW but unlike OS X. Transform is responsible for flipping coordinates between the top-left origin of Map and the bottom-left origin of TransformState.

Fixes #3574.
2016-01-18 16:54:58 -08:00
Minh Nguyễn
bf87eaa7b8 [core, osx] Added optional padding to convenience methods
Methods that offer a convenient way to jump or ease now accept an optional padding parameter. MGLMapView specifies the padding to ensure that keyboard-based zooming and rotation respects the toolbar.
2016-01-18 16:54:58 -08:00
Minh Nguyễn
143f8a7817 [core] Added padding option to CameraOptions
Moved EdgeInsets to geo.hpp so CameraOptions and Transform can refer to it. Added a padding option to CameraOptions that alters the frame of reference for the center option. Added optional padding parameters to LatLng getters and setters.

Working towards #2600.
2016-01-18 16:54:57 -08:00
John Firebaugh
9d13c639d1 [core] Add missing returns in error case
Fixes #3585
2016-01-15 16:59:21 -08:00
John Firebaugh
4328e6fd0d [core] tileSize is a source property, not a TileJSON property 2016-01-15 11:48:47 -08:00
Konstantin Käfer
a88e58ef3a [core] use stale glyphs
Updating glyphs is still unsupported, and there's no good use case for doing so. When we're using a stale glyph PBF, and the fresh answer contains changed to that glyph, we will continue to use the old glyph.
2016-01-15 17:04:08 +01:00
Konstantin Käfer
32a2359e86 [core] don't store error state
Previously, we could first get a stale response from cache, then immediately a "connection error" response that overwrote the error state variable. In the tileLoadingCompleteCallback, we'd only see the second overwritten error state and abort. This could lead to the map sometimes not being rendered at all until the user interacts with the map.
2016-01-15 17:04:08 +01:00
Konstantin Käfer
bd1f71cdbd [core] use stale sprite data
This is a naïve implementation that essentially merges updated data into existing data. It will *not* remove icons from the stale sprite if they aren't present in the fresh sprite (we aren't tracking the source of a sprite, and the user could have changed it as well). Similarly, it will not update icons that have changed in dimension. This is a rare edge case and probably not worth implementing.
2016-01-15 17:04:07 +01:00
Konstantin Käfer
40e908677e [core] abort current parse when we get a new NotFound response 2016-01-15 12:48:24 +01:00
Konstantin Käfer
01f31a82a8 [core] update the modified/expires debug info for unmodified responses as well 2016-01-15 12:48:24 +01:00