| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
This fixes a few bugs in our iosapp examples that were exposed by
recent refinements to the APIs they use.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This checks the kind of MGLShape passed into the source and, if it
is a feature, it mbgl feature objects to pass to core. This keeps the
feature id and attributes data intact. If the shape is a
`MGLShapeCollectionFeature` it creates an `mbgl::FeatureCollection`
object (also to keep feature properties). If the shape is not any
sort of feature, it passes along just the geometry.
This also uses the MGLFeatureFromMBGLFeature converter for the case where
GeoJSON data passed in to a source contains a single feature. The
converter has logic to keep the id and attributes properties intact.
Before, these properties were lost because only geometry conversion
was done.
Finally, logic to handle (and associated tests) of nested shape
collection features is removed since that is not supported by
the GeoJSON spec or the core implementation.
[ios] Add test of drawing plain shape to iosapp
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
`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`.
|
| |
|
|
|
|
|
|
| |
Although functionality was not affected, a previous merge garbled
the language test with a temporary test done for annotation view
performance improvement.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Doing this work in viewDidAppear meant that it happened every time the
modal debug settings view disappeared (and the map view reappeared).
|
|
|
|
| |
- Select best language based on locale setting and our support.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [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.
|
| |
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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".
|