summaryrefslogtreecommitdiff
path: root/platform/macos
Commit message (Collapse)AuthorAgeFilesLines
* Prevent stopless functions (#7309)Fredrik Karlsson2016-12-071-0/+6
| | | | | | * [ios, macos] prevent stopless functions * [ios, macos] removed unused bridging header and fixed naming
* [ios, macos] Migrate MGLCustomStyleLayerAdditions to style layer API (#7250)Minh Nguyễn2016-12-078-3/+127
| | | | | | | | | | | | | | | | | | | | | | | | * [ios, macos] Replaced custom style layer API with MGLOpenGLStyleLayer Replaced the custom style layer API on MGLMapView with an equally unsupported MGLOpenGLStyleLayer API that nonetheless is consistent with the broader runtime styling API and is compatible with macOS. Fixed an unrecognized selector crash when wrapping a layer of unrecognized type coming from mbgl. * [macos] Added lime green layer demo to macosapp Reprised the demo removed from iosapp in #5091. * [ios, macos] Rationalized MGLOpenGLStyleLayer API MGLStyle now strongly references any MGLOpenGLStyleLayer object that’s added to it, in order to prevent pointers from going stale and make it easy for layer drawing code to get more information about the map view. Replaced the MGLOpenGLStyleLayer callback blocks with overridable instance methods. Added internal documentation for each method. Subclassed MGLOpenGLStyleLayer as LimeGreenStyleLayer inside macosapp. Consolidated -addToMapView: into -addToMapView:belowLayer: to ensure that MGLRedundantLayerException gets raised even if the layer is being inserted rather than added to the bottom of the stack. * [core] Clarified that rendering happens on the main thread * [ios, macos] Fixed removing and re-adding MGLOpenGLStyleLayer Don’t allow index-based layer removal to circumvent -removeFromMapView:, which MGLOpenGLStyleLayer relies on to synchronize the style’s array of MGLOpenGLStyleLayers. When obtaining an MGLOpenGLStyleLayer, get the instance already added to the style instead of creating a new one to wrap the underlying CustomLayer.
* [ios, macos] More ways to reshape an MGLMultiPoint (#7251)Minh Nguyễn2016-12-061-1/+1
| | | | | | | | | | | | | | | | | | * [ios, macos] Completed API for mutating multipoints Added the complete set of methods for mutating the vertices of an MGLMultiPoint. Also rewrote MGLMultiPoint documentation to refer to vertices instead of points. * [ios, macos] Removed inaccurate MGLOverlay commentary This paragraph is full of references to features that exist in MKOverlay but not MGLOverlay. * [ios, macos] Lazily compute multipoint bounds Invalidate the bounds whenever the coordinates change, but don’t recompute the bounds until they’re requested. Simplified -intersectsOverlayBounds: for immutable overlay classes. Added a utility function for testing whether two MGLCoordinateBounds intersect, based on mbgl::LatLngBounds::intersects(). Removed unused color conversion code.
* [ios] s/iconSize/iconScale/Minh Nguyễn2016-12-061-1/+1
| | | | Followup to #7310.
* [ios, macos] Template images as style imagesMinh Nguyễn2016-12-062-1/+19
| | | | Convert template images to SDF icons and back when storing them as style images.
* [ios, macos] MGLGeoJSONSource can now be initialized with any shapeFredrik Karlsson2016-12-061-4/+4
|
* [core, ios, macos] Add image accessor to MGLStyle (#7096)Roman Blum2016-12-053-3/+20
| | | | | | | | | | | | * [core] Add interface to get image from sprite atlas * [tests] Add tests for Map::getImage * [ios, macos] WIP: get MGLImage for name from style * [ios, macos] Fixed -imageForName: Convert from sprite images to platform images using the existing encodePNG() function, which is also used for printing. Allow -imageForName: to return nil without an assertion failure. Added a basic test.
* [ios, macos] Rename MGLMapViewTests back to MGLStyleLayerTestsJesse Bounds2016-12-021-10/+10
|
* [ios, macos] renamed MGLStyleLayerTests to MGLMapViewTestsIvo van Dongen2016-12-021-10/+10
|
* [ios, macos] Make tap gesture recognizer fail if it doesn’t do anything ↵Jesse Crocker2016-12-012-4/+21
| | | | | | | | | | | | | | | | | | (#7246) * Make tap gesture recognizer fail if it doesn’t do anything. * fix typo * Use the right nullable * update changelog * Make single click gesture recognizer fail if it doesn’t select an annotation * fix changelog typo * Remove singleTapGestureRecognizer from public header
* [ios, macos] Add notes to APIs that rely on style and source ids (#6886)Jesse Bounds2016-11-301-0/+23
| | | Update documentation to make the implications of identifiers clearer.
* [ios, macos] Marked C array parameters as constMinh Nguyễn2016-11-292-1/+2
| | | | Fixes #7214.
* [ios, macos] Refcount view activations (#7208)Jesse Bounds2016-11-291-0/+11
| | | | | | | | This adds a ref count to guard against calling activate after it has already been called. This can happen when a layer is added during certain map lifecycle methods like MapChangeWillStartRenderingFrame that also triggers activation. This also protects against issues related to a deactivation of the context happening in an inner scope while an outer scope is still expecting to be able to use the context.
* [macos] Added option to localize labelsMinh Nguyễn2016-11-282-0/+90
| | | | Added a setting to macosapp to change all symbol layers in the current style to use the preferred language if available. If the setting is off, change all symbol layers to use local languages.
* [macos] Name custom style in toolbarMinh Nguyễn2016-11-282-2/+6
| | | | Display the custom style’s name in the Style toolbar button.
* [macos] Added Layers sidebarMinh Nguyễn2016-11-2819-16/+940
| | | | | | Added a sidebar to the main document window in macosapp that lists the layers in the current style and updates whenever the style changes or a layer is added or removed programmatically. Display an icon beside each layer in the sidebar that indicates the kind of layer. Double-click a layer or layers to toggle their visibility, which is an undoable action. Added a menu item and toolbar button to toggle the Layers sidebar. Added a context menu for toggling visibility of and deleting layers selected in the Layers sidebar. Checked in the original SVGs for layer icons.
* [macos] Avoid first responder action name conflictMinh Nguyễn2016-11-284-11/+11
| | | | Fixed a crash that often occurred when switching styles. MGLMapView was ahead of MapDocument in the responder chain, so calls to -setStyle: were going to MGLMapView’s private -setStyle: method. The sender was being passed in the first parameter instead of an MGLStyle method.
* [ios, macos] Key-value compliance for MGLStyleMinh Nguyễn2016-11-282-12/+40
| | | | | | Replaced -[MGLMapView style] with a property. Keep the MGLStyle object around for the lifetime of the style. Bracket changes to layers in willChange and didChange calls. The built-in point annotation layer is added after the style is finished loading but before the map is finished loading. Cause a second wave of change notifications to go out, about both sources and layers. Issue change notifications for style layers when shape annotations are added or removed.
* [ios, macos] Refactor runtime styling enumeration propertiesJesse Bounds2016-11-222-0/+13
| | | | | | | Correctly map SDK runtime styling enumerations to mbgl equivalents. Also, add category methods to NSValue so enums can be wrapped up with less of the details of how they are layed out in memory in Objective-C.
* [ios, macos] Updated changelog for #7091Minh Nguyễn2016-11-221-0/+1
|
* [ios, macos] Documented localization workflowMinh Nguyễn2016-11-181-0/+9
|
* [ios, macos] Updated changelogMinh Nguyễn2016-11-151-1/+1
|
* [ios, macos] 3.4.0/0.3.0 sections in changelogsMinh Nguyễn2016-11-111-1/+1
|
* [ios, macos] Fixed crash getting annotation viewMinh Nguyễn2016-11-081-7/+2
| | | | 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.
* [macos] Map annotations to annotation tagsMinh Nguyễn2016-11-081-0/+9
| | | | 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.
* [ios, macos] Work around annotation race condition (#6924)Jesse Bounds2016-11-041-1/+11
| | | | | | | | | | | | | | | | | | | 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.
* [macos] Enabled runtime styling testsMinh Nguyễn2016-11-021-0/+19
| | | | | | 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.
* [macos] Fixed color roundtrippingMinh Nguyễn2016-11-021-1/+1
| | | | Fixed an issue that caused the runtime styling API to return colors in the sRGB color space instead of the calibrated RGB color space.
* [macos] Added MGLValueEvaluator to projectMinh Nguyễn2016-11-021-0/+3
| | | | This header was missing from the project. The code was only compiling because the header was still on the search path.
* [ios, macos] Share more testsMinh Nguyễn2016-11-021-1/+21
| | | | 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.
* [ios, macos] Adopted string enumerationsMinh Nguyễn2016-11-021-0/+1
| | | | | | 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.
* [ios, macos] Updated changelogsMinh Nguyễn2016-11-011-3/+6
|
* [ios, macos] Update changelogs for visible annotations APIJesse Bounds2016-11-011-0/+1
|
* Optimize annotation view updates (#5987)Jesse Bounds2016-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ios, macos] document custom API URL & add Info.plist guide (#6833)Justin R. Miller2016-11-013-0/+19
| | | Also support base URL nullability in order to use default value.
* [ios, macos] Introduce visible annotations API (#6061)Jesse Bounds2016-10-262-0/+50
| | | | | | 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.
* [ios, macos] Added Swift MGLStyleValue testsMinh Nguyễn2016-10-261-0/+14
| | | | Added tests of MGLStyleValue written in Swift, along with bridging headers just in case they become needed in the future.
* Merge branch 'master' into boundsj-release-ios-3.4.0-merge-masterJesse Bounds2016-10-252-34/+53
|\
| * [core] move gl::Context to Backend and refactor ViewKonstantin Käfer2016-10-252-30/+30
| |
| * [core] separate Backend from View for headless renderingKonstantin Käfer2016-10-252-11/+20
| |
| * [core] [node] pass thread pool impl to Map constructorMike Morris2016-10-202-1/+11
| | | | | | | | | | | | | | Updates mbgl::Map constructor usage everywhere Adds NodeThreadPool implementation using AsyncQueue to call Nan::AsyncQueueWorker from main thread
* | Add MGLPointCollection for GeoJSON multipoints (#6742)Jesse Bounds2016-10-205-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [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.
* | [ios, macos] Make feature attributes and identifier writable (#6728)Jesse Bounds2016-10-191-0/+1
|/ | | | | | * [ios, macos] Make feature attributes and identifier writable Instances of MGLFeature subclasses can now have their attributes and identifier properties mutated.
* [macos] Added MGLTileSet to project (#6713)Minh Nguyễn2016-10-171-0/+12
| | | Also reformatted some MGLTileSet documentation.
* [ios, macos] Change runtime styling category method prefix to mgl_Jason Wray2016-10-173-9/+9
| | | | This makes runtime styling category method naming consistent with the rest of the SDK.
* [ios, macos] Expand changes to entire APIMinh Nguyễn2016-10-173-99/+32
|
* [ios, macos] Update changelogs (#6714)Minh Nguyễn2016-10-171-12/+27
| | | | | | * [macos] Subdivided release by topic in changelog * [ios, macos] Updated changelogs
* [ios, macos] fixes #6346: add support for configurable API base URL (#6709)Justin R. Miller2016-10-151-0/+8
|
* [ios, macos] Deprecate -[MGLMapViewDelegate ↵Jason Wray2016-10-144-13/+21
| | | | mapView:alphaForShapeAnnotation:] (#6706)
* [ios, macos] Teach features and shapes about GeoJSON and mbgl typesJesse Bounds2016-10-141-13/+50
| | | | | | 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.