Commit Graph

1374 Commits

Author SHA1 Message Date
Minh Nguyễn
65f6eb25b5 [ios, osx] Optionally animate content insets change 2016-01-20 11:02:31 -08:00
Minh Nguyễn
07c4c54111 [ios] Made user dot position configurable
The user dot or user puck’s position is now configurable via a new alignment property in any user tracking mode. Also, -setUserTrackingMode:animated: is now exposed publicly, and setting its animated parameter to NO skips the initial animation.
2016-01-20 11:02:31 -08: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
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
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
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
Minh Nguyễn
8dfba0ef0b [ios] Flip points, not edge insets 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
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
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
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
John Firebaugh
2aafdbc1b8 [core] Add an explicit "not modified" indicator to Response 2016-01-14 13:46:03 -08:00
John Firebaugh
7fb5e973ed [core] Eliminate FileCache interface
There is only one implementation and we're unlikely to add more.
2016-01-14 13:46:03 -08:00
Minh Nguyễn
8bad15bf87 [core] Consolidated zoom and angle anchor logic
Made anchor a CameraOption for easeTo().
2016-01-14 00:40:03 -08:00
Minh Nguyễn
d26b956a48 [core] Cleaned up Transform
Eliminated many redundant methods on Transform. Minimized usage of TransformState::x and TransformState::y. Added convenient constructors for AnimationOptions. When scaling, passing in view’s origin as the anchor no longer anchors the scaling operation at the view’s center. To specify no anchor, use NaN.

Increased precision of worldSize(), now that it’s used much more heavily in transform methods.
2016-01-14 00:39:18 -08:00
Minh Nguyễn
27b308a234 [core] Separated AnimationOptions from CameraOptions 2016-01-14 00:39:12 -08:00
John Firebaugh
618902e06c [core] Remove request coalescing in OnlineFileSource 2016-01-13 13:43:05 -08:00
John Firebaugh
5a7d2fd60e [core] Eliminate platform::assetRoot()
I regenerated assets.zip so that all file paths have an `assets/` prefix, as the Android AssetFileSource implementation asserts, and removed `TEST_DATA` from the paths.
2016-01-13 13:40:31 -08:00
John Firebaugh
86c8446d3a [core] Simplify asset:// implementation
* Move asset:// URL handling to DefaultFileSource.
* AssetFileSource implements FileSource interface and follows familiar implementation patterns.
* Move default implementation to platform/default, zip implementation to platform/android.
* Don't bother with modified / expires / etag -- assets are not cached so it doesn't matter.
* Don't bother with interleaving individual IO calls on the implementation thread. That adds a lot of complexity for very little benefit.
2016-01-13 13:40:31 -08:00
John Firebaugh
6f9de6ae47 [core] Refactor to instance methods on OnlineFileRequestImpl 2016-01-13 13:38:12 -08:00
Minh Nguyễn
5eaf7a6211 [ios, osx] Fixed Xcode 7.3 build
Fixed a compiler error that’s new in Xcode 7.3. Also corrected a typo in MGLMapView on OS X.
2016-01-11 14:21:15 -08:00
Jason Wray
45a0f48ea0 [ios] Add telemetry setting directly to attribution button action sheet
- Deprecate and no-op `+[MGLAccountManager mapboxMetricsEnabledSettingShownInApp]`
- Check for attribution button hiding and make sure ToS are understood
2016-01-09 01:21:45 -05:00
John Firebaugh
e7b0b31d58 [core] Privatize SQLiteCache 2016-01-08 12:31:13 -08:00
Minh Nguyễn
b6fca67089 [ios] Added some missing coordinate conversion methods
These methods were public in the OS X SDK but not here.
2016-01-07 21:32:10 -08:00
Minh Nguyễn
11d99bd890 [ios] Refined custom callout view support
Renamed MGLCalloutView to MGLCompactCalloutView and MGLCalloutViewProtocol to MGLCalloutView to avoid an awkward workaround for a Swift name collision. Replaced individual title and subtitle properties with a single representedObject property that lets you use custom annotation properties in the custom callout view. Overrode a problematic SMCalloutView method. Added lots more documentation.
2016-01-06 23:43:07 -08:00
Romain Quidet
04ab28b621 [ios] expose custom callout api, wrap around SMCalloutView class 2016-01-06 23:42:41 -08:00
Minh Nguyễn
bc6054152c [ios] Removed appledoc workaround 2016-01-05 12:41:58 -08:00
Jason Wray
6905be6b2d [ios] more inline docs updates for jazzy
- Change all smart quotes to dumb quotes to workaround SourceKitten bug.
- Port changes from OS X (#3135)
2016-01-05 12:41:58 -08:00
Minh Nguyễn
1420a49689 [ios] Generate API documentation using jazzy
Replaced appledoc usage with jazzy, which understands modern Objective-C syntax by virtue of using Clang ASTs. Nevertheless, we have to make lots of changes to our documentation syntax, which was tailored to appledocs quirks. The new syntax jives much better with what Xcode expects in terms of auto-indentation and Quick Help.

Fixes #1420.
2016-01-05 12:41:54 -08:00
Thiago Marcos P. Santos
6d0b01c5fb [core] Make it possible to limit the size of the SQLite cache 2015-12-27 18:15:33 +02:00
John Firebaugh
7a6076ea9d [tests] Test with OnlineFileSource
When we introduce OfflineFileSource, the behavior of existing tests should
not change.
2015-12-23 14:55:12 -08:00
John Firebaugh
16de579d7c [core] Rationalize error handling for resource loading
* Standardize on std::exception_ptr as the error representation
  (fixes #2854).
* Don't format textual strings at the error source; pass on the
  constituent data via observer method parameters instead.
* Use the null object pattern to simplify observer notification code.
* Further refactoring for ResourceLoading tests.
2015-12-23 12:50:42 -08:00
John Firebaugh
7c22792bdf [tests] Rewrite resource loading test
Make it more readable and easier to debug.
2015-12-22 18:00:30 -08:00
Minh Nguyễn
d745ff0923 [ios] Meters per point at latitude
Renamed -metersPerPixelAtLatitude: to -metersPerPointAtLatitude:, leaving the old name as a deprecated alias. In Cocoa Touch terminology, “point” is the visual unit backed by pixels.
2015-12-22 17:06:43 -08:00
John Firebaugh
913f49c701 [core] Prepare for OfflineFileSource
* Rename existing DefaultFileSource to OnlineFileSource
* Restore a DefaultFileSource that's a passthrough to OnlineFileSource
2015-12-21 11:35:00 -08:00
Minh Nguyễn
49bfdd662f [ios, osx] Optional peak altitude for flying 2015-12-20 04:11:14 -08:00
Minh Nguyễn
a5230f3e11 [core] Clamp pitch in easeTo(), flyTo()
Also factored out the maximum pitch into a constant.
2015-12-19 23:14:01 -08:00
Minh Nguyễn
2cb70eac3c [ios, osx] Allow zero-duration flight
For consistency with -setCamera:…, a duration of 0 jumps instantaneously to the new location, while a negative value uses the distance-dependent default.

Due to the produced curve and applied easing, flyTo() doesn’t model a parabola or ballistic trajectory, but it does simulate powered flight to some extent.
2015-12-19 20:33:37 -08:00
Minh Nguyễn
0a9b6a82e4 [core] Reformulated flyTo options
The speed and curve fields in CameraOptions have been replaced with velocity and minZoom fields, which expressed in screen units. Scaling and easing make it difficult to derive options that are expressed in physical units.
2015-12-19 20:33:18 -08:00
Minh Nguyễn
af9de6c0ac [core] Refined and commented flyTo
Rewrote the flyTo implementation to more closely match GL JS’s implementation and the paper on which it is based.

Rewrote CameraOptions documentation. Only document units for generic types like double. The semantics of LatLng and Duration are already baked into the types; one just needs to look up the types’ definitions. Also, the […) is set notation, so the braces are supposed to be mismatched.

Fixes #3296.
2015-12-19 20:31:40 -08:00
Brad Leege
f7d1a40350 [android] Camera API 2015-12-18 11:33:40 -08:00
John Firebaugh
110f1ec796 [ios, android] Add methods to remove a custom layer 2015-12-17 15:15:55 -08:00
Minh Nguyễn
bf89ed080b [ios] Renamed custom style layer invalidation method
Cf. -[UIView setNeedsDisplay] and -[MKOverlayRenderer setNeedsDisplay].
2015-12-16 16:15:28 -08:00
John Firebaugh
2ee52915fe [ios, android] Add a method to invalidate custom layers, forcing a repaint 2015-12-16 16:15:28 -08:00
Minh Nguyễn
304b4ec664 [ios] Silence undocumented typedef warnings from appledoc
ref #3203
2015-12-16 15:48:55 -08:00