| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* [ios, macos] prevent stopless functions
* [ios, macos] removed unused bridging header and fixed naming
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [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] 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.
|
|
|
|
| |
Followup to #7310.
|
|
|
|
| |
Convert template images to SDF icons and back when storing them as style images.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#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
|
|
|
| |
Update documentation to make the implications of identifiers clearer.
|
|
|
|
| |
Fixes #7214.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
| |
Display the custom style’s name in the Style toolbar button.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixed an issue that caused the runtime styling API to return colors in the sRGB color space instead of the calibrated RGB color space.
|
|
|
|
| |
This header was missing from the project. The code was only compiling because the header was still on the search path.
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
| |
Also support base URL nullability in order to use default value.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Added tests of MGLStyleValue written in Swift, along with bridging headers just in case they become needed in the future.
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Updates mbgl::Map constructor usage everywhere
Adds NodeThreadPool implementation using AsyncQueue to call
Nan::AsyncQueueWorker from main thread
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* [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
Instances of MGLFeature subclasses can now have their attributes
and identifier properties mutated.
|
|
|
| |
Also reformatted some MGLTileSet documentation.
|
|
|
|
| |
This makes runtime styling category method naming consistent with the rest of the SDK.
|
| |
|
|
|
|
|
|
| |
* [macos] Subdivided release by topic in changelog
* [ios, macos] Updated changelogs
|
| |
|
|
|
|
| |
mapView:alphaForShapeAnnotation:] (#6706)
|
|
|
|
|
|
| |
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.
|