summaryrefslogtreecommitdiff
path: root/platform/ios/app
Commit message (Collapse)AuthorAgeFilesLines
...
* [ios, macos] Rename MGLGeoJSONSource to MGLShapeSource (#7334)Jesse Bounds2016-12-091-62/+61
|
* [ios, macos] MGLGeoJSONSource can now be initialized with any shapeFredrik Karlsson2016-12-061-8/+11
|
* [core, ios, macos] Add image accessor to MGLStyle (#7096)Roman Blum2016-12-051-0/+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] Fix integer formatting in formatted exception strings (#7173)Jesse Bounds2016-11-231-1/+1
|
* [ios, macos] Refactor runtime styling enumeration propertiesJesse Bounds2016-11-221-0/+55
| | | | | | | 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] Layer ownership refactor (#6904)fabian-guerra2016-11-041-0/+1
| | | `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`.
* [ios] Fixed deprecation warningsMinh Nguyễn2016-11-021-2/+2
|
* [ios] Fix bad merge in iosappJesse Bounds2016-11-021-3/+0
| | | | | | Although functionality was not affected, a previous merge garbled the language test with a temporary test done for annotation view performance improvement.
* Optimize annotation view updates (#5987)Jesse Bounds2016-11-012-25/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | 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] Do iosapp token handling in viewDidLoadJason Wray2016-10-281-5/+0
| | | | | Doing this work in viewDidAppear meant that it happened every time the modal debug settings view disappeared (and the map view reappeared).
* [ios] Add country label language toggle demoJason Wray2016-10-281-1/+74
| | | | - Select best language based on locale setting and our support.
* [ios, macos] Introduce visible annotations API (#6061)Jesse Bounds2016-10-261-0/+19
| | | | | | 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] Make source ownership consistent and GeoJSON content properties ↵Jesse Bounds2016-10-262-0/+149
| | | | | | | | | | | | | | | | | | | 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.
* Add MGLPointCollection for GeoJSON multipoints (#6742)Jesse Bounds2016-10-201-0/+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/+58
| | | | | | * [ios, macos] Make feature attributes and identifier writable Instances of MGLFeature subclasses can now have their attributes and identifier properties mutated.
* [ios, macos] Expand changes to entire APIMinh Nguyễn2016-10-171-34/+38
|
* [ios, macos] Deprecate -[MGLMapViewDelegate ↵Jason Wray2016-10-141-6/+2
| | | | mapView:alphaForShapeAnnotation:] (#6706)
* [ios, macos] Teach features and shapes about GeoJSON and mbgl typesJesse Bounds2016-10-141-11/+24
| | | | | | 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.
* [ios, macos] Add feature initializerituaijagbone2016-10-141-0/+26
| | | | | | | | This adds a features initializer to MGLGeoJSONSource. The initializer takes shapes and converts them to JSON representation before passing to core. This also adds methods to the MGLShape concrete subclasses so that they can represent themselves in NSDictionary form suitable for transforming to JSON (GeoJSON).
* [ios, macos] Revamped MGLStyleLayer, MGLSource inheritanceMinh Nguyễn2016-10-061-4/+4
| | | | | | | | | | Removed the MGLStyleLayer protocol, because almost none of its members was actually implemented in every class that adopted the protocol. Removed the unused mapView backpointer property with no replacement. Renamed MGLBaseStyleLayer to MGLStyleLayer. Created the intermediate abstract classes MGLForegroundStyleLayer and MGLVectorStyleLayer to cover subsets of style layer classes with like functionality. Moved each MGLBaseStyleLayer initializer and the corresponding properties down to an abstract subclass such that the initializer makes sense for all concrete subclasses. Moved more initializers and the predicate property up to MGLVectorStyleLayer to eliminate duplication among the concrete subclasses. Marked these initializers as designated initializers. Removed “source” or “layer” before identifier wherever the type of identifier is apparent. Removed extra MGLGeoJSONSource initializer variants in favor of nullable parameters. Added copious documentation comments for source and style layer classes, including several previously undocumented methods and properties. In particular, some preconditions and postconditions have been documented. Added pragma marks to break up the jazzy documentation pages into sections. Reformatted exceptions for consistency.
* [ios, android] add visual tests for fill, line, & numeric filter styling (#6433)Justin R. Miller2016-09-234-8/+28540
|
* [ios] revamp settings/debug UI in test app (#6421)Justin R. Miller2016-09-211-253/+438
|
* [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.