Commit Graph

136 Commits

Author SHA1 Message Date
Minh Nguyễn
9de8279438 [ios, macos] 3.4.0/0.3.0 sections in changelogs 2016-11-11 22:12:47 -08:00
Minh Nguyễn
f2ba2b2dee [ios, macos] Fixed crash getting annotation view
Streamlined -[MGLMapView annotationTagForAnnotation:] to use the mapping added in #5987. Reverted an unsafe access into that mapping that was added in #5987; returning nil is preferable when no such annotation can be found. Return the user location annotation view when given the user location annotation.
2016-11-08 22:51:05 -08:00
Minh Nguyễn
b91bbbef10 [macos] Map annotations to annotation tags
Optimized lookup of annotation tags by annotation from O(n) to a simple map lookup, for better performance and consistency with the iOS implementation of MGLMapView.
2016-11-08 22:51:05 -08:00
Jesse Bounds
751aff2ddd [ios, macos] Work around annotation race condition (#6924)
When annotations are removed concurrently with being updated because
of a map redraw, it is possible that mbgl will still consider an
annotation to exist depending on what part of the map lifecycle the
call update annotations happens. However, the annotation context by
tag map in MGLMapView (on the main thread) will always be up to date.
This adds a guard that uses that map to avoid considering annotations
that have actually been removed as visible.

Another issue was that adding the same annotation object twice has
always been allowed and has worked, visually. However, a recent
refactor to make the reuse queue work correctly is not tolerant of the
a single view representing two annotation instances that are the same.
The effect is that a new UIView will be generated for each (clone)
annotation that is added and only the last view will move with the map.
The other views become detached and float around in the view as the
map is panned. This commit adds a guard to make adding an annotation
instance a no-op if it has already been added before.
2016-11-04 13:50:53 -07:00
Minh Nguyễn
7c68d7773d [macos] Enabled runtime styling tests
Added the style layer tests to the test bundle target.

Set the access token to a bogus access token before running any tests. The macOS implementation of MGLMapView doesn’t even attempt to set a default style if the access token is missing, because in macosapp, the access token may be set asynchronously by the user when the preferences window appears.
2016-11-02 21:12:45 -07:00
Minh Nguyễn
0ee119ad76 [macos] Fixed color roundtripping
Fixed an issue that caused the runtime styling API to return colors in the sRGB color space instead of the calibrated RGB color space.
2016-11-02 21:12:45 -07:00
Minh Nguyễn
c38e743d45 [macos] Added MGLValueEvaluator to project
This header was missing from the project. The code was only compiling because the header was still on the search path.
2016-11-02 21:12:45 -07:00
Minh Nguyễn
f98a544886 [ios, macos] Share more tests
Moved MGLGeoJSONSourceTests and MGLTileSetTests into platform/darwin/test/ and added them to the macOS project. Also added a private header needed to compile the tests to the macOS project.
2016-11-02 21:12:45 -07:00
Minh Nguyễn
c2e37f062b [ios, macos] Adopted string enumerations
Notification names and user info keys posted by MGLOfflineStorage, as well as MGLErrorDomain, are instances of string enumerations for ease of use in Swift. Added some shims for projects built with Xcode 7.x.

Fixes #6791.
2016-11-02 12:40:40 -07:00
Minh Nguyễn
6338a3e7f9 [ios, macos] Updated changelogs 2016-11-01 19:13:47 -07:00
Jesse Bounds
41f2c8204a [ios, macos] Update changelogs for visible annotations API 2016-11-01 12:10:06 -07:00
Jesse Bounds
2901bc0f68 Optimize annotation view updates (#5987)
Use queryPointAnnotations to drive annotation view updates

- Get sets of visible and offscreen annotations using the mbgl query 
mechanism and updates and enqueues as required
- Query viewport adjusted if tilted (avoid apparent issue with
queryPointAnnotations when the query box is larger than the actual
viewport)
- Add a small debugging display in iOS app to see annotations going in
and out of the reuse queue

This also works around a performance issue that made getting an annotation
context expensive by implementing a map of annotations to tags. It works 
around another issue with the underlying mbgl query so that even if it (rarely) 
returns an incorrect result, the correct visual effect still occurs and the reuse 
queue is added to and drained as expected.

Finally, this refactors MGLMapView viewForAnnotation: to use the maps to
access the requested annotation context and view. This avoids a more
expensive lookup done previously.

Along for the ride: sync up the ios and macos names (and types) for
MGLAnnotationTagContextMap
2016-11-01 11:48:09 -07:00
Justin R. Miller
8ffd1f6925 [ios, macos] document custom API URL & add Info.plist guide (#6833)
Also support base URL nullability in order to use default value.
2016-11-01 10:29:33 -07:00
Jesse Bounds
d5af9b680b [ios, macos] Introduce visible annotations API (#6061)
Add visibleAnnotations API to make it easier for clients of MGLMapView
to query for all visible annotations in the map or all visible annotations
in a subsection of the map.
2016-10-26 17:13:38 -07:00
Minh Nguyễn
12093c10ad [ios, macos] Added Swift MGLStyleValue tests
Added tests of MGLStyleValue written in Swift, along with bridging headers just in case they become needed in the future.
2016-10-26 15:16:15 -07:00
Jesse Bounds
dbfa8dcc89 Merge branch 'master' into boundsj-release-ios-3.4.0-merge-master 2016-10-25 15:48:29 -07:00
Konstantin Käfer
a4d259c33f [core] move gl::Context to Backend and refactor View 2016-10-25 13:52:36 -07:00
Konstantin Käfer
5cc390d694 [core] separate Backend from View for headless rendering 2016-10-25 13:52:36 -07:00
Jesse Bounds
1216050f9c Add MGLPointCollection for GeoJSON multipoints (#6742)
* [ios, macos] Introduce MGLPointCollection

This makes MGLMultiPoint abstract again so that it is only a place 
for shared functionality of polygons and polylines. The multipoint 
feature replaces the point collection feature and can be
used to initialize a MGLGeoJSONSource. The previously added 
swift_names for polyline and polygon are removed, for now.

This also updates the iOS and macOS annotation adding logic so that
unwanted shapes really are avoided. Previously the combined OR
conditions  meant that an annotation had to logically be NOT a kind
of all three types so the check always let the annotation slip through.
This also expands the guard to deflect the new MGLPointCollection.
2016-10-20 17:14:19 -07:00
Mike Morris
817c26111a [core] [node] pass thread pool impl to Map constructor
Updates mbgl::Map constructor usage everywhere

Adds NodeThreadPool implementation using AsyncQueue to call
Nan::AsyncQueueWorker from main thread
2016-10-20 14:37:36 -04:00
Jesse Bounds
baf82fc4d4 [ios, macos] Make feature attributes and identifier writable (#6728)
* [ios, macos] Make feature attributes and identifier writable

Instances of MGLFeature subclasses can now have their attributes
and identifier properties mutated.
2016-10-19 09:08:56 -07:00
Minh Nguyễn
74c2bf8791 [macos] Added MGLTileSet to project (#6713)
Also reformatted some MGLTileSet documentation.
2016-10-17 15:19:36 -07:00
Jason Wray
a1d803f518 [ios, macos] Change runtime styling category method prefix to mgl_
This makes runtime styling category method naming consistent with the rest of the SDK.
2016-10-17 11:47:22 -07:00
Minh Nguyễn
9652028915 [ios, macos] Expand changes to entire API 2016-10-17 11:47:22 -07:00
Minh Nguyễn
ae96e78ccd [ios, macos] Update changelogs (#6714)
* [macos] Subdivided release by topic in changelog

* [ios, macos] Updated changelogs
2016-10-17 10:14:21 -07:00
Justin R. Miller
674304bfae [ios, macos] fixes #6346: add support for configurable API base URL (#6709) 2016-10-15 20:12:36 -07:00
Jason Wray
4a0173bbd7 [ios, macos] Deprecate -[MGLMapViewDelegate mapView:alphaForShapeAnnotation:] (#6706) 2016-10-14 19:50:21 -04:00
Jesse Bounds
0a8858f2da [ios, macos] Teach features and shapes about GeoJSON and mbgl types
MGLShape subclasses can now return NSDictionaries that represent the shapes' GeoJSON geometries. MGLFeature classes can now return NSDictionaries that represent the features as GeoJSON features. This makes it trivial to serialize iOS and macOS shapes and features into GeoJSON.

MGLFeature instances can also return a representation of themselves as an mbgl::Feature. This capability is used in a refactoring of the implementations of MGLGeoJSONSource to more efficiently transform MGLFeatures into mbgl::Features so they can be fed directly into mbgl::GeoJSONSource without having to round trip through NSJSONSerialization. The MGLFeature identifier is converted into the mbgl::identifier type based on the type of the identifier. The MGLFeature attributes are recursively converted into an mbgl::PropertyMap and each value is converted into one of the types that the PropertyMap's Value variant supports.
2016-10-14 14:59:28 -07:00
Minh Nguyễn
f064744c36 [macos] Fixed compilation error (#6690)
Followup to last-minute refactoring in #6637.
2016-10-12 21:06:50 -07:00
Roman Blum
a24e559ac8 [ios, macos] possibility to set custom images to style (#6637)
* [ios, macos] possibility to set custom images to style

* [ios, macos] setImage:forName now supports MGLImage (UIImage/NSImage)

* [ios, macos] update documentation for setImage:forName: and removeImageForName:

* [ios, macos] rename method and fix prefix

* [ios, macos] change header visibility to project

* [ios, macos] update header imports

* [ios, macos] delete unnecessary whitespaces

* [ios, macos] remove unnecessary nil checks

* [ios, macos] delete unnecessary whitespaces

* [ios, macos] update documentation

* [ios, macos] make mgl_spriteImage a parameter-less instance method

* [ios, macos] add asserts
2016-10-12 12:30:20 -07:00
Bruno de Oliveira Abinader
2726f9b8ae [macos] Merge mbgl-{test,benchmark} into CI scheme 2016-10-12 07:35:13 +03:00
Jason Wray
5d85dbd7cd [ios, macos] Add -mapView:didFinishLoadingStyle: delegate method 2016-10-11 13:07:10 -04:00
Bruno de Oliveira Abinader
7dbc302b2f [test] Deploy core test fixtures on Bitrise 2016-10-11 12:10:32 +03:00
Minh Nguyễn
0acf1ed596 [ios, macos] Renamed files to match renamed classes 2016-10-06 15:19:38 -07:00
Minh Nguyễn
50d2c01d7d [ios, macos] Revamped MGLStyleLayer, MGLSource inheritance
Removed the MGLStyleLayer protocol, because almost none of its members was actually implemented in every class that adopted the protocol. Removed the unused mapView backpointer property with no replacement. Renamed MGLBaseStyleLayer to MGLStyleLayer. Created the intermediate abstract classes MGLForegroundStyleLayer and MGLVectorStyleLayer to cover subsets of style layer classes with like functionality.

Moved each MGLBaseStyleLayer initializer and the corresponding properties down to an abstract subclass such that the initializer makes sense for all concrete subclasses. Moved more initializers and the predicate property up to MGLVectorStyleLayer to eliminate duplication among the concrete subclasses. Marked these initializers as designated initializers.

Removed “source” or “layer” before identifier wherever the type of identifier is apparent. Removed extra MGLGeoJSONSource initializer variants in favor of nullable parameters.

Added copious documentation comments for source and style layer classes, including several previously undocumented methods and properties. In particular, some preconditions and postconditions have been documented. Added pragma marks to break up the jazzy documentation pages into sections. Reformatted exceptions for consistency.
2016-10-06 15:19:38 -07:00
John Firebaugh
388fa9cf10 [macos] Restore core unit tests in CI 2016-10-06 10:16:45 -07:00
Konstantin Käfer
08809b4d44 [macos,ios] initialize util::RunLoop in SDK rather than by default 2016-10-06 10:16:45 -07:00
Bruno de Oliveira Abinader
214ec4e96a [build] Add support for 'benchmark' target on macOS 2016-10-05 15:34:30 +03:00
Justin R. Miller
105673efc1 [ios, macos] fixes #6160: allow updating multipoint coordinates (#6565) 2016-10-04 18:42:12 -07:00
Minh Nguyễn
d4151c9f36 [ios, macos] Updated changelogs 2016-10-03 19:06:30 -04:00
Jason Wray
5b28ebbeca [ios][macos] Update changelog for dSYM, symbol stripping fix 2016-09-30 18:49:05 -04:00
Jason Wray
d3b308a695 [macos] Add 'Packaging builds' section to developing doc 2016-09-30 18:49:05 -04:00
Jason Wray
d7a44a6b90 [macos][build] Validate dSYM and framework UUIDs 2016-09-30 18:49:05 -04:00
Jason Wray
161955209d [macos][build] Generate debug symbols for all builds 2016-09-30 18:49:05 -04:00
Jason Wray
43f70465f5 [macos] Don't specify Swift version for jazzy doc generation (#6539)
Counterpart to https://github.com/mapbox/mapbox-gl-native/pull/6377/.
2016-09-30 14:47:52 -07:00
Ivo van Dongen
1c11aeb48a [android][ios][macos][linux][qt] included default LocalFileSource 2016-09-30 14:57:26 +02:00
Konstantin Käfer
2ec2860ce5 [core] move OpenGL extension loading to their own headers 2016-09-29 13:19:27 -07:00
Minh Nguyễn
b1518944a7 [ios, macos] Rewrote CI scripts
Broke up the iOS and macOS Bitrise scripts into several steps each for more granular progress and failure reporting and to take advantage of better error reporting in the built-in Bitrise steps. Added a step to deploy Xcode test results and (in the event of a failure) raw xcodebuild output to Bitrise.io, with a handy link from the Bitrise UI.
2016-09-28 09:44:19 -07:00
Minh Nguyễn
255325b44b [macos] Restored unit tests on CI
Restored the make rule for running macOS SDK unit tests. Invoke that rule on Bitrise.

Fixes #5991.
2016-09-28 09:44:19 -07:00
Justin R. Miller
a6aa786f35 [ios, macos] flesh out iOS runtime styling docs (#6466)
- fixes #5959: MGLBaseStyleLayer docs
- fixes #5960: MGLSource & subclasses docs
- fixes #6467: concrete layer subclass docs
- move Core Graphics include
- slight code & template cleanups
- add ./documentation to git ignores
2016-09-27 13:53:32 -07:00