Commit Graph

1240 Commits

Author SHA1 Message Date
Ansis Brammanis
750c72f324 improve gestures in perspective view
The location under your finger stays under your finger as you pan.
The location you double tap to zoom stays at the same point.
The location at the center of a pinch zoom stays at the center.
The location at the center of a rotation stays at the center.
2015-10-26 12:48:03 -07:00
Konstantin Käfer
c0c554e36f [core] reparse tiles when new data arrives
We're now reparsing tiles when they expire. We're also swapping out buckets atomically to avoid flickering data; i.e. we're displaying the old data as long as we don't have a new parsed bucket for that layer yet. The parsed buckets now live in the *TileData objects rather than in the TileWorker; only partially parsed == pending buckets will remain in the TileWorker. Once they're parsed, they're moved to the *TileData object.
2015-10-26 15:54:27 +01:00
Konstantin Käfer
5173bf1bb8 [core] Make response data shared to avoid excessive copying 2015-10-26 15:54:27 +01:00
Konstantin Käfer
4e3503ea6c [core] do not use std::atomic_* with shared_ptrs
It's not implemented in GCC 4.9.2's stdlib (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57250). Instead, we're now always using a mutex to protect access; we previously created a mutex only on cancelation, but since we're always canceling now, it makes sense to allocate it right away.
2015-10-26 15:54:27 +01:00
Konstantin Käfer
6a7334b882 [core] add support for stale responses
We're now returning stale responses from cache. Those responses will have the `stale` flag set to true. Currently, all requesters in the core code discard stale responses, and cancel the request immediately after they got a non-stale response.
2015-10-26 15:54:27 +01:00
Minh Nguyễn
1e9cf71b5a IB inspectable for allowing tilt 2015-10-23 10:09:27 -07:00
Bruno de Oliveira Abinader
54858dae8c [core] Added save/restore capabilities to GL config 2015-10-22 16:02:39 -07:00
Bruno de Oliveira Abinader
5fa144647d [core] Added GLContextMode to MapData
Adding new mbgl::GLContextMode enum to mbgl::Map ctor, which gets stored
in MapData. In shared GL context environments, we cannot assume that the
GL state that has been left since the last draw is the same, so we reset
the GL configurations to their default values.
2015-10-22 16:02:39 -07:00
John Firebaugh
c46a8254c4 [core] Style-sourced shape annotation properties
This introduces the possibility to source the type and style properties
of a shape annotation from a designated layer in the style.
2015-10-22 15:27:53 -07:00
Minh Nguyễn
4f509288b7 [iOS] Removed long-unavailable APIs 2015-10-22 14:27:58 -07:00
Minh Nguyễn
e3934df8d4 [iOS] Replaced styleID property with styleURL__ inspectable
The new styleURL__ inspectable property is carefully named to masquerade as a URL property in Interface Builder, even though IB supports no such thing.

If the user enters an invalid URL into the “Style URL” inspectable, throw an error instead of silently setting the style to the default. This check is not required in -setStyleURL:, which takes a real NSURL.
2015-10-22 14:27:39 -07:00
John Firebaugh
3afc8b4a29 [core] Introduce StyleLayer subclasses 2015-10-22 09:34:40 -07:00
John Firebaugh
df89de5cc5 [core] Rationalize style property classes: <type>{Paint,Layout}Properties 2015-10-22 09:21:30 -07:00
Manabu-GT
84c8d1fd6e add setSetVisibleCoordinateBounds api as already in iOS 2015-10-22 19:58:52 +09:00
Leith Bade
927b4c6dbe [android] Refactor annotations API
Remove unimplemented properties.
Correct defintions of equals() and hasCode().
Add setOnInfoWindowClickListener and remove old method from Marker.
Refactor showInfoWindow() to remove need for exposing internal method.
Make select/deselectMarker public. Add getSelectedMarker.
Fix bug where you couldn't reselect a closed info window.
Add empty constructor to LatLng and LatLngZoom.
Fixes #2546
Fixes #2631
Fixes #2448
2015-10-22 20:00:43 +11:00
Leith Bade
8b79a8d6e6 [android] Implement UserLocationView
Draws animated and synced GPS marker.
Inlcudes direction arrow and accuracy ring.
Fade out the compass after a delay when reset to north.
Lots of other performance and memory improvements.
add OnMyLocationChangeListener
Move FAB with snackbar
Fix getMetersPerPixelAtLatitude
Fix some incorrect annotations
Fixes #2668
Fixes #2411
Fixes #2678
Fixes #2675
Fixes #2566
Fixes #2549
Fixes #2692
Fixes #2572
2015-10-22 17:07:10 +11:00
Leith Bade
2daa5f14a8 [android] Fix bug in setSprite when calculating pixel data size
Change Marker sprite() to icon() and use Sprite class
Load a Maki dog icon in test app
Fixes #2506
2015-10-22 16:18:13 +11:00
Bruno de Oliveira Abinader
5db4670d78 [core] Added more transform state getters
Some platforms requires specific information that was previously not
available in public API, but stored internally in TransformState object.
2015-10-21 11:06:51 -07:00
John Firebaugh
c5b95032a5 [core] Annotation refactor 2015-10-20 13:54:19 -07:00
John Firebaugh
597b2b4851 [core] Pull annotation typedefs to own header; add AnnotationID 2015-10-20 13:54:19 -07:00
Justin R. Miller
24aa375cd1 [ios] tweaks to match code style for 1a5c452 callout tap handler 2015-10-12 11:02:04 -07:00
Maciej Swic
1a5c452fe3 Forwards the SMCalloutView tap delegate 2015-10-12 10:54:53 -07:00
Adam Hunter
1179096dd8 VAO and extension tracking code. 2015-10-06 13:54:36 -07:00
Leith Bade
b869771992 Correctly handle spurious wake-ups in Map::pause()
Fixes #2522
2015-10-06 14:10:32 +11:00
Jason Wray
b406c942df [ios] update MGLMapView inline docs for v8 styles
Fixes #2503
2015-10-02 19:43:04 -04:00
Jason Wray
29da7bb26d [ios] describe radians↔degrees functions 2015-10-02 18:54:53 -04:00
Jason Wray
e565808de0 [ios] fix unintentional omission of delegate sections & methods from docs
Adds these delegate methods that were missing:
  - `mapView:annotation:calloutAccessoryControlTapped:`
  - `mapView:didSelectAnnotation:`
  - `mapView:didDeselectAnnotation:`

Adds these section headers that were missing:
  - Responding to Map Position Changes
  - Managing Annotations
  - Selecting Annotations

Also reorders the sections by priority and grouping.

Fixes #2514
2015-10-02 18:48:26 -04:00
Justin R. Miller
8cc3b12f1e [ios] fixes #2490: add annotation image enabled property 2015-10-02 11:50:53 -07:00
Justin R. Miller
7087a4c55a [ios] fixes #2491: document MGLAnnotationImage 2015-10-01 16:20:05 -07:00
Mike Morris
b46c102eb0 mason variant@1.0 2015-09-30 15:34:40 -07:00
bsudekum
7112d43609 [node] Handle tiles which 404 better 2015-09-29 18:20:22 -07:00
Adam Hunter
3f9f259619 Added GL logging utility 2015-09-29 15:07:39 -07:00
John Firebaugh
af392b9434 Rewrite annotation invalidation strategy
First, move style mutation code out of StyleParser and into AnnotationManager,
coalescing it with the mutation code for shape layers.

Second, allow AnnotationManager to keep track of stale tiles entirely
internally. There's no reason to pass sets of TileIDs around.

Third, correct the logic for invalidating the shape source. Since
AnnotationManager does not track shape invalidations on a tile-by-tile basis,
don't try to invalidate the shape source tile-by-tile.

Fixes #1675
Fixes #2322
Fixes #2095
2015-09-28 14:10:23 -07:00
Leith Bade
85ec3eb0a5 Refactor Android render loop to limit frame rate to 60 FPS
Move expensive cache size calulation to initialisation
Fix setGestureInProgress bug
Renamed several functions to match current usage
Refactor map updates to reduce GPS marker lag
Fixes #1676
Fixes #2290
Fixes #2396
2015-09-24 18:04:26 +10:00
Leith Bade
2c4a9f6a3b Refactor NativeMapView to hold std::unique_ptr to Map and DefaultFileSource
Add missing asserts to attach_jni_thread/detach_jni_thread
Fixes #2406
2015-09-24 12:22:19 +10:00
Leith Bade
8cf927f6c4 Improve handling of cancelled HTTP requests
Fix a memory leak of NativeMapView Java object
2015-09-23 11:57:41 +10:00
Leith Bade
feae692dba Fix freezing on Android when rotating
Fixes #1941
2015-09-22 16:23:39 +10:00
Eric Horacek
50ad8ac54d Remove implicit conversion from double → float
Occurs when targeting a 32-bit architecture
2015-09-19 12:44:41 -07:00
Leith Bade
529a7cc93c Create SharedSQLiteCache 2015-09-16 12:45:46 +10:00
Jason Wray
d9c7fdc565 [iOS] Fix MGLPolyline documentation typo 2015-09-11 16:34:10 -04:00
Jason Wray
c34d62aca2 [iOS] Move radians/degrees conversion functions to MGLGeometry.h 2015-09-11 11:36:32 -07:00
Minh Nguyễn
0a172a21fd CameraOptions
Plumbed camera options all the way through to MGLMapView. Added a method that lets you specify a direction in addition to center point and zoom level.

Added Map::jumpTo() for parity with mapbox-gl-js. Replaced usage of Map::setLatLng() and Map::setLatLngZoom() with Map::jumpTo() or Map::easeTo() within MGLMapView. Replaced MGLMapView.pitch with MGLMapCamera for setting all supported degrees of freedom simultaneously. Simultaneously move and rotate with course.

Support customizable timing functions on iOS.

iosapp now persists an archived MGLMapCamera instead of separate viewpoint properties and also synchronizes user defaults on termination. This change implements persistence entirely in Objective-C, eliminating the use of the Objective-C++ implementation.

Fixes #1643, fixes #1834. Ref #1581.
2015-09-07 09:22:52 -07:00
Justin R. Miller
163022f9a3 fix missing docs parameter 2015-09-04 09:16:26 -07:00
Justin R. Miller
790e8a345c refs #2039: add passthroughs for adding/removing overlays 2015-09-04 09:16:26 -07:00
Bruno de Oliveira Abinader
0ff7cf20e9 Get rid of MapData::{get,set}NeedsRepaint 2015-09-02 23:20:47 +03:00
Bruno de Oliveira Abinader
0b501e0566 Substitute nudgeTransitions with async view invalidation 2015-09-02 23:20:46 +03:00
John Firebaugh
abc1c84fb8 Merge branch 'master' into node 2015-08-31 16:45:21 -07:00
Justin R. Miller
bcfce808ca implement annotation marker tap recognition in Android 2015-08-28 15:29:04 -07:00
Jason Wray
42dc5336db iOS perspective gesture support
Drag two fingers upward to tilt the map.

Implements #2116
2015-08-26 11:23:03 -07:00
Mike Morris
4540c3c0e8 View::swap -> View::beforeRender View::afterRender
To be able to resize the framebuffer on the map thread
in HeadlessView.
2015-08-25 14:39:49 -04:00