Commit Graph

6165 Commits

Author SHA1 Message Date
Konstantin Käfer
2700ea87a4 [core] fix font rendering at the top edge of the viewport 2015-12-15 11:41:58 -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
Minh Nguyễn
62412af6ab [osx] Only build osxapp on Travis
Building osxapp means building the SDK, so building the SDK independently is wasteful.

Fixes #3313.
2015-12-15 10:47:33 -08:00
Mike Morris
f4d394d935 [node] code review cleanup 2015-12-15 10:19:56 -08:00
Bruno de Oliveira Abinader
4ae4325c81 [osx] 'make run-linux' should work on OSX 2015-12-15 09:45:53 -08:00
Tom MacWright
531f337ee2 [android] Add more documentation to Android bindings. Refs #2650 2015-12-15 11:10:49 -06:00
Tom MacWright
999447587c Expand DEVELOP_ANDROID_OSX with more gotchas.
Fixes #3266
2015-12-15 11:10:18 -05:00
Brad Leege
e81f3f3735 [android] #3192 - Updating Changelog 2015-12-14 20:46:12 -06:00
Tom MacWright
8a208133db [android] Add some JavaDocs, fix HTML formatting 2015-12-14 20:39:04 -06:00
John Firebaugh
4a803f1a78 [core] Don't use glClear optimization for layers that aren't the bottommost
Fixes #3292
2015-12-14 17:01:16 -08:00
Konstantin Käfer
95cef66e22 [core] change RapidJSON usage to use CrtAllocator and bump GeoJSON VT 2015-12-14 16:43:35 -08:00
John Firebaugh
9b8f5d3be1 [core] Fix another place GL state was required but not set 2015-12-14 15:50:42 -08:00
Minh Nguyễn
d2d722a575 [osx] Corrected build documentation
build/pkg/osx/ probably won’t be used until #3183 lands.
2015-12-13 21:54:54 -08:00
Minh Nguyễn
a01dd8ade1 [osx] Corrected documentation
Corrected the path to the build output. Also added a missing inline comment.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
835bb6ab08 [osx] Sort candidate annotations by proximity to tap
Like 78a39c17fb6677442231945ddf8b73797080e2e1 for #3261 on iOS.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
727dd61553 [osx] Printing
Copied some pixel-reading code from HeadlessView.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
e7d7add420 [ios] Strip OS X–specific APIs from iOS documentation
appledoc can’t understand conditional compilation. This is the best we can do until we move to Jazzy.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
0722d26846 [osx] Remove All Pins command
Also fixed an issue where removing a selected annotation failed to deselect it.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
b869d3c820 [osx] Persist viewpoint across relaunch 2015-12-13 17:26:53 -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
3f2fae521c [osx] Don’t strip on copy in Debug
Stripping the framework means you can’t debug the framework.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
cd6830b3ea [osx] Fixed IB latitude/longitude inspectables 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
bab3935431 [osx] Fixed standalone launch of osxapp (and run-xosx)
Mapbox.framework needs to be embedded in the application bundle.
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
62e6c04c73 [osx] Align build settings with Xcode framework project template
In particular, -Os yields significant size improvements in Release.
2015-12-13 17:26:53 -08:00
Minh Nguyễn
7f04c5d149 [osx] Renamed annotation IDs to annotation tags
By analogy with Cocoa tracking area tags, tooltip tags, view tags, etc.
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
df0511af18 [osx] Build framework based on static library 2015-12-13 17:26:53 -08:00
Minh Nguyễn
6890af9cd9 [osx] Fixed KVO compliance for selectedAnnotation 2015-12-13 17:26:53 -08:00
Minh Nguyễn
9d2e0a19ef [osx] Blanket the map with pins 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
cc35f5a2a7 [osx, ios] Improved annotation interaction
Corrected annotation image alignment rects used in positioning the popover and hit testing for selection. The alignment rects were flipped in a couple places and we were getting lucky until now.

Query for any point annotation within a slop area that extends by the maximum image dimensions in each direction, then filter by annotations whose images actually hit-test. (So to select an annotation that has a doughnut image, you have to click on the actual doughnut, not its hole.) It’s a fuzzy hit test with a four-pixel-radius slop area, so there shouldn’t be any clicking precision issues.

Clicking on an annotation while a callout is open merely closes the callout popover, so it isn’t possible to go immediately from one callout to another. Since we still want to cycle through coincident annotations, keep track of the last selected annotation ID.

Clicking on a visible point annotation whose center is out of the visible bounds now selects the annotation.

Ported the callout-positioning portion of these changes to iOS. Also refactored some geometry conversion methods and removed a redundant constant.
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
Minh Nguyễn
b59f087ea8 [ios] Sort candidate annotations by proximity to tap
If you tap near a tight cluster of annotations, the annotation directly beneath your finger should be selected first. Previously, the annotations within the query bounds would be selected in order from oldest to newest, which was counterintuitive. The new behavior does sometimes make it more difficult to cycle through the entire cluster, but the previous behavior often got in the way anyways, as your finger would wind up atop a callout view for an annotation farther south.

Also updated the changelog.
2015-12-13 16:37:30 -08:00
Minh Nguyễn
d3275aa43c [ios] Refined annotation selection
Decreased hit test padding for annotation selection, since the query no longer depends on it. Fixed an assertion failure when selecting an annotation while the user dot is selected. Fixed an issue where selecting a selected user dot deselected it. Fixed an issue where the user dot’s callout positioning rect was off-center and a little too high.
2015-12-13 16:37:29 -08:00
Minh Nguyễn
a36054ee6b [ios] Refactored MGLMapView annotations
MGLMapView now maps “annotation tags” (Cocoa-speak for numeric annotation IDs) to context objects that pair annotations with their identifiers. Previously, MGLMapView mapped the annotation objects themselves to context objects that contained annotation IDs, but this caused most operations involving annotations to be rather expensive: since mbgl tracks annotations by ID, most of the time you know the ID and need either the annotation or some piece of metadata about it.

Along for the ride, geographic methods and support for alignment rect insets on annotation images have been ported from #3135 for OS X. Hit testing now works much like in #3135, with the exception that UIKit doesn’t support hit testing based on pixel opacity. -convertRect:toLatLngBoundsFromView: returns a world-spanning bounds when the world is wrapping.

Fixes #3159.
2015-12-13 16:37:29 -08:00
Minh Nguyễn
d11d53da5e [ios] Silly rabbit, Cocoa bindings are for Mac developers!
Reapplied 56ea347c49 for #3199, which got lost in a merge.
2015-12-12 15:31:37 -08:00
Tobrun
695180e091 [android] #3262 stop listening to bearing when state switches 2015-12-12 09:17:35 -08:00
Tobrun
8d253f97b6 [android] #3191 - remove double direction state 2015-12-12 09:14:42 -08:00
Tobrun
cc6169154f [android] #3270 - add sample activity for animated coordinate change 2015-12-12 09:12:21 -08:00
Tobrun
7117ec5032 [android] #3267 limit user input as an example to VisibleCoordinateBounds 2015-12-12 09:08:58 -08:00
Thiago Marcos P. Santos
9af7594d61 [core] Use global namespace on some <cmath> functions
Improves compatibility as some old std libs don't have them
on the std:: namespace.
2015-12-11 17:12:31 -08:00
Konstantin Käfer
8d711e9c80 [test] update test suite to include more comprehensive GeoJSON tests 2015-12-11 16:23:43 -08:00
Konstantin Käfer
c4a01d51ea [core] don't fail on invalid inline GeoJSON data 2015-12-11 16:23:43 -08:00
Konstantin Käfer
b0bec13601 [build] make sure we're building the config file for node Xcode projects 2015-12-11 16:23:42 -08:00