Commit Graph

1166 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
fabian-guerra
373904e822 [ios, macos] Layer ownership refactor (#6904)
`MGLStyleLayer` was updated to support a raw pointer to the mbgl object, which is always initialized, either to the  value returned by `mbgl::Map getLayer`, or for independently created objects,  to the pointer value held in `pendingLayer`. In the latter case, this raw  pointer value stays even after ownership of the object is transferred via  `mbgl::Map addLayer`.
2016-11-04 15:20:01 -07: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
Jesse Bounds
8afc68bbe4 [ios] Store annotation tags for MGLMultiPoint annotations in the map (#6888)
* [ios] Store annotation tags for MGLMultiPoint annotations in the map

This fixes an issue where, if a multipoint annotation was added,
native annotation view update logic would crash. Adding the annotation
tag for multipoints, too, avoids the out of range exception.

This also adds a check for MGLMultiPoint for offscreen annotations
for consistency with the onscreen case.
2016-11-03 18:19:55 -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
2536ccc6a7 [ios] Fixed deprecation warnings 2016-11-02 12:40:40 -07:00
Minh Nguyễn
e2797d1f24 [ios, macos] Rationalized string enum names
Renamed MGLGeoJSONSourceOption and MGLOfflinePackUserInfoKey constants for clarity and to remove redundancy in the Swift-bridged names. Left the old MGLOfflinePackUserInfoKey constants in place as deprecated aliases.
2016-11-02 12:40:40 -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
Jesse Bounds
14663a5185 [ios] Fix bad merge in iosapp
Although functionality was not affected, a previous merge garbled
the language test with a temporary test done for annotation view
performance improvement.
2016-11-02 11:33:39 -07:00
Minh Nguyễn
6338a3e7f9 [ios, macos] Updated changelogs 2016-11-01 19:13:47 -07:00
Jesse Bounds
b96c20b481 [ios] Update podspecs for beta 2 2016-11-01 12:37:25 -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
Jason Wray
300720c8c7 [ios] Do iosapp token handling in viewDidLoad
Doing this work in viewDidAppear meant that it happened every time the
modal debug settings view disappeared (and the map view reappeared).
2016-10-28 18:02:53 -07:00
Jason Wray
2242e5484c [ios] Add country label language toggle demo
- Select best language based on locale setting and our support.
2016-10-28 18:02:53 -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
Jesse Bounds
67ffc9685e [ios, macos] Make source ownership consistent and GeoJSON content properties writable
Use common initialization logic to create an unique pointer to an mbgl
source object, up front, when a MGL source is created. Keep a raw
pointer to the unique pointer that is pointed at the mbgl source
instance when a MGL source is created or when a MGL source is
obtained by identifier from MGLStyle. Once the transfer of ownership of the 
mbgl source takes place, the unique ptr is null. The raw pointer can be used 
internally for future work that involves mutating the source.

This also changes the URL, features, and geoJSONData content 
properties for MGLGeoJSON source to be writable. If they are set with
valid data after a source has been added to the map then the map will
update to reflect the new data.
2016-10-26 17:08:27 -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
Jesse Bounds
0b37408812 [ios] Optimize event uploading (#6737)
Upload any events collected when the app was in use for apps that only
have "when in use" location permissions. Also, for all apps, avoid
posting event data if there is only a single event.
2016-10-18 14:32:32 -07:00
Jason Wray
f2ca03005b [ios] Fix deploy script temp directory creation (#6740)
Also:
 - Ignore stdout from github-release uploads.
 - Add execution time to finished message.
2016-10-18 16:43:37 -04:00
Jason Wray
d10c1714d5 ios-v.3.4.0-beta.1 2016-10-17 18:36:30 -04: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
ituaijagbone
f558f6bc4a [ios, macos] Add feature initializer
This adds a features initializer to MGLGeoJSONSource. The initializer
takes shapes and converts them to JSON representation before passing
to core. This also adds methods to the MGLShape concrete subclasses
so that they can represent themselves in NSDictionary form suitable
for transforming to JSON (GeoJSON).
2016-10-14 14:59:28 -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
Jason Wray
5d85dbd7cd [ios, macos] Add -mapView:didFinishLoadingStyle: delegate method 2016-10-11 13:07:10 -04:00
Jason Wray
76a2a2db28 [ios] Update SMCalloutView to fix iOS 10 build warnings 2016-10-06 19:54:51 -04: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
Konstantin Käfer
08809b4d44 [macos,ios] initialize util::RunLoop in SDK rather than by default 2016-10-06 10:16:45 -07:00
Jason Wray
8d221cafe0 [ios] Deploy script enhancements (#6581)
* Add `make ideploy` command for publishing iOS releases.
* Get release version from latest ios git tag.
* Use caffeinate to prevent the system from sleeping during the deploy process.
* Checkout tag to ensure correct commit is used
* Fail if release has already been published (not a draft) on GitHub
* Add publish step logging and colorize it.
* Allow s3 upload to show progress.
* Use build/ios/deploy directory for downloaded release zips; always overwrite via -O flag.
* Add zip filename to s3 step.
* Auto-install github-release command
2016-10-05 20:29:17 -04:00
Jesse Bounds
dab8ee93c8 [ios] Observer that app did become active instead of will foreground (#6600) 2016-10-05 11:53:47 -07:00
Justin R. Miller
105673efc1 [ios, macos] fixes #6160: allow updating multipoint coordinates (#6565) 2016-10-04 18:42:12 -07:00
Jesse Bounds
26c32f5c11 [ios] Remove double counting of content inset top and bottom (#6566)
This removes the calls to top and bottom for content inset of the
map view when calculating the edge padding for following. A previous
commit added this along with the left and right values. This
eliminates a bug where the map did not scroll to the correct location
for the user dot and also a bug in
`didUpdateLocationWithUserTrackingAnimated:` where the map panning
operations would always occur because the current and correct points
never matched up even if a stream of location values that were the
same were processed.
2016-10-03 17:21:38 -07:00
Minh Nguyễn
d4151c9f36 [ios, macos] Updated changelogs 2016-10-03 19:06:30 -04:00
Jason Wray
f8a0dc0ff9 ios-v3.4.0-alpha.5 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
9a92a3a5dd [ios][build] Validate dSYM and framework UUIDs 2016-09-30 18:49:05 -04:00