| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we declared MGLStyleLayer initializers in the MGLStyleLayer
protocol as optional methods. This made it easy to opt in and out
of initializers that did or or did not make sense for the subclass.
However, this approach was dangerous since it was easy for an
application developer to initialize an MGLStyleLayer subclass with an
init method that was actually not implemented in that class causing
an exception at runtime.
This commit moves the init methods that each subclass supports to
each subclass so xcode (and the compiler) help the developer avoid
the previously possible runtime exception.
In addition, a new init method is added that takes the source layer
and passes that on to `mbgl::style:Layer` (but only on classes
where this is possible in core). This allows an application developer
to style a specific source layer (i.e. the contour lines of the mapbox
terrain vector source).
Finally, this refactors MGLStyleLayer classes to use an MGLSource instead of a
string identifier for the source when initializing the style.
|
|
|
|
|
|
| |
The PR to add filter predicates (#6049) added logic to apply some
runtime styling to the iosapp as soon as the map finished loading.
This removes that logic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ios, macos] cleaned up filters
[ios] added a filter example
[ios] utest filters
[ios, macos] nested predicates
[ios] refactored
[ios] filter -> NSPredicate
[ios] fixed mbgl::Any/AllFilter -> NSPredicate
[ios] translate nested mbgl::NotIn filters
[ios] cleanup and added more utests
[ios] fixed a bug in the None filter conversion and improved utests
[ios, macos] doc
[macos] added missing category
[ios, macos] additional utests
[ios, macos] updated documentation
|
|
|
|
|
| |
- Add note to mapView:viewForAnnotation: delegate method.
- Edit docs in iosapp's implementation of that delegate method.
|
|
|
|
|
|
| |
Also changed the menu item to something more descriptive.
Fixes #6021.
|
|
|
|
|
| |
A new class, `MGLUserLocationAnnotationView`, has been added that inherits from `MGLAnnotationView`.
Use a subclass of `MGLUserLocationAnnotationView` to customize the appearance of the user location annotation. Use your custom view with the `MGLMapView.userLocation` annotation via the `-mapView:viewForAnnotation:` delegate method.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [ios] wip runtime styling
* [ios, macos] Outlined header templates
* [ios, macos] cleanup and use appropiate data types
* [ios, macos] removed refs to mbgl and added convenient color methods on UIColor and NSColor
* [ios, macos] updated header template, included doc string
* [ios, macos] outlined template for layer implementation files
* [ios, macos] moved script to platform/darwin and updated comments
* [ios, macos] Cleaned up the implementation template
* [ios, macos] removed unused function and added support for more datatypes
* [ios, macos] overhauling the type protocols
* [ios, macos] removed unnecessary style classes
* [ios, macos] added support for more types
* [ios, macos] fixed string and number prop values
* [ios, macos] enum getters
* [ios, macos] added removeLayer() and removed unused layer ref
* [ios, macos] fixed remaining layer types and converted style layer into a protocol
* [ios, macos] fixed addLayer() and added example for line layer
* [ios] GeoJSON source now works
* [ios] fixed raster layer and raster source
* [ios] fixed attr prop number and outlined prop function
* [ios] wip functions
* [ios] bool and float function fix
* [ios] cleanup
* [macos] fixed support for macos
* [ios] fixed string functions
* [ios] extended array functions
* [ios] added tests and fixed a few bugs
* [ios] less verbose functions and improved tests
* [ios, macos] Removed unnecessary use of default arguments
Default arguments aren’t supported in Node v4, and they aren’t needed here anyways, because we’re only testing for truthiness.
* [ios, macos] Enum setters
Rely on a macro instead of category methods to specialize the setter implementation for enum attributes, since generic types are disallowed in Objective-C method signatures and mbgl::style::PropertyType must be type-qualified.
* [ios, macos] Got macOS closer to parity w/ iOS
Added various classes and test classes to the macOS workspace. Also fixed lots of compiler errors and updated macosapp runtime styling example to use the new dictionary syntax for function stops.
Updated all conversions from Objective-C stops to C++ stops to enumerate over the dictionary. Fixed compiler errors in enum setter implementations.
Also corrected path to script in generated file comments.
* [ios, macos] Added EJS templates to project
* [ios, macos] Code formatting
Made code format more consistent.
* [ios, macos] Spelled out ID
Cocoa convention is to always spell out “ID” as “identifier”, in part to avoid confusion with the id keyword. Also, URL is capitalized in most contexts, including property names.
* [ios, macos] Grouped related headers together
* [ios, macos] Cleaned up layer transformation
Also added support for converting background layers into Objective-C.
* [ios, macos] Cleaned up tests
Also made the tests work on macOS by introducing a new window to host the map.
* [ios, macos] Replaced TODOs with #warnings
* [ios] convert array based property values
* [ios, macos] color function/undefined getter
* [ios, macos] fixed function/undefined getters for bool and float properties
* [ios, macos] more function/undefined property getters
* [ios, macos] more type conversion and cleanup
* [ios, macos] disable macos runtime styling tests for now
* [ios, macos] cleaned up style code script
* [ios, macos] more type conversion
* [ios] added a base layer to handle visibility min/max zoom
* [macos] fixed base layer
* [ios, macos] use accessor methods
* [ios, macos] cleanup
* [ios, macos] add geojson to ios and macos
* [macos] rebase fix
* [ios, macos] fixed enum getters and added tests for enums
* [ios, macos] added an update method to base layer
* [ios, macos] added some documentation
* [ios, macos] docs
* [ios, macos] removed refs to filters for now
* [ios, macos] various tail work
* [ios, macos] missing import and incorrect type
|
| |
|
| |
|
| |
|
|
|
|
|
| |
- More detailed descriptions of individual shapes.
- Make holey polygon square.
|
|\ |
|
| |
| |
| |
| | |
Long pressing drops pins again. The minimum press duration has been extended to a second to avoid preempting the built-in gesture for draggable annotations.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| | |
Eliminated the center view in favor of applying a background color and border to the annotation view’s layer.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We don’t normally want an annotation view to animate its position, because that makes the view appear to lag behind the map. But when the annotation view moves due to the underlying annotation model object moving, the developer may want exactly that effect.
This change continues to disable the default implicit bounds (and now position) animation. It also groups the view updates in -updateAnnotationViews in a transaction that disables animation actions, to improve perceived performance with a large number of annotations. However, when the annotation model object changes, we move the annotation view outside of that transaction to allow the developer to opt into animation.
If the developer moreover wants the annotation view to animate even due to the viewport changing, they can override -setCenter: to use a UIView animation block.
Fixes #5230.
|
| |
| |
| |
| | |
Removed MGLAnnotationView’s option to lie flat against a tilted map to work around #5090.
|
|/
|
|
|
|
|
| |
- puts function definitions in a namespace ... {} rather than using namespace ...;
- remove trailing whitespace
- add trailing newline
- protect SQL statements from being formatted by clang-format
|
| |
|
|
|
|
|
|
| |
A verb doesn’t make sense in this enum value. Instead, use a descriptive word for this effect and describe it in detail in the documentation comment.
Cherry-picked from 415c18294693166472785459f9d5bc8be31b7033.
|
|
|
|
|
| |
MGLAnnotationView (#5297)
[ios] fixes #5127, #5128, #5130 added enabled and selected property to MGLAnnotationView
|
|
|
|
| |
Removed unused annotation image code from iosapp, now that bulk-added point annotations are backed by annotation views.
|
|
|
|
|
|
| |
Ignore multipoints (as opposed to polylines and polygons) when adding annotations, just like we ignore multipolylines, multipolygons, and shape collections.
In osxapp, break multipoint features into points before adding them as annotations.
|
|
|
|
|
|
| |
Add a container view to hold annotations. This gets around a performance
issue with `UIView:addSubview:` where adding views is N^2. It helps
annotation views avoid cutting into callout views when the annotation
views are transformed to be "flat".
|
|
|
|
|
|
|
|
| |
MGLPolygon (and by extension MGLMultiPolygon) now supports interior rings. The data is preserved in feature querying results, and interior rings are respected when adding polygon overlays to the map.
Fixes #1729.
[ios, osx] Updated changelog
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added methods to MGLMapView that return the rendered features at a visible point or within a visible rectangle on the map, optionally restricted to a set of layers, plus voluminous documentation.
Added several new geometry classes corresponding to distinct geometry types supported by geometry.hpp. Added parallel “feature” classes to represent these geometries along with tags (IDs) and attributes (properties) from the source.
Grouped classes in the Foundation and SDK groups by theme.
In iosapp, dropped pins’ callout views now display the name of the topmost named feature at that point.
In osxapp, a long press on the map highlights the features under the cursor. Dropping a pin via the menu or context menu item shows the usual dropped pin, but the pin’s title is now the name of a feature under the cursor, if available, rather than “Dropped Pin”.
Fixes the iOS/OS X side of #352.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds an option to MGLAnnotationView so that a developer can control
how their annotation views scale in size as they approach the top of
the map view (along the Y axis). The size change is also affected by
the pitch (tilt) of the map view. If there is no tilt then scaling
is not performed. As the map is tilted scaling is gradually applied.
This turns the MGLAnnotationView implementation into an Objective C++
class so that SDK constants from C++ files can be used.
The new behavior is enabled by default to maintain consistency with
annotations backed by GL sprites. The MBXViewController redundantly
sets the new property as an illustration of use.
|
| |
|
| |
|
|
|
|
| |
Added an option to MGLMapDebugMaskOptions for the new wireframe debugging mode and UI in the demo applications for toggling it.
|
|
|
|
|
|
|
|
|
|
| |
* [ios] wip flatten annotation view
* [ios] wip flatten annotation view
* [ios] naming conventions
* [ios] removed unused property
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add an UIView subclass that can be used as the base class for all
client provided UIViews for annotations.
Teach MGLMapView to be able to display annotation views over the map if provided by the client delegate. For now, if the delegate provides a UIView then it will be used. If not, the map view will fall back to the old strategy of using GL annotations with an image provided by the delegate or a default image if not.
The map keeps a reuse queue and will store annotation views that are panned
offscreen in the queue if the application developer supplied a reuse queue identifer. The views in the queue are reused when more annotation
views are required. This view reuse provides a performance gain when many
annotations are shown and most of them are offscreen.
iosapp now implements the new delegate method to supply
a native view.
Add a playground to the workspace to facilitate experimentation
with new features. A playground is capable of importing frameworks if it
exists in the same workspace that builds the imported framework. The
initial playground demonstrates annotation views.
This also fixes a crash due to nullptr in annotations array If the `annotations` method is called while the user dot's callout view was showing, the userdot annotation is represented as null in the annotation context map. This
caused a crash when the null pointer was attempted to be converted
into an NSArray via C array. This protects against this bug by filtering out such a null annotation.
|
|
|
|
|
|
| |
Renamed MGLStyleCurrentVersion to MGLStyleDefaultVersion to emphasize the constant’s role as an indicator of the default version used by SDK classes, which may be behind depending on release schedules. In the documentation for each style URL method, include the actual version number instead of the constant. In unit tests, verify that this documentation is in sync with the constant.
Link each style URL method’s documentation to a forthcoming webpage on mapbox.com that describes the style in rich detail.
|
|
|
|
| |
The style ID has also changed, but the unversioned method will continue to point to the old v8 style ID.
|
|
|
|
|
|
|
|
|
|
| |
Updated default styles from v8 to v9. Deprecated the MGLMapView class methods in favor of new methods that take a version parameter. Deprecated Emerald outright in favor of Outdoors. Replaced usage of the unversioned MGLStyle methods with the corresponding versioned methods and MGLStyleCurrentVersion to ensure consistency.
Expanded MGLStyle unit tests to also assert that MGLStyle has the right number of style URL methods and that they’re all public. Linked the OS X SDK unit test bundle to libmbgl-core.a. Removed an unnecessary dependency on osxapp.
Replaced Emerald with Outdoors in iosapp and osxapp.
Fixes the iOS and OS X side of #4577 and #4702.
|
|
|
|
| |
Use the default red pin images for world tour destinations in iosapp instead of the two characters usually used for the “Add n Points” actions.
|
|
|
|
|
|
|
|
|
|
| |
Fixed an issue where the “return to map” accessibility element lacked a label. Always update the title and subtitle of an annotation accessibility element, in case the title or subtitle changes from one showing to the next.
Added a hint for annotations. Use declarative rather than imperative for hints.
Marked the map view and its annotations as adjustable so that swiping up and down with VoiceOver zooms out and in, respectively.
Added accessibility values to toolbar buttons in iosapp.
|
|
|
|
| |
Via nfarina/calloutview#84, SMCalloutView is now accessible. Activating a focused annotation now shows its callout view and focuses its left accessory view, if present, or the title view. There is a “return to map” accessibility element for dismissing the callout view and restoring focus to the annotation on the map.
|
| |
|
|
|
|
|
|
| |
Assigned unique IDs to localizable English strings in code.
Made iosapp non-localizable. For the time being, it isn’t worth the trouble to localize more strings for this demo application than for the SDK itself.
|
|
|
|
|
|
|
|
|
|
| |
Made storyboards and strings throughout the SDK and iosapp localizable. Replaced the compass image with an unlabeled image. Draw a localizable string atop it at runtime.
Redefined NSLocalizedString() and NSLocalizedStringFromTable() macros to look at the SDK bundle rather than the main application bundle. This redefinition has no effect on the host application, because it’s in an internal header. That header must be included in all files that contain localizable strings. See NSBundle+MGLAdditions.h for a full explanation.
Added a make rule that runs genstrings and ensures UTF-8 output (since genstrings insists on UTF-16).
Use MGLCoordinateFormatter in iosapp for dropped pin callouts. Rely on subclasses of MGLPointAnnotation instead of annotation titles to distinguish between different kinds of point annotations.
|
|
|
|
|
|
| |
Added a degree-minute-second coordinate formatter for general use. Use this formatter in iosapp and osxapp.
Added unit tests for the coordinate formatter and for round-tripping geometry types through NSValue.
|
|
|
|
| |
Fixed a race condition in which the access token alert controller would fail to present because the view controller hadn’t yet entered the view hierarchy, plus a downstream crash caused by the access token being missing.
|
|
|
|
|
|
| |
When selecting an offline pack for display in iosapp or osxapp, constrain the zoom level to the pack’s minimum and maximum zoom levels.
Fixes #4787.
|
|
|
|
|
|
|
|
| |
MGLMapView observes changes to the coordinate property of each MGLAnnotation added to it. Changing the coordinate property in a KVO-compliant way causes the annotation to be relocated and its callout view, if present, to be dismissed. To avoid observing the same annotation twice yet also avoid expensive lookups when adding or removing annotations, MGLMapView indexes added point annotations in an NSMutableSet.
In iosapp, tapping a callout view moves the selected annotation to the center of the screen and deselects it.
Fixes #1980.
|
|
|
|
|
|
|
|
| |
Added an API for deleting unused annotation images’ images. When you nil out the image of an MGLAnnotationImage, MGLMapView deletes the sprite from the style and recreates any annotation associated with the MGLAnnotationImage instance; the MGLAnnotationImage’s falls back to SDK’s default annotation image.
In iosapp, deselecting an annotation resets its image to the default; deselecting it again restores the image.
ref #3185
|
|
|
|
| |
Also removed staging server URL from UI test application.
|
|
|
|
|
|
| |
Use the staging telemetry server when compiled for the iOS Simulator.
Fixes #3621.
|