summaryrefslogtreecommitdiff
path: root/platform/ios/app
Commit message (Collapse)AuthorAgeFilesLines
...
* [ios, macos] Put MGLStyleLayer inits in respective classesJesse Bounds2016-09-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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.
* [ios] Remove iosapp test stubJesse Bounds2016-09-021-23/+0
| | | | | | 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] Added support for filters (NSPredicate)Fredrik Karlsson2016-09-021-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [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
* [ios] Improve user location annotation documentationJason Wray2016-08-261-7/+9
| | | | | - Add note to mapView:viewForAnnotation: delegate method. - Edit docs in iosapp's implementation of that delegate method.
* [ios, macos] Use local GeoJSON for runtime styling demoMinh Nguyễn2016-08-171-2/+3
| | | | | | Also changed the menu item to something more descriptive. Fixes #6021.
* [ios] Refactored user location annotation into a customizable class (#5882)Jason Wray2016-08-163-1/+193
| | | | | 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.
* fixes #5957: automatically call update() for iOS runtime style APIJustin R. Miller2016-08-161-2/+0
|
* Runtime styling API for iOS/macOS (#5727)Fredrik Karlsson2016-08-111-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [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
* codify implicit assumption about marker-providing delegate method precedenceJustin R. Miller2016-07-251-0/+2
|
* use class instead of magic string comparisonJustin R. Miller2016-07-251-7/+10
|
* refs 654f015: bring back sprite-backed annotation option for comparisonJustin R. Miller2016-07-251-11/+95
|
* [ios] Refactor iosapp demo test shapes functionJason Wray2016-07-221-80/+87
| | | | | - More detailed descriptions of individual shapes. - Make holey polygon square.
* Merge branch 'release-ios-v3.3.0'Minh Nguyễn2016-07-192-3/+1
|\
| * [ios] Reenabled long tap to drop pinsMinh Nguyễn2016-07-152-3/+1
| | | | | | | | 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.
* | Merge branch 'release-ios-v3.3.0' into masterJesse Bounds2016-07-073-34/+20
|\ \ | |/
| * [ios] fixes #5544 support canceling a drag operation and not by default (#5561)Fredrik Karlsson2016-07-051-6/+0
| |
| * [ios] Simplified MBXAnnotationViewMinh Nguyễn2016-07-023-25/+8
| | | | | | | | Eliminated the center view in favor of applying a background color and border to the annotation view’s layer.
| * [ios] Made annotation view position animatableMinh Nguyễn2016-07-021-0/+13
| | | | | | | | | | | | | | | | | | | | 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.
| * [ios] Removed MGLAnnotationView.flatMinh Nguyễn2016-07-021-4/+0
| | | | | | | | Removed MGLAnnotationView’s option to lie flat against a tilted map to work around #5090.
* | [core] code style cleanupsKonstantin Käfer2016-07-011-1/+1
|/ | | | | | | - 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
* [ios] fixes #5036 draggable annotation views (#5373)Fredrik Karlsson2016-06-242-0/+42
|
* [ios, macos] Renamed overdraw to overdraw visualization (#5416)Minh Nguyễn2016-06-231-4/+4
| | | | | | 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.
* [ios] fixes #5127, #5128, #5130 added enabled and selected property to ↵Fredrik Karlsson2016-06-141-0/+8
| | | | | MGLAnnotationView (#5297) [ios] fixes #5127, #5128, #5130 added enabled and selected property to MGLAnnotationView
* [ios] Removed unused annotation image codeMinh Nguyễn2016-06-061-76/+0
| | | | Removed unused annotation image code from iosapp, now that bulk-added point annotations are backed by annotation views.
* [ios, osx] Ignore multipointsMinh Nguyễn2016-06-061-1/+1
| | | | | | 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.
* [ios] Add annotation container view (#5194)Jesse Bounds2016-06-012-4/+18
| | | | | | 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".
* [ios, osx] Holes in polygonsMinh Nguyễn2016-05-271-0/+16
| | | | | | | | 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
* [ios, osx] Feature querying; complex geometry classesMinh Nguyễn2016-05-271-5/+14
| | | | | | | | | | | | | | 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.
* [ios] Add annotation view scaling (#5085)Jesse Bounds2016-05-261-0/+1
| | | | | | | | | | | | | | 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.
* [ios] Only show telemetry debug log options when logging is enabledJason Wray2016-05-231-4/+11
|
* [ios] Remove custom style layer exampleJason Wray2016-05-231-79/+1
|
* [ios, osx] Added wireframe debugging maskMinh Nguyễn2016-05-231-9/+16
| | | | Added an option to MGLMapDebugMaskOptions for the new wireframe debugging mode and UI in the demo applications for toggling it.
* [ios] Allow annotation views to be flattened (#5067)frederoni2016-05-181-0/+1
| | | | | | | | | | * [ios] wip flatten annotation view * [ios] wip flatten annotation view * [ios] naming conventions * [ios] removed unused property
* [ios] Introduce MGLAnnotationView and support for view annotationsJesse Bounds2016-05-133-1/+54
| | | | | | | | | | | | | | | | | | | | | | | 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.
* [ios, osx] Renamed version constant, linked to more infoMinh Nguyễn2016-05-061-6/+6
| | | | | | 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.
* [ios, osx] Renamed Hybrid to Satellite StreetsMinh Nguyễn2016-05-061-2/+2
| | | | The style ID has also changed, but the unversioned method will continue to point to the old v8 style ID.
* [core, ios, osx] Version default style URL APIs; deprecated EmeraldMinh Nguyễn2016-05-061-9/+9
| | | | | | | | | | 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.
* [ios] Use default images for world tour destinationsMinh Nguyễn2016-04-251-1/+1
| | | | 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.
* [ios] Added accessibility labels, hints, gesturesMinh Nguyễn2016-04-252-4/+19
| | | | | | | | | | 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.
* [ios] Made annotation callouts accessibleMinh Nguyễn2016-04-252-0/+23
| | | | 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.
* [ios] Parentheses for build variablesMinh Nguyễn2016-04-241-3/+3
|
* [ios, osx] Made localizable strings unique; unlocalized iosappMinh Nguyễn2016-04-245-186/+48
| | | | | | 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.
* [ios] Made SDK and iosapp localizableMinh Nguyễn2016-04-244-61/+210
| | | | | | | | | | 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.
* [ios, osx] Coordinate formatterMinh Nguyễn2016-04-221-1/+1
| | | | | | 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.
* [ios] Fixed crash on missing access tokenMinh Nguyễn2016-04-211-4/+14
| | | | 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.
* [ios, osx] Constrain zoom level when selecting offline packMinh Nguyễn2016-04-211-0/+1
| | | | | | 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.
* [ios] Observe annotation coordinatesMinh Nguyễn2016-04-191-0/+11
| | | | | | | | 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.
* [ios] Annotation image deletionMinh Nguyễn2016-04-191-37/+55
| | | | | | | | 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
* [ios] Removed app transport security exception for stagingMinh Nguyễn2016-04-181-11/+0
| | | | Also removed staging server URL from UI test application.
* [ios] Use staging server in simulatorMinh Nguyễn2016-04-181-1/+0
| | | | | | Use the staging telemetry server when compiled for the iOS Simulator. Fixes #3621.