Commit Graph

561 Commits

Author SHA1 Message Date
Minh Nguyễn
0e3270cb15 Replaced user-facing assertions with exceptions
Errors caused by client code should be communicated through NSExceptions. NSAsserts are intended for internal usage; because they include helpful information like the absolute path to the file containing the assertion, stripping the build (#1650) also strips assertion messages. Also replaced hardcoded references to methods in these messages with __PRETTY_FUNCTION__, which avoids future copy-pasta and handles cases in which the MGL class has been subclassed.
2015-06-18 10:59:12 -07:00
Thiago Marcos P. Santos
1f12bcee90 Support shape annotations on GLFWView
Add different random triangles count by using the keys 7, 8, 9 or 0.
Q will clear all the annotations.
W will remove one annotation.
2015-06-18 13:39:18 +03:00
Minh Nguyễn
bf6a100801 Avoid null-change KVO notifications
If no access token is set in the Info.plist, avoid triggering a KVO notification about the access token changing. By the same token (heh), avoid pulling a C string out of the change dictionary if the access token is being nilled out.
2015-06-17 16:49:12 -07:00
Minh Nguyễn
91641ffb01 Lightweight generics
Added lightweight generics annotations to collection-typed method and protocol signatures to streamline usage of these members in Swift. Lightweight generic type specifiers are wrapped in conditionally-compiled macros for compatibility with Xcode 6.x.

Manually preprocess the NS_*_OF() macros in a temporary copy of each header before appledoc sees the headers. Also removed the --ignore flag because we no longer have a private headers folder under include/mbgl/ios/.
2015-06-17 15:33:00 -07:00
Minh Nguyễn
416928f824 Defer to MGLMultiPoint for overlayBounds implementation
Fixes #1730.
2015-06-16 11:06:46 -07:00
Justin R. Miller
bd0bf294bf squash of #1655: shape annotations support for core & iOS 2015-06-15 18:30:39 -07:00
Minh Nguyễn
714b68f7b3 Revert "use array of structs rather than parallel arrays for annotations"
This reverts commit 2435c1ad26 (#1710), which needs to be revisited in light of #1655, which is a much higher priority at the moment.
2015-06-15 15:58:22 -07:00
Minh Nguyễn
4176d21d1c Namespaced reachability notification constant
Fixes #1717.
2015-06-12 11:54:46 -07:00
Konstantin Käfer
2435c1ad26 use array of structs rather than parallel arrays for annotations 2015-06-11 17:26:37 -04:00
Minh Nguyễn
f46328655e Audited headers for nullability
Added some nullability qualifiers in method implementation selectors for consistency with declarations.

The user dot view now has a non-zero size. Previously only its layer was sized properly. Also resolved some pedantic warnings about missing designated initializer overrides.

Xcode 6.3 or above is now required for building this project.
2015-06-11 11:37:23 -07:00
Konstantin Käfer
0c5f8a2c59 press 1 through 6 to add 10^(n-1) points in the current viewport
(only works correctly when rotated to north, but this is a just a debug functionality anyway)
2015-06-09 10:29:07 -04:00
Ansis Brammanis
9c03b396c0 Merge remote-tracking branch 'origin/master' into HEAD
Conflicts:
	src/mbgl/renderer/painter_fill.cpp
2015-06-03 19:20:41 -04:00
Brad Leege
70acae7941 #1659 - Converting true to YES, false to NO to match Objective C standards 2015-06-01 15:06:32 -05:00
Brad Leege
ebe1e2158c #1659 - Converting usingTestServer to atomic property 2015-06-01 15:05:01 -05:00
Ansis Brammanis
ff6a5ce5bc Merge remote-tracking branch 'origin/master' into new-labelling
Conflicts:
	src/mbgl/map/source.cpp
	src/mbgl/map/source.hpp
	src/mbgl/map/tile_data.cpp
	src/mbgl/map/tile_parser.cpp
	src/mbgl/map/vector_tile_data.cpp
	src/mbgl/renderer/painter.cpp
	src/mbgl/renderer/symbol_bucket.cpp
	src/mbgl/text/glyph.hpp
	src/mbgl/text/glyph_store.cpp
	src/mbgl/text/placement.cpp
	test/suite
2015-05-28 20:01:15 -04:00
Ansis Brammanis
8962442b1b make collision debug boxes toggleable 2015-05-28 19:17:07 -04:00
Brad Leege
d44450ac7b #1659 - Adding tile stream certificate and ssl pin check for test server. 2015-05-28 15:51:50 -07:00
Minh Nguyễn
86dd0e99bc Defailablize init methods
If an OpenGL context couldn’t be created, there’s just no point to soldiering on. Things are going to fall apart pretty quickly anyways. Assert and be done with it.
2015-05-27 12:51:30 -07:00
Minh Nguyễn
a2986b2019 Return nil upon failure to initialize 2015-05-27 12:36:52 -07:00
Brad Leege
d0864d719b #1641 - Changing version to a static constant instead of a property 2015-05-26 14:24:02 -07:00
Brad Leege
ad0a2af6b5 #1641 - Adding version and instance to Turnstile event and keeping them DRY for general events processing 2015-05-26 13:50:01 -07:00
Konstantin Käfer
f4707f72e0 Replace mbgl::util::make_unique<> with std::make_unique<> 2015-05-26 17:57:38 +02:00
John Firebaugh
87b1da7611 DefaultFileSource has responsibility for handling mapbox:// URLs 2015-05-26 12:14:10 +02:00
Konstantin Käfer
f11a9f8fd9 prefix Reachability with "MGL" to avoid linking conflicts and app store rejections 2015-05-26 11:13:08 +02:00
Konstantin Käfer
ba3a6ea2b0 update Reachability with latest version 2015-05-26 11:08:31 +02:00
Minh Nguyễn
343941d24c Merge pull request #1618 from mapbox/1ec5-utility
Pull self-less utility methods out of MGLMapView into functions
2015-05-22 09:53:56 -07:00
Minh Nguyễn
0689ad693e Merge pull request #1561 from 1ec5-style-id-1500
mapID → styleID
2015-05-21 15:28:27 -07:00
Minh Nguyễn
7fea85a429 Pulled self-less utility methods out into functions
Also include the name of the requested resource when asserting because one can’t be found.
2015-05-21 15:19:08 -07:00
Minh Nguyễn
a2a63301ec Merge pull request #1615 from mapbox/1ec5-plist-order
Fixed account type setting; reworded IB designable message
2015-05-21 14:12:25 -07:00
Minh Nguyễn
2200c51a33 Removed unavailable method implementation
This class method is marked unavailable in MGLAccountManager.h, so this code can never be reached.
2015-05-21 13:29:46 -07:00
Minh Nguyễn
93f92b7805 Rewrote IB designable message
IB designables inside frameworks have no access whatsoever to the host app’s bundle (especially if the host app lacks any designables of its own). So it has no way of knowing whether the access token is set in Info.plist. We could continue to check whether it was set programmatically, but we’d still have no way of knowing whether the host app has a Settings bundle, the other prerequisite for displaying Mapbox maps. Therefore, this change removes the Mapbox logo from the designable and displays a reworded reminder unconditionally. It now displays the URL of the “First steps with Mapbox GL for iOS” guide. I kept Mapbox blue in the designable, but as a border, so you can easily tell where the view ends (a major usability problem for custom views in IB).
2015-05-21 10:10:35 -07:00
Minh Nguyễn
e74997e2c1 Clarified IB designable message
Access tokens are only required for showing Mapbox-hosted maps.
2015-05-21 08:53:40 -07:00
Minh Nguyễn
a91b1d73e2 Merge pull request #1611 from friedbunny/1519-actionsheet-metrics-squash
[squash] Add action sheet shortcut to Settings.app metrics opt-out
2015-05-21 01:55:17 -07:00
Minh Nguyễn
70381d2705 Fixed up various Info.plist edge cases
Need to look in the main bundle for Info.plist settings, because the developer has no access to the framework’s Info.plist. Need to check MGLMapboxMetricsEnabledSettingShownInApp before MGLMapboxAccessToken; otherwise, `MGLMapboxEvents` inspects the Settings bundle plist before MGLMapboxMetricsEnabledSettingShownInApp is even checked.
2015-05-21 01:49:53 -07:00
Jason Wray
911a8ffc60 Add action sheet shortcut to Settings.app metrics opt-out
Only applicable to iOS 8+. Checks if metrics setting has been declared to be offered in app, if not: adds ℹ️ action to open the app's Settings.app section.

Fixes #1519. Squash of #1529.
2015-05-21 00:12:49 -07:00
Minh Nguyễn
256b748458 Merge branch '1ec5-plist-1535' 2015-05-20 14:38:36 -07:00
Brad Leege
8f8631963b Merge pull request #1603 from mapbox/1595-internal-billing
Counting App Users For Billing
2015-05-20 15:56:18 -05:00
Brad Leege
a47438d42a #1595 - Changing to strongSelf 2015-05-20 15:12:48 -05:00
Brad Leege
cbcc3a3e49 #1595 - Separating pushTurnstileEvent from primary pushEvent infrastructure. Adding event, created, and appBundleId to posted Turnstile Event data model. 2015-05-20 15:05:56 -05:00
Brad Leege
a29587726c #1595 - Moving MGLEventTypeAppUserTurnstile event to end of MGLMapboxEvents init method to ensure it only gets called once 2015-05-20 14:32:16 -05:00
Brad Leege
44caf2c7a9 #1595 - Improving stability by moving MGLEventTypeAppUserTurnstile after the strongSelf check 2015-05-20 14:18:39 -05:00
Minh Nguyễn
90a50c0c41 Observe access token changes
The singleton `MGLAccountManager` wants to be the sole arbiter of the access token, but each instance of `mbgl::Map` (`mbgl::DefaultFileSource` in #1607) has its own copy of the access token. Now `MGLMapView` observes for changes to the `MGLAccountManager`’s access token and synchronizes `mbgl::Map` with it.
2015-05-20 11:49:59 -07:00
Minh Nguyễn
a081f1af5b Removed redundant declaration 2015-05-20 10:47:42 -07:00
Minh Nguyễn
9a57464f82 Removed accessToken from MGLMapView public API
With helpful instructions for migrating to Info.plist or the `MGLAccountManager` API.
2015-05-20 10:45:26 -07:00
Brad Leege
a5bd2fa3c6 #1595 - Adding exception so that Turnstile event will always be sent in 2015-05-20 12:31:20 -05:00
Brad Leege
58b967605a Implementing suggestions to tighten up MGLAccountManager and rename MGLEventTypeUserCount to MGLEventTypeAppUserTurnstile 2015-05-20 11:32:57 -05:00
Brad Leege
f3d7212137 #1595 - Adding App User count event to be triggered and immediately sent when Access Token is set. 2015-05-19 17:02:54 -05:00
Minh Nguyễn
d474f35371 Check account type before comparing hostname 2015-05-19 14:33:19 -07:00
Minh Nguyễn
52670f0560 Cache account type user default 2015-05-19 14:31:30 -07:00
Minh Nguyễn
90b70180c5 Compare hostname for adding events=true
ref #1596, #1599
2015-05-19 13:44:29 -07:00