Commit Graph

172 Commits

Author SHA1 Message Date
Justin R. Miller
5ab58deb44 Cocoa custom marker imagery API 2015-07-08 19:46:03 +02:00
Minh Nguyễn
1d11624efd Test fit to bounds; added MGLCoordinateBounds functions
Added a bunch of functions to work with MGLCoordinateBounds in a separate header analogous to MKGeometry.h. Added resolution-independent tests for common fit to bounds scenarios.
2015-06-25 21:54:57 -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
256b748458 Merge branch '1ec5-plist-1535' 2015-05-20 14:38:36 -07: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
2c7d0567fa Privatized MGLMapboxEvents
`-pauseMetricsCollection` and `-resumeMetricsCollection` were originally introduced to mitigate concerns around battery usage, but `MGLMapboxEvents` has since evolved to tread much lighter on the battery. There’s no longer any need for the client to call these methods directly. The iOS test project now includes MGLMapboxEvents.h explicitly to avoid having to package a header that will go unused.
2015-05-18 11:55:54 -07:00
Minh Nguyễn
563fed5ca9 Properly fail to load the map
A typo in a selector literal meant that `-[MGLMapViewDelegate mapViewDidFailLoadingMap:withError:]` would never be sent to delegates even if `MGLMapView` had called it. Along for the ride, create a proper `NSError` to pass into that callback, and an error domain for that error.
2015-05-16 20:26:28 -07:00
Mike Morris
a65c90fdcb compile OS X with --std=c++1y
because Travis uses Apple LLVM 6.0 and full c++14 support landed in 6.1
2015-05-12 20:43:01 -07:00
Minh Nguyễn
2f02a6538e Folded MGLMetricsLocationManager into MGLMapboxEvents
`MGLMetricsLocationManager` was nothing but overhead for `CLLocationManager`. Also removed an unused method.
2015-05-12 01:36:56 -07:00
Minh Nguyễn
f860169f35 Refactored MGLMapboxEvents for better data management
The shared `MGLMapboxEvents` now owns the only instance of `MGLMetricsLocationManager`. It also owns a `MGLMapboxEventsData` object, to which all user-specific data has been relegated. This object can be built up and torn down on the fly, whenever the opt-out preference is toggled. `MGLMapboxEvents` has also given up knowledge of the access token and now queries `MGLAccountManager` for that information, which `MGLMapView` keeps up-to-date.
2015-05-12 01:36:56 -07:00
Konstantin Käfer
c298ac9d3a on OS X, styles for the linux test app weren't bundled correctly 2015-05-07 10:51:29 +02:00
Brad Leege
acd27fc386 Merge pull request #1329 from mapbox/1225-start-token
MapboxGL Startup Infrastructure
2015-05-05 13:00:25 -05:00
Konstantin Käfer
24083c582c [iOS] add benchmarking application 2015-05-05 11:53:20 +02:00
Brad Leege
4ce4e979ff Updating from master 2015-05-04 17:04:46 -05:00
Brad Leege
0e36bf1c8d #1225 - Restoring MapboxGL.h as an Umbrella header file by splitting the singleton code into MGLAccountManager.h and .m 2015-05-04 16:13:18 -05:00
John Firebaugh
e476fcbf3b C++14 2015-05-04 12:01:15 -07:00
John Firebaugh
2b0892aaaa Build with gcc 4.9 2015-05-04 11:59:39 -07:00
Konstantin Käfer
27d8e82e1c lower thread priority of worker threads 2015-05-04 17:33:05 +02:00
Justin R. Miller
c69e985fa5 fixes #1102: implement reference-counted shared file cache vendor 2015-04-30 17:52:42 -04:00
Minh Nguyễn
c935acc52d Typo 2015-04-30 12:48:36 -04:00
Minh Nguyễn
87c61657a1 Objective-C niceties
Added macro for main thread assertions based on `NSAssert()`. Reworded Boolean property per Objective-C conventions.
2015-04-30 11:35:52 -04:00
Justin R. Miller
42b59eb655 fixes #1363: centrally & better address GL demo/third-party resource bundle issues 2015-04-28 15:03:35 -04:00
Konstantin Käfer
473aa281c7 make meta-target for all iOS targets too and split up project.gyp
this will make it easier to add more targets to iOS builds in the future. It'll also help by having Xcode files named after the platform they're for, so it's easier to distinguish windows
2015-04-28 16:16:09 +02:00
Konstantin Käfer
0d5568f724 merge build targets so we only have one build file per platform
previously, we used multiple different projects for various targets (app, test, render) that overwrote each other, so it was impossible to have one project to build them all, one project to compile them, one project to run them all and in the darkness bind them
2015-04-24 11:50:50 +02:00
Brad Leege
578d48b303 #1225 - Initial setup of MapboxGL as a singleton object with access token 2015-04-22 17:19:59 -05:00
Konstantin Käfer
7e7f7b8273 copy the styles to the correct location for iOS builds 2015-04-21 15:11:45 +02:00
Dane Springmeyer
7b080e8fc3 fix style copying for linux app on osx - refs #511 / e69beba4d1 2015-04-20 11:34:22 +02:00
John Firebaugh
7000a4faf0 Merge pull request #1250 from mapbox/1250-separate-thread-object
Separate objects from Thread management
2015-04-16 08:50:24 -07:00
Mike Morris
2fd22b8742 define MACOSX_DEPLOYMENT_TARGET in common.gypi
Needed in target_defaults to prevent node-gyp from overriding this everywhere with '10.5' from https://github.com/joyent/node/blob/master/common.gypi
2015-04-13 19:33:16 +02:00
Konstantin Käfer
452d12e6e6 make implementation files private headers 2015-04-13 18:28:18 +02:00
Konstantin Käfer
00e9cd9e9d OS X needs -framework Foundation for CURL tests 2015-04-10 22:39:53 +02:00
Minh Nguyễn
836de8bc1c Made lat/lon/zoom inspectable
Declared these IB-specific inspectables in a separate category that developers are not expected to import. Currently these inspectables are order-dependent due to #1181.

Ref #929
2015-04-03 12:34:36 -07:00
Minh Nguyễn
da13225a81 Made MGLMapView designable in IB
When an access token is set in the Attributes inspector (or as a user-defined runtime attribute), we draw some lovely Mapbox branding so the view shows up. (Manipulating invisible rectangles is a frustrating exercise, I’m told.) In the absence of an access token, the view displays a helpful message with directions for obtaining and setting the access token.

Along the way, completely opt out of `MGLMapboxEvents` when targeting Interface Builder, because touching Core Location throws an exception in that environment and it doesn’t make sense to record any metrics when designing on the Interface Builder canvas. Also, don’t start `mbgl::Map` at all (and don’t update it) because none of the runtime drawing code should ever be run in the designable. Normally these chunks of code would be excluded in IB using the TARGET_INTERFACE_BUILDER preprocessor macro. However, Mapbox GL is being packaged as a static library, so the macro is only evaluated when the library is prebuilt, even if the library eventually makes its way into the CocoaPods-generated framework. Instead, we detect that we’re being run by the IBDesignablesAgentCocoaTouch process.

Overrode `-[MGLMapView initWithFrame:]` to call `-commonInit`. We’ve marked this initializer unavailable in the header, but IB still calls it regardless.

Fixes #929.
2015-04-03 12:16:00 -07:00
Minh Nguyễn
6a1e7d5707 Fixed race condition after setting access token
`Map` should be able to deal with having no access token or JSON even while it’s running. Most of `Map` accounts for this situation, but `reloadStyle()` incorrectly assumes that one or the other is set. This change corrects the assumption in `reloadStyle()`.

Also expose the access token and style name to clients as ordinary KVO-compliant properties. Actually, they’re not so ordinary because they’re inspectable!

Ref #1070, #1147
2015-04-03 12:07:53 -07:00
Minh Nguyễn
f7a598139f Fixed test breakage from 501f9701cd
Unlike iOS, OS X does not consider OpenGL.framework to be a standard library, so LINK_WITH_STANDARD_LIBRARIES does not pull it in.

Ref #1099, #1105
2015-03-27 15:44:06 -07:00
Minh Nguyễn
32aa865f14 Merge branch 'ios-unused'
Left in MGLTypes.h, which is now a platform-neutral (iOS + OS X) place for MGLUserTrackingMode.
2015-03-26 15:12:15 -07:00
Minh Nguyễn
501f9701cd Merge pull request #1105 from mapbox/1099-gyp-deps
Enable modules in iOS demo app
2015-03-26 10:35:34 -07:00
Justin R. Miller
f3058dbc9a closes #1082, refs #756: user dot on map in iOS 2015-03-25 17:48:22 -07:00
Minh Nguyễn
de9255f002 Enabled modules in iOS demo app
No longer need to explicitly link system frameworks like UIKit.
2015-03-25 15:07:35 -07:00
Justin R. Miller
10a30daed6 refs #894, fixes #1074: callout views for iOS 2015-03-24 18:43:24 -07:00
Brad Leege
044d1fc3c2 Merge branch 'master' of github.com:mapbox/mapbox-gl-native into 1033-metrics
Conflicts:
	gyp/platform-ios.gypi
	platform/ios/MGLMapView.mm
	styles
2015-03-23 10:52:27 -05:00
Justin R. Miller
0e2d6c8277 fixes #1053: umbrella Cocoa header 2015-03-22 12:25:10 -07:00
Justin R. Miller
ecb8e2800d Cocoa annotations API 2015-03-22 00:53:36 -07:00
Brad Leege
8a73f2186a #1033 - Adding CoreTelephony dependency and fixing access token setting method name. 2015-03-20 16:37:49 -05:00
Brad Leege
ec304d37ac #1033 - Integrating MapboxEvents class. 2015-03-20 16:01:52 -05:00
Brad Leege
253643f57d #1033 - Renaming MBLocationManager to MGLMetricsLocationManager to better comply with naming scheme. 2015-03-20 11:37:50 -05:00
Brad Leege
c42e83fcc6 #1033 - Moving MBLocationManager to Core GL from app specific instance. 2015-03-20 11:11:06 -05:00
John Firebaugh
645d1f3857 Delete unused code
This code appears to be unused and has not been kept in sync with style
spec changes.
2015-03-19 14:45:59 -07:00
Konstantin Käfer
48c55af5c1 fix sprites for pixel ratios that are not 1 and 2
- OpenGL ES 2 doesn't allow NPOT textures with wrap-around
- The Sprite object reported the map's pixelRatio, even though it loaded @2x assets
- Copying icons from the sprite into the atlas now uses bilinear scaling to scale up to the actual size
2015-03-17 12:30:40 +01:00
Konstantin Käfer
5e40f72b7c scripts for running linux tests with docker 2015-03-13 12:06:11 +01:00