Commit Graph

6452 Commits

Author SHA1 Message Date
Minh Nguyễn
59f2c53c26 [ios] Keep callout attached to moving user dot 2016-01-20 11:02:31 -08:00
Minh Nguyễn
867e01581c [ios] Maintain user tracking mode after orientation change 2016-01-20 11:02:31 -08:00
Minh Nguyễn
251925568c [ios] Eliminated jump after flight to first location
Don’t update the user location annotation’s coordinates until after the transition to the first reported location is complete.
2016-01-20 11:02:31 -08:00
Minh Nguyễn
51be461168 [ios] Leave user location callout open when tracking
Don’t close the user location annotation’s callout when the user location changes in user tracking mode.
2016-01-20 11:02:31 -08:00
Minh Nguyễn
41ce7b2526 [ios] Fly to user location
Fly to the user location when entering user tracking mode. Keep user location updates from interfering with the initial flight.
2016-01-20 11:02:31 -08:00
Minh Nguyễn
453000af3b [ios] Affix user dot on screen in user tracking mode
In user tracking mode, keep the user dot in a fixed location on screen, instead easing the map view so that the fixed location corresponds to the new user location. There is one exception: MGLMapView reacts to the first location update the same way as before, so that it appears to move to where the user dot has been all along.

In course tracking mode, weight the user dot down towards the bottom of the view, since it’s more important to see the road ahead than the road behind.

Fixes #2600, and #1041 to some extent.
2016-01-20 11:02:31 -08:00
Thiago Marcos P. Santos
a11f7d6ef3 [tests] Added utests for RunLoop refcounting 2016-01-20 19:54:20 +02:00
Thiago Marcos P. Santos
adcd0eaaac [osx] Fix loop closing with pending requests
The main loop will now wait for all the requests to
complete before closing.

This will make the FileSource on OSX block longer than
it should at shutdown.
2016-01-20 19:54:20 +02:00
Thiago Marcos P. Santos
55c31493af [core] Add ref counting to the main loop
Should not be used at all, added for a corner case
on OSX network backend where the request is processed on
a worker thread managed by OSX and we need to wait for
that reply before destroying the thread that pushed the
request.
2016-01-20 19:54:20 +02:00
Cameron Mulhern
07f6dee616 [ios] Fixes crash when vendorId is nil 2016-01-20 10:59:31 -05: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
Mike Morris
48cced9e31 node-v2.2.2 2016-01-19 17:42:43 -05:00
John Firebaugh
dbfa932ed1 [core] Eliminate macros in sqlite3.cpp 2016-01-19 13:39:18 -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
Bruno de Oliveira Abinader
a361ce47a1 [linux] Added WebP tile support
- Android support is currently disabled due to a libwebp build issue.
- iOS and OS X support will appear after the next Mapbox iOS SDK release.

Related: #https://github.com/mapbox/mapbox-gl-native/issues/2354
2016-01-19 16:06:36 +02:00
Bruno de Oliveira Abinader
d004bb275a [linux] Added WebP build deps 2016-01-19 15:41:47 +02:00
Bruno de Oliveira Abinader
0aa89f6eb1 [osx] No need to link with libpng & libjpeg
OSX platform includes platform/darwin/image.mm which uses CoreFoundation
to decode PNG and JPEG images.
2016-01-19 15:40:23 +02:00
Thiago Marcos P. Santos
7ad9e47bbe [glfw] Fix panning direction
Follow-up of the transform refactoring
2016-01-19 11:36:26 +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
1a5bc3d803 [ios] Removed redundant zoom constraints
The zoom level is already clamped by Transform. -currentMinimumZoom appears to be useful only as an unrotation threshold; it doesn’t correspond to the minimum allowed zoom level.
2016-01-18 16:54:58 -08:00
Minh Nguyễn
6a0b7f8eb3 [ios] Account for top/bottom bars 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
c86646519a [osx] Content insets
Added a contentInsets property to MGLMapView that behaves similarly to NSScrollView.contentInsets. Adjust it according to the window’s content layout rectangle using KVO. Automatically apply the content insets whenever creating a CameraOptions or getting the center coordinates.
2016-01-18 16:54:57 -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
Minh Nguyễn
cb126eafe0 [ios] Refactored unrotation
Avoid unrotating due to programmatic rotation, even programmatic rotation that might expose empty portions of the map. Only snap to north due to a gesture.
2016-01-16 22:00:47 -08:00
Minh Nguyễn
ed32fa06ed [ios] Avoid unrotating in heading or course tracking mode
Fixes #3587.
2016-01-16 15:56:25 -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
Konstantin Käfer
3f5d02ee65 [core] use stale raster tiles 2016-01-15 12:48:23 +01:00
Konstantin Käfer
180b3f125f [core] don't mark tiles with failed requests as obsolete
Otherwise, this will remove them from the map and overwrite the old data. This could happen e.g. when we have connection trouble and a tile needs to be refreshed, or we're displaying stale information and the connection is down.
2016-01-15 12:48:23 +01:00
Konstantin Käfer
5fe586633c [test] ensure static rendering finishes when a tile can't be loaded 2016-01-15 12:48:23 +01:00
Konstantin Käfer
8a964fb931 [core] use stale and refreshing TileJSON/GeoJSON data
We're now supporting using stale TileJSON and GeoJSON data. When we receive a new answer with an updated TileJSON file, we're replacing the Source's metadata with the new one and trigger updates to make sure we're loading the correct tiles. Similarly, GeoJSON data will be reparsed.
2016-01-15 12:48:23 +01:00
Konstantin Käfer
21e4029acf [core] use stale styles
This adds support for using cached styles that are stale. They're treated like changing styles; when the refreshed style changed compared to the one we've already had, we're swapping out the entire style, which might cause a slight flicker.
2016-01-15 11:59:26 +01:00
Konstantin Käfer
957415823a [core] Support multiple paths in SQLiteCache::getShared()
If you use many different caches, expired weak_ptrs will pile up in the unordered_map, but that is an edge case, and you probably shouldn't do that anyway.
2016-01-15 10:44:16 +01:00
Konstantin Käfer
8939a7b706 [core] move SharedSQLiteCache::get to SQLiteCache::getShared 2016-01-15 10:38:09 +01:00
John Firebaugh
f62d41ae05 [core] Restore existing response body
Until #2721 lands we still need this.
2016-01-14 18:38:56 -08:00
Ansis Brammanis
e44db93f1c [core] place symbol layers in correct order
Previously, the placement of symbols depended on the order in which the
glyphs they need were loaded. The placement order should be based on the
style.

To fix this, symbol layers are placed in `placementPending` after they
are parsed. After all layers are parsed, symbol layers (stored in
`placementPending`) are placed and returned.
2016-01-14 17:51:29 -08:00
Minh Nguyễn
15f4ca51f9 [ios] Fixed static analyzer warnings 2016-01-14 16:48:16 -08:00
Minh Nguyễn
714dfab8ae [osx] Fixed static analyzer warnings 2016-01-14 16:48:16 -08:00