Commit Graph

12 Commits

Author SHA1 Message Date
Fredrik Karlsson
2354c87411 Runtime styling API for iOS/macOS (#5727)
* [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
2016-08-11 13:14:45 -04:00
Jason Wray
4dd734f040 [macos] Add showAnnotations: methods (#5749)
SDK
- Ported `showAnnotations:animated:` and `showAnnotations:edgePadding:animated:` from the iOS SDK.

Demo App
- Added "Show All Annotations" debug menu item with ⇧⌘A shortcut key.
- Disabled "Add Animated Annotation" debug menu item when the annotation already shown.
2016-07-21 16:35:59 -04:00
Minh Nguyễn
08d0a9a0e2 Quadkey tokens in tile URL templates, limited WMS support (#5628)
* [core] Quadkey tokens in tile URL templates

Fixes #5485.

* [core] WMS tokens in tile URL templates

Fixes #822.

* [macos] Added WMS debug style

Added a style to the macosapp resource bundle that can be used to test WMS support. To use it, zoom in to somewhere in New Jersey, then go to View ‣ Custom Style and enter “wms.json”.
2016-07-12 10:57:18 -07:00
Minh Nguyễn
aaa30c8a19 [macos] Revised keyboard shortcuts in macosapp
Followed up #5452 with some changes to keyboard shortcuts that ensure conformance to the HIG and avoid conflicts between menu items.
2016-07-08 11:35:27 +02:00
Konstantin Käfer
e29a15eb52 [macos] add keyboard shortcuts to macosapp 2016-07-07 14:40:28 +02:00
Minh Nguyễn
e603cf46f1 [macos] Use gesture recognizer for context menu
NSView’s built-in context menu handling preempts non-right-click gesture recognizers, so preempt it with a right-click gesture recognizer that does essentially the same thing. With this change, two-finger double-tapping on a trackpad also zooms out, consistent with MapKit.

Fixes #5078.
2016-07-07 14:12:24 +02:00
Minh Nguyễn
8947b0af27 [ios, macos, node] “Mapbox GL Style Specification” → “Mapbox Style Specification” (#5553) 2016-07-04 17:37:11 -07:00
Minh Nguyễn
415c182946 [ios, macos] Renamed overdraw to overdraw visualization (#5416)
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.
2016-06-22 23:22:41 -07:00
Bruno de Oliveira Abinader
97dffeb03d [core] s/Wireframe/Overdraw/g 2016-06-20 13:24:20 +03:00
John Firebaugh
a3318c2ced [macos] Add "Add Animated Annotation" to the Debug menu 2016-06-17 11:38:03 -07:00
John Firebaugh
86d768c2af [macos] Fix an intended floating point division 2016-06-17 11:38:03 -07:00
Minh Nguyễn
b9702ef41a [macos] Renamed OS X SDK to macOS SDK
Also renamed as many references to OS X as possible to macOS in documentation.
2016-06-14 10:02:06 +02:00