Commit Graph

9222 Commits

Author SHA1 Message Date
Justin R. Miller
eefda0d381 [ios, macos] fixes #7059: raise exception for abstract sources on add (#7060) 2016-11-15 11:36:04 -08:00
Fredrik Karlsson
07b311d490 [ios] update layout after device has been rotated 2016-11-15 17:53:50 +01:00
Jason Wray
40a7e6b414 [ios] Constrain compass directly to the top layout guide
In iOS 10, the top layout guide is not always returning the expected
value unless there is a constraint applied directly against it.
2016-11-15 17:53:50 +01:00
Jason Wray
13c6648713 [ios] Make map view UI elements' constraints unambiguous
NSLayoutRelationGreaterThanOrEqual meant that it either greater-than or
equal could satisify the constraint, when really all we need is equal.
2016-11-15 17:53:50 +01:00
Jesse Bounds
1c9d314236 [ios, macos] Take back source and layer ownership on removal (#7048)
If a source or layer is removed from the style, recapture the
unique pointer ownership. This makes it safe to add back sources
and layers after they have been removed.
2016-11-14 15:50:33 -08:00
Minh Nguyễn
56c2272b7d [ios] Upgraded to KIF 3.5.1, OHHTTPStubs 5.2.2 2016-11-14 11:12:04 -08:00
Minh Nguyễn
1f4c317feb [ios] Pull in OHHTTPStubs project reference
Removed individual OHHTTPStubs file references from the ios-tests project. Added a reference to the OHHTTPStubs project to the workspace. Link ios-tests to its iOS framework build product.
2016-11-14 11:12:04 -08:00
Konstantin Käfer
f968ede11b [core] don't run symbol placement more often than necessary 2016-11-14 10:33:21 -08:00
Jesse Bounds
44e398865e [ios, macos] Use std::vector for MGLMultiPoint coordinate storage (#6890)
Refactor the previous C array based implementation to use C++ std::vector. This is done to avoid potential safety and security issues with the previous approach.
2016-11-14 09:34:22 -08:00
Jesse Bounds
96a7a4402e [core] Return source and layer ownership (#7014)
When a source or layer is removed transfer ownership back to the
caller so it can (optionally) take it. Preserve the behavior that 
removing a CustomLayer triggers deinitialization.  Deinitialize all 
custom layers when a style is destroyed in case those layers are not 
explicitly removed.
2016-11-13 19:56:29 -08:00
Fredrik Karlsson
82fcd58121 [ios] specify plist-file for settings bundle 2016-11-13 17:28:00 -08:00
Ivo van Dongen
13a118e3bd [core] symbol layer - recalculate style on icon/text size changes 2016-11-13 16:53:11 -08:00
Bruno de Oliveira Abinader
b7818f2019 [core] Fix render tile ordering when querying sources 2016-11-13 16:10:36 -08:00
Bruno de Oliveira Abinader
610f43cfd2 [linux] Use OSMesa when running Node tests 2016-11-13 16:10:36 -08:00
Bruno de Oliveira Abinader
1b23795097 [linux] Update target headless backends
Enable OSMesa backend via WITH_OSMESA=1 envvar.

OSMesa backend uses Gallium OSMesa implementation, which uses
LLVMpipe as default driver.
2016-11-13 16:10:36 -08:00
Bruno de Oliveira Abinader
5dcf7ca18e [linux] Added OSMesa headless backend 2016-11-13 16:10:36 -08:00
John Firebaugh
870d432f34 [core] Separate pathway for notifying workers of new images/glyphs 2016-11-13 15:32:00 -08:00
Minh Nguyễn
9de8279438 [ios, macos] 3.4.0/0.3.0 sections in changelogs 2016-11-11 22:12:47 -08:00
John Firebaugh
9edda03157 [core] Ensure correct GL context in Map::onLowMemory() 2016-11-09 14:36:44 -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
5e65d8109a [ios, macos] Use the rawLayer pointer to access the mbgl layer (#6966)
A previous refactor neglected to remove the unused `layer` property.
This removes that property and uses the rawLayer property that actually
points to the mbgl layer.
2016-11-08 13:32:58 -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
Minh Nguyễn
4e8121aaf1 [ios, macos] Fixed Xcode 7.x compilation
Define NSErrorDomain before its first use. Define NSNotificationName as a typedef instead of a #define. Guard these shims on the existence of NS_STRING_ENUM rather than another macro that’s new to Xcode 8.

Fixes #6906.
2016-11-04 14:02:10 -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
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
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
Minh Nguyễn
62647a013f [ios, macos] Corrected MGLStyleValue inheritance
MGLStyleConstantValue and MGLStyleFunction now inherit from MGLStyleValue with a generic argument matching the child class’s own generic argument.

Fixes #6823.
2016-10-26 15:16:15 -07:00
Minh Nguyễn
dc884cd6c3 [ios, macos] Fixed syntax error in documentation comment (#6822)
Fixes #6821.
2016-10-26 00:36:23 -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
Cameron Mace
45f4dc0166 removed brew cask install android studio instruction (#6723)
* removed brew cask install android studio instruction

* link to download JDK

* made fixes to instruction
2016-10-25 16:44:03 -04:00