Commit Graph

1312 Commits

Author SHA1 Message Date
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
Minh Nguyễn
4240dfb0a8 Updated links to access token manager
The old URL redirects to a Mapbox Studio page not specifically about access tokens.
2015-11-29 01:39:29 -08:00
Bruno de Oliveira Abinader
92856f394c [core] Collision debug is now MapDebugOptions::Collision 2015-11-27 17:47:02 +02:00
Bruno de Oliveira Abinader
1f0820c8e8 [core] Added MapDebugOptions
Map debug options are now cycled up to all debug options enabled, then
back to none.
2015-11-27 17:47:02 +02:00
Bruno de Oliveira Abinader
044e92f5e8 [core] Display modify, expires debug information 2015-11-27 17:47:02 +02:00
Bruno de Oliveira Abinader
31fd2822f5 [core] Replace time_t with std::chrono::seconds
Added aliases for std::chrono typedefs (eg. 'Seconds' for
std::chrono::seconds). These aliases are used together with templated
helper functions to replace time_t with std::chrono::seconds for most
cases, in particular for 'modified' and 'expires' values in Response.
2015-11-27 17:47:02 +02:00
John Firebaugh
1d33790dc0 [core] Fix image type of Map::renderStill
It's a premultiplied image. This implies that we were misusing encodePNG
in most cases, as we were passing premultiplied pixels which were then
interpreted as unmultiplied. I changed encodePNG to accept premultipled
pixels, and unpremultiply in the implementations.
2015-11-25 15:57:37 -08:00
John Firebaugh
0c1e378bc9 [core] Rewrite image handling
* Consolidate Image and StillImage
* Typecheck unassociated vs premultiplied images
* Rewrite default platform image decoding implementation
2015-11-25 15:57:36 -08:00
Minh Nguyễn
2de0a351a0 [core] [iOS] Completion handlers for animated methods
Added transition frame and finish functions to CameraOptions. Added Objective-C equivalents to the three main entry points to easeTo() in MGLMapView.

Fixes #1581.
2015-11-25 15:20:25 -08:00
John Firebaugh
6ff3ef55f8 [core] Remove unused 2015-11-23 17:28:44 -08:00
John Firebaugh
36081f6486 [core] For binary image data use uint8_t, not char 2015-11-23 17:28:44 -08:00
Minh Nguyễn
c054441071 Fixed linker warnings about overridden styleURL__
Replaced #3088 with a better fix that relies on Interface Builder’s lack of support for conditional compilation.
2015-11-20 21:51:24 -08:00
Minh Nguyễn
06d400fb9a Discourage code usage of styleURL__ property
A hack atop the hack added in #2632. Pre-declare `styleURL__` with an attribute that prevents it from appearing in code completion suggestions, while leaving it available to Interface Builder, which is unable to parse attributes.
2015-11-20 12:03:16 -08:00
Minh Nguyễn
8a0bce7808 Discourage code usage of styleURL__ property
A hack atop the hack added in #2632. Pre-declare `styleURL__` with an attribute that prevents it from appearing in code completion suggestions, while leaving it available to Interface Builder, which is unable to parse attributes.
2015-11-20 11:31:46 -08:00
Minh Nguyễn
b791d1fb81 [iOS] Added missing documentation comment 2015-11-20 11:24:43 -08:00
Minh Nguyễn
94e2d8a02c [iOS] Added missing documentation comment 2015-11-20 01:02:21 -08:00
Jason Wray
3aa523c7b1 [ios] document willStart/didFinish map loading delegate methods
Fixes #2706
2015-11-18 15:59:48 -08:00
Jason Wray
9cbccb662e [ios] document willStart/didFinish map loading delegate methods
Fixes #2706
2015-11-18 10:23:54 -08:00
Bruno de Oliveira Abinader
adfac6f061 [core] Added ConstrainMode::{HeightOnly,WidthAndHeight}
ConstrainMode gives flexibility to our engine to choose between
constraining both vertically and horizontally, or just vertically
(default behavior).

Constrain in both axis means we can no longer pan the map beyond the map
boundaries. This fixes an issue where e.g. annotations disappear upon
crossing the map boundaries.
2015-11-18 09:37:27 +02:00
Bruno de Oliveira Abinader
cb9b397985 [core] Fix LatLngBounds default coordinates
LatLngBounds southwest and northeast coordinate points were inverted, so
they could be extended via LatLngBounds::extend(). However, this looks
confusing and error-prone.

A static LatLngBounds::getExtendable() is added to address cases when we
want to extend LatLngBounds.
2015-11-18 09:37:27 +02:00
Justin R. Miller
c4694df375 more clearly indicate Foundation imports to avoid recursion 2015-11-17 17:11:08 -08:00