Commit Graph

1332 Commits

Author SHA1 Message Date
Minh Nguyễn
70ae0cc172 [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:48:34 -08:00
Minh Nguyễn
d1d96dfe91 [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:48:34 -08:00
Minh Nguyễn
a68589b6c7 [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:48:34 -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
Minh Nguyễn
350cafb903 Revert "Revert "[ios] Custom style layer""
This reverts commit 081e4e4451.
2015-12-16 15:48:55 -08:00
John Firebaugh
0db9f229f2 [android] Move includes to platform subdirectory 2015-12-16 14:52:29 -08:00
John Firebaugh
081e4e4451 Revert "[ios] Custom style layer"
ec9a4cd328
2015-12-16 14:05:54 -08:00
Minh Nguyễn
ec9a4cd328 [ios] Custom style layer
Exposed Map::addCustomLayer() publicly as an undocumented, block-based API. This change avoids the terms “layer”, “initialize”, “render”, and “altitude” because they overload existing terminology in the SDK, UIKit, or MapKit. (“Layer” is qualified as “style layer”.) There are outstanding questions about ARC memory management, but this approach works in both Objective-C and Swift for pure OpenGL programming.

Added a demo to iosapp that draws a green layer below any labels in Mapbox Streets.
2015-12-16 11:03:54 -08:00
Romain Quidet
b8be1f0632 code review updates: sprite_atlas brackets and nullable removed for reuseIdentifier of annotationImage 2015-12-15 16:36:17 -08:00
Romain Quidet
02a32b55e4 2210: MGLAnnotationImage image can be update 2015-12-15 16:36:17 -08:00
Minh Nguyễn
4e0e816653 [ios, osx] Added flyToCamera: variation that uses default duration 2015-12-15 12:52:13 -08:00
Minh Nguyễn
9aba820892 [ios, osx] Added flyTo to OS X; refactored camera setters 2015-12-15 12:52:13 -08:00
Minh Nguyễn
e1854f0f26 [core] Corrected flying trajectory; pitched flight
Corrected some fairly opaque code that was incorrectly ported from GL JS the first time around in #3171, causing the trajectory to extend far into the Earth’s orbit. Also transition pitch while flying, call transition frame/finish callback functions, and recognize the same “speed” and “curve” parameters that GL JS does.

Fixes #3296, fixes #3297.
2015-12-15 12:52:13 -08:00
Konstantin Käfer
4fc8226838 [core] allow changing the orientation
You can now change the orientation of north to be to the right, bottom, left in addition to the default of top
2015-12-15 11:41:58 -08:00
Mike Morris
f4d394d935 [node] code review cleanup 2015-12-15 10:19:56 -08:00
Minh Nguyễn
0fb2b855a4 [osx] Map camera
Shared MGLMapCamera between iOS and OS X. Unfortunately -camera and -setCamera: implementations need to be copy-pasted for now.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
fdff7901e2 [osx] Default callout view controller 2015-12-13 17:26:53 -08:00
Minh Nguyễn
ea57be5598 [osx] Documentation comments for public classes
Added documentation comments for all the public headers that aren’t being shared with iOS.

Removed an animated: parameter from -selectAnnotation: and -deselectAnnotation:: because callout popovers may extend beyond the entire window, there is no need to scroll the map to make the entire callout visible.

Added missing geometric conversion methods.

Renamed -mapView:regionWillChangeAnimated: et al. to say “camera” instead of “region”. “Region” leaves ambiguity about whether properties like rotation and pitch trigger this method. “Camera” associates these methods with the camera property, which seems apt.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
73324ae2f8 [osx] Commented private headers and implementation files 2015-12-13 17:26:53 -08:00
Minh Nguyễn
47fb5e820b [osx] Moved Mapbox.{h,m} into framework proper; set version variables 2015-12-13 17:26:53 -08:00
Minh Nguyễn
1598330a93 [osx] Added inline comments to MGLMapView 2015-12-13 17:26:53 -08:00
Minh Nguyễn
004d04075a [osx] Annotation cursors
Also added an option to osxapp for assigning a random cursor to all the annotations each time an annotation is added or removed.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
f542d7b2a7 [osx] Annotation tooltips
Annotations can optionally have tooltips. osxapp has an option, off by default, to assign a (localized) tooltip to each dropped pin.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
96145ef170 [osx] Drop Pin context menu item 2015-12-13 17:26:53 -08:00
Minh Nguyễn
0cab7809eb [osx] Rewrote platform-osx and osxapp
platform-osx now vends a real NSView subclass, MGLMapView, that is readily embedded inside a Cocoa application for OS X. MGLMapView is backed by an NSOpenGLLayer for optimal performance and integration with other layer-backed views. It supports keyboard shortcuts and several gestures and hosts attribution, zooming, and rotation controls as subviews. osxapp is now a bona fide Cocoa application that embeds MGLMapView inside a XIB. osxapp has preferences and a share button for tight integration with custom styles.

Enabling asynchronous rendering would be more consistent with iOS but increases CPU usage so much, even when idle, that it isn’t worth any performance gain. The bigger issue is that VAOs aren’t being used.

make xpackage creates a static library similar to the one created by make ipackage. make clean cleans additional places where build output ends up.

The OS X minimum deployment target has been increased from 10.9 to 10.10. osxapp’s window has a full size content view, which requires 10.10. Lightweight generics require iOS 9+ and OS X 10.11 regardless, because it was only in that release that Foundation collection classes started adopting lightweight generics.

Shuffled files around and refactored annotations so that iOS and OS X share a good chunk of the annotations code, which now takes advantage of polymorphism. MGLMapView can now display annotations but cannot yet select them. In osxapp, a long press drops a pin, and so does the map view’s context menu.

Annotations have NSPopovers as callouts, and their view controllers can be customized. Annotation image alignment rects are respected for hit testing purposes and for positioning the callout anchor. Callouts in osxapp demonstrate the use of bindings to keep callouts in sync with underlying model objects.
2015-12-13 17:17:35 -08:00
John Firebaugh
65b3220368 [core] Reduce custom layer API to lowest common denominator 2015-12-11 12:44:54 -08:00
Adam Hunter
095a8be300 Implementation of flyTo. 2015-12-09 17:14:22 -08:00
John Firebaugh
bde07c8f0e [core] Custom layers 2015-12-09 13:51:28 -08:00
John Firebaugh
e04c5f6506 [core] Replace StyleLayerType with RTTI 2015-12-07 18:22:33 -08:00
Minh Nguyễn
265e56d056 Fixed linker warnings about overridden styleURL__
Reapplied #3097, which was originally applied to the release-ios-v3.0.0 branch but was omitted in a merge back to master.
2015-12-06 14:44:57 -08:00
Konstantin Käfer
0c351eb523 [core] use default instead of empty function body 2015-12-03 15:38:36 +01:00
Konstantin Käfer
478472e501 [core] add std::move to constructors 2015-12-03 15:38:36 +01:00
Konstantin Käfer
d5fb535058 [core] add namespace comment to closing brace 2015-12-03 15:38:36 +01:00
John Firebaugh
8afa14fa78 [core] Map::setSprite ⇢ Map::addAnnotationIcon
Fixes #3084
2015-12-01 15:10:28 -08:00
John Firebaugh
622f6691b7 [glfw] No longer necessary to wait for style load to add default marker 2015-12-01 09:15:05 -08:00
John Firebaugh
58886842bc [core] Move MapData storage to MapContext
This allows MapData members to hold GL resources which must be released
on the MapContext thread -- necessary for the following commit.
2015-12-01 09:15:05 -08:00
Thiago Marcos P. Santos
07c0424ab9 [core] Removed libuv dependency from HTTPCurl*
Moved the fd watcher to the RunLoop. So far only needs to
be implemented by platforms using HTTPCurlRequest et al.
2015-12-01 11:49:02 +02:00
John Firebaugh
c5a4377714 [core] Privatize internal headers 2015-12-01 11:49:02 +02:00
John Firebaugh
1c63f98f6d [core] Expose fewer RunLoop implementation details in header 2015-12-01 11:49:02 +02:00
John Firebaugh
f2553fff89 [core] Merge uv_detail.hpp into uv.hpp 2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
9b36c19aeb [core] Introduce Timer abstraction 2015-12-01 00:00:09 +02:00
Thiago Marcos P. Santos
0d8ea6c0a2 [core] Removed dependency on uv_loop from the file source 2015-12-01 00:00:09 +02:00
Thiago Marcos P. Santos
d422c8cac4 [core] Abstract main loop inside RunLoop class 2015-12-01 00:00:09 +02:00
Thiago Marcos P. Santos
1d62332204 [core] Use AsyncTask on the MapContext 2015-12-01 00:00:09 +02:00
John Firebaugh
12fc949006 [tests] Don't use icons from the style for annotations 2015-11-30 12:40:09 -08:00
Justin R. Miller
8d25d9ab1a Merge branch 'release-ios-v3.0.0' 2015-11-30 11:10:27 -08:00