From 20a5ef64e1d158ef77ecdeabb2275c7284bd6c1a Mon Sep 17 00:00:00 2001 From: Tobrun Date: Wed, 5 Jul 2017 23:06:26 +0200 Subject: [PATCH] Merge release-ios-v3.6.0-android-v5.1.0 (#9416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [android] Update release script to support CircleCI builds (#8950) * update release script to trigger builds on circleci now * update release script to trigger builds on circleci now * [core] When a layer is added, reload its source's tiles * [android] - keep observer when timeout occurs, make observer param nullable, fixup log messages (#8919) * [android] - avoid crashing when deleting already deleted region (#8920) * [android] - update LOST to 2.3.0 (#8872) * [android] - update proguard config, allow debug mimification, update OkHttp to latest version (#8944) * [core, android, ios, macos, qt] v10 default styles Upgraded from v9 default styles to v10 wherever the developer expects to get the latest and greatest, as well as in a couple tests where it may be beneficial to ensure that we can handle a two-digit version number in the style URL. Cherry-picked from ed54849e9909e7f7cd8724b39b2bc94f16cf9a11. * [ios, macos] Updated documented default style version MGLStyleDefaultVersion is just for Streets now. Deleted style version documentation tests because not all styles are on the same version. Cherry-picked from ca97dd8cf4c70a5ed380c99700749fd3239715f0. * [ios, macos] Undeprecated unversioned style URL factory methods Undeprecated the unversioned style URL factory methods in MGLStyle for consistency with the Android and Qt SDKs. Added warnings about using them with the runtime styling API. Refactored mbgl::util::default_styles to track different versions for different styles. Cherry-picked from 9e384b78fbcf46d66d390122eefdf273f91b314e. * [core, android, ios, macos] Added Traffic Day/Night to default styles The Styles API section of the Mapbox API Documentation site now lists Traffic Day v2 and Traffic Night v2, so this change adds those styles to all the places where styles are listed. Also switched iosapp and macosapp to unversioned style factory methods since MGLStyleDefaultVersion is no longer applicable for all styles. Cherry-picked from 4d6f54553d277c0af24a0b8ff03d2dd7e9284ca2. * [android] Release android-v5.1.0-beta.2 (#8976) * [android] url getter on sources * [android] fix ui test filter in makefile * [android] - build SNAPSHOT from release branch (#8958) * [android] - update changelog for 5.1.0-beta.2 * [android] - bump version number * [android] - Camera change listener v2.0 * [core] allow filesource url transform reset * [android] Update attribution wordmark (#8774) * Update wordmark on android * Moved attribution i icon to the right of mapbox word (in mapview preview image) * update padding and margin * [android] update hardcoded branch name * revert version to 5.1.0-SNAPSHOT * [android] - MarkerView deselect events with OnMarkerViewClickListener integration (#8996) * [android] - publish SNAPSHOT from release 5.1.0 branch (#8995) * [ios, macos] edited identity interpolation mode documentation (#8657) * [ios, macos] Factored out tile URL template guide Factored out redundant tile URL template documentation from the MGLRasterSource and MGLVectorSource documentation into a jazzy guide. This documentation used to live in one place, on a method on MGLTileSource, but that method had to be moved to MGLTileSource’s concrete subclasses. A jazzy guide is easier to link to, in any case. * [ios] Telemetry button in modal view controllers (#9027) Fixes #8980. * [android] - bump tools and support lib version due to SNAPSHOT dependencies (#9046) * [android] - bump tools and support lib version for SNAPSHOT dependencies * revert unsupported Circle CI build tools version * [core] Make destructor virtual to avoid object splicing during destruction * [core] add error for non-virtual destructor deletes + add virtual dtors * [android] - remove marker from selected markers when removing marker from annotation manager. (#9047) * Observe layout guides (#7716) * [ios] observe layout guides * [ios] update changelog * [ios, macos] Change == to = in style function initializers * [ios] Add annotation view initializer with annotation and reuse id (#9029) * [ios] Remove annotation view from container view when annotation removed (#9025) The annotation container view keeps an array of annotation views that is separate from the array of subviews that is a property of the UIView parent class. This removes an annotation view from that container view array when the associated annotation is removed. This avoids issue related to previously removed annotation views continuing to be involved in map view logic around annotation view selection due to taps. * [android] - correct bearing conversion when animating the map with jumpTo, easeTo and animateTo. (#9050) * [ios, macos] Updated `maximumZoomLevel` description, cherry-picked #8818 (#8842) Cherry-picked from a3e4e67ea68c455178d5c5ef3d864972fcf41147. * [ios] Updated podspecs and changelog for v3.5.3 (#8870) Cherry-picked from 25c19902a22e240da4e7ebf1974125b7e67bd21e. * [ios] Update podspecs and changelog for iOS v3.5.4 Cherry-picked from db7bb509e95d737199efa73a47bdcc973966ed97. * [ios, macos] Updated changelogs * [ios, macos] changed TRUE -> 'true' (#9059) fixes #9056 * [ios, macos] Light property implementation in MGLStyle (#9043) * [ios, macos] Add MGLLight to MGLStyle * [ios, macos] Implement Objc bindings for Light object * [ios, macos] Remove rawLight from MGLLight and re-implement it as value class * [ios, macos] Fix build on macos * [ios, macos] Add MGLLight documentation, Move MGLLightPosition to MGLLight * [ios, macos] Add MGLLight tests. * [ios, macos] Update changelogs * [ios, macos] Fix misspelling * [ios, macos] Fix MGLLightAnchor enum property names * [ios, macos] Update documentation. Improve varialble naming. * [ios, macos] Rename MGLLightPosition to MGLSphericalPosition * [ios, macos] Update data types of MGLSphericalPosition * [android] - horizontally rotated in snapshot (#9083) * Cherry-pick arabic text to release branch v3.6.0 (#9071) * [core] Throttle tiles to redo symbol placement at most once every 300ms. Fixes issue #8435 and prepares for pitch-scaling changes in issue #8967. * [core] Disable letter-spacing for Arabic labels (issue #9057) * [ios,macos] multipolygon coordinate (#8713) * [ios] MGLMultiPolygon's coordinate property implemented * [ios,macos] Add polylabalel to project config * [ios,macos] Change coordinate property for MGLPolyline,MGLPolygon,MGLMultiPolygon * [macos] Change project configuration to support polilabel * [ios,macos] Add MGLLocationCoordinate2DFromPoint * [ios, macos] Update changelogs * [ios, macos] remove unnecesary variables * [ios, macos] Add radians conversions * [ios, macos] Add coordinate calc to MGLPolyline * [ios, macos] Move radian fuctions to MGLGeometry_Private.h * [ios, macos] Fix code style * [ios, macos] Fix code indentation * [ios, macos] Fix radian per meters constant * [ios, macos] Add test scenarios to testPolyline * [ios, macos] Fix test accuracy * [ios, macos] More robust Streets localization Added Arabic, Portuguese, and Simplified Chinese to the list of languages with specialized fields in the Mapbox Streets source. Rely on NSBundle to select the most appropriate locale based on the user’s preferred languages. * [ios] Fallback to Mapbox.bundle as the framework bundle (#9074) Fixes an issue where localizations could not be found when using static builds. Throws exception if our bundle can't be found. * [ios] Move image resources to an asset catalog & switch to PDFs * [ios, macos] Updated changelogs Reorganized the changelogs with a new packaging section. Added blurbs about #9062, #8713, #9060, and #9031. * [ios] Update pods spec for iOS v3.6.0-beta.1 * [macos] Enable View ‣ Traffic Night Enable the View ‣ Traffic Night menu item and check it when that style is active. * [android] - stop location updates when toggle MyLocationView state (#9099) * [android] - LatLngBounds bearing default value (#9102) * [ios, macos] Fix MGLLight.achor to accept style functions * [ios] Fix annotation initializers for subclasses of MGLAnnotationView (#9104) Use a common init function in both of the provided initializers so that subclasses of `MGLAnnotationView` written in Swift don't need to override `init(annotation, reuseIdentifier)` * [ios] Moved `MGLLight` in jazzy table of contents (#9111) * [android] - logo placement for creating a Mapview programatically (#9094) * [android] - Correct logo placement for creating a Mapview programatically, fixup non default placements * Fixed NIGHTY_TWO_DP typo to NINETY_TWO_DP * [android] - add binding support for Light (#9013) * [android] Update Lost to final version 3.0.0 (#9112) * update lost to final version 3.0.0 * bump MAS version to 2.1.1 * [android] - convert dp to pixels when getting meters per pixel at. (#9048) * Release Android v5.1.0-beta.3 (#9115) * [android] - Changelog update for Android release v5.1.0-beta.3 * update CI & version * reset release properties * [android] - harden orientation changes (#9128) * [ios] Remove filter of single metric event * [ios] remove layout guide observers * Migrate to GL JS–powered feedback form (#9078) * [ios, macos] Updated feedback URL * [ios, macos] Add referrer, heading, pitch to feedback URL * [ios, macos] Updated changelogs for feedback changes * [ios] Vary referrer by platform * [android] - javadoc update for 5.1.0 release (#9138) * [android] - javadoc update for 5.1.0 release * oxford comma * Grammar/spelling tweaks * grammar tweak * grammar tweak * Grammar tweaks * Grammar tweaks * [android] fix missing access token variable issue (#9151) * [ios] Update pods spec for iOS v3.6.0-beta.2 * [android] Cherry picking 9133 (#9145) * [android] Fix tracking mode + camera race condition (#9133) * [android] fix tracking mode + camera race condition * fix resetTrackingModesIfRequired bug (comparing current camera position with target camera position * cherry pick #9133 and update CHANGELOG * add null check to prevent null pointer exception * add null check in custom location engine activity to prevent null pointer exception (#9159) * [core] Make TransformState LatLngBounds optional * [ios] Make annotation view rotation alignment configurable (#9147) This commit adds `rotatesWithMap` property on `MGLAnnotationView`. This property, when set to `YES` fixes the annotation to a map such that view follows map's rotation angle. This is useful when user wants to display rotation-dependent annotations (e.g. sector lights). * [android] - validate if gestures should execute (#9173) * [android] - only invoke callback if fling scrolling animation isn't going to be ignored. (#9192) * [android] - dealing with infinite camera move callbacks (#9177) (#9194) * [android] - keep location tracking mode after screen rotation (#9187) * [android] - keep location tracking mode after screen rotation (#9186) * [android] - using easeCamera to keep location tracking instead of overloaded moveCamera (#9187) * [android] - checkstyle fix up * fix #8300 flyTo for close points The isClose threshold is switched from 0.000001 pixels to 1 pixel. As a backup, it checks whether r0 and r1 are finite. It might be possible to have just the threshold check or just the finiteness check, but I don't see the harm in having both. std::abs(w0 - w1) < 0.000001 is removed because it doesn't look like it's needed. All calculations should run fine even if w0 === w1. Finally, the point interpolation is tweaked so that at the end of the flying (when k === 1) it ends up at the exact end point. I didn't see any bugs related to this, but it seems like a good thing to have explicitly. * [android] - remove conversion from pixels to dp (#9205) * [android] - option to disable camera animation while following position (#9210) * [android] - invalidating MyLocationView bearing when not following position (#9212) * Custom location source fix (#9142) * [android] - custom location engine fixes (#9139) * Update to latest LOST dependency, fixup internal location source integration * [android] - update components with camera values when animating (#9174) * Cherry picks to release branch (#9230) * [ios][macos] test remove source in use * [android] test remove source in use * [core] check source usage before remove * [core] ensure layer::accept works with non-void return values on gcc * [android] - remove upgrade runtime exceptions (#9191) * [android] - update changelog for v5.1.0-beta.4 (#9232) * [android] - run MapboxMap invocations to ui thread for instrumentation tests (#9198) * [ios, macos] Fix MGLSphericalPosition.radial misleading type. * [android] - correct source changed map event javadoc (#9243) * Cherry pick release (#9263) * [core] - bump earcut version dependency to handle unused lamba warning (#9242) * [android] - snapshot bitmap contains view based content (#9252) * [core] store vertex attribute binding to prevent duplicate binds We have an "oldBinding" value that we use for checking whether the vertex attribute was already bound to the current VAO, but we never set the state. Additionally, we're also checking whether the previous state was already any binding (optional is set), and don't re-enable the vertex attribute array. Additionally, we now only disable the vertex attribute array when the previous state was in fact an array attribute. We still don't deduplicate constant glVertexAttrib* calls, but that's a little trickier. * [core] add shader defines for enabling/disabling attributes/uniforms for DDS * [core] only bind uniforms that exist in the program * [core] add uniforms to DataDrivenPaintPropertys * [core] add constant DDS values as uniforms * [core] Dynamic program compilation for data-driven properties * [core] Reduce number of varyings to 8 or less For #pragmas, don't generate varyings for attributes that aren't used by the fragment shader. Pack other varyings more tightly. * [core] Don't upload the FrameHistory texture in frames where it's not changing * [core] cleanup ProgramParameters * [ios, macos] Revised descriptions for abstract classes (#9095) Addresses https://github.com/mapbox/mapbox-gl-native/issues/8635 * [ios] Remove old Fabric build infrastructure * MGLLight autogenerate scripts (#9260) * [ios, macos] Add the MGLLight generation templates * [ios, macos] Add MGLLight generation script * [ios, macos] Add the auto-generation script for MGLLight.mm * [ios, macos] Add the auto-generation script for MGLLightTest.mm * [core] Add const to Position constructor. * [ios, macos] Simplify MGLLightTest.mm autogenerate script. * [ios] Update pods spec for iOS v3.6.0-beta.3 * [ios, macos] Updated changelogs * [core] Fix composite function approximation for non-integer stops * [ios] Update telemetry cert pinning (#9292) * [core] Trigger repaint on source changes * [android] - update activity test generation with newest classes, make FillExtrusionActivity conform to generated activity test setup. (#9276) * Validate camera position before transforming (#9275) * [android] - add camera position validation before transforming * annotate CameraUpdate with nullability * [android] fix custom marker views anchor issue (#9282) * [android] fix pulse marker view options parcelable creator (#9283) * fix trackball long press timeout calling the main thread method on a background thread (#9305) * [android] Update to LOST 3.0.1 (#9302) * Revisit Javadoc for 5.1.0 (#9266) * [android] - revisit public API javadoc * [android] fix javadoc minor mistakes and typos * grammar tweak * add missing public javadoc * [android] update mapboxServicesVersion to 2.1.2 (#9311) * [android] - update CHANGELOG for release 5.1.0-beta.5 (#9316) * [android] - restore LatLngBounds conversion, add regression test (#9324) * [build] Unbreak Travis * 7910: cancel tracking if ongoing animation is stopped manually (#7916) * 7910: cancel tracking if ongoing animation is stopped manually * 7910 updating change log * [ios] Fix map camera animation when a significant change occurs * [ios] Update cancel tracking documentation. * [ios, macos] Rewrote MGLStyle class documentation The documentation comment now provides a high-level overview of the runtime styling API and its components, as well as the main workflow for using a style. * [ios, macos] Corrected MGLSource subclassing documentation * Boxing ObjC structs (#9343) * [ios, macos] Make structs boxable * [ios, macos] Update changelogs. * [ios] Allow delegate to keep wandering pinch from panning map MGLMapView consults MGLMapViewDelegate about whether to zoom the map in response to a pinch gesture, but it should also account for the delegate’s response when panning the map due to the pinch’s center point wandering. Fixes #9168. * [ios] Added Hungarian localization from Transifex * [ios] Updated German localization * [ios, macos] Updated changelogs Also corrected the version number in the macOS changelog. * [ios] Update pods spec for iOS v3.6.0-rc.1 * [ios] Fixed infinite loop zooming in past z23 At zoom levels where the minimum 1 meter or 4 feet would be wider than the scale bar’s maximum width, the local variable holding the preferred row was left undefined. A loop that later iterated based on this row would effectively iterate infinitely until memory pressure forces the system to quit the application. * [ios, macos] Fix size and color of default marker image * [ios] Minimize tilt gesture delay * [core] Fix iterator invalidation in erase_if vector::erase invalidates iterators. It's not safe for erase_if to cache the end iterator nor increment, then erase. * OnCameraIdle hook into quickzoom gesture (#9339) * [android] - OnCameraIdle hook into quickzoom gesture * double tap fix * show MyLocationView bearing for GPS when Compass is not available, only show error about missing compass once, fix test activity. * fix accessor lint warning * [ios] moved changes to darwin (#9387) * [macos] Reorganized changelog * [macos] Fixed cursor shifting after drag gesture When redisplaying the mouse cursor after a modified drag gesture, incorporate the conversion from view coordinates to window coordinates. Previously, this code performed the conversion but threw away the results. Fixes #8670. * ios] Update pods spec for iOS v3.6.0 * [macos] Updated screenshot The new screenshot features 3D extruded buildings, vertical CJK, and right-to-left Arabic, all via runtime styling. * macos-v0.5.0 * Downgrade location provider dependency (#9394) * [android] - downgrade LOST to Mapbox SDK 5.0.2 version. * bump LOST back to Mapbox Android SDK version 4.x * [android] - bump Mapbox Android Services to latest for 5.1.0 final release (#9402) * [android] - update changelog for 5.1.0 release (#9405) * [core] Fix iterator invalidation in erase_if vector::erase invalidates iterators. It's not safe for erase_if to cache the end iterator nor increment, then erase. * [android] - invible marker views performance fix #9419 (#9420) * [darwin] - re-add swift documentation * [macos] - add Styles header to CHANGELOG.md --- Makefile | 5 - platform/android/CHANGELOG.md | 38 +- .../android/MapboxGLAndroidSDK/build.gradle | 4 +- .../MapboxGLAndroidSDK/gradle.properties | 2 +- .../java/com/mapbox/mapboxsdk/Mapbox.java | 19 +- .../mapboxsdk/annotations/BubbleLayout.java | 106 + .../mapboxsdk/annotations/IconFactory.java | 46 +- .../annotations/MarkerViewManager.java | 43 +- .../mapboxsdk/camera/CameraPosition.java | 60 +- .../mapbox/mapboxsdk/camera/CameraUpdate.java | 10 +- .../mapboxsdk/camera/CameraUpdateFactory.java | 4 +- .../mapboxsdk/constants/MapboxConstants.java | 3 +- .../constants/MyBearingTracking.java | 14 +- .../constants/MyLocationTracking.java | 19 +- .../com/mapbox/mapboxsdk/constants/Style.java | 1 - .../IconBitmapChangedException.java | 6 +- .../InvalidLatLngBoundsException.java | 4 +- .../InvalidMarkerPositionException.java | 3 + .../MapboxConfigurationException.java | 4 + .../exceptions/TooManyIconsException.java | 5 +- .../mapbox/mapboxsdk/geometry/ILatLng.java | 18 +- .../mapboxsdk/geometry/IProjectedMeters.java | 12 + .../com/mapbox/mapboxsdk/geometry/LatLng.java | 116 +- .../mapboxsdk/geometry/LatLngBounds.java | 148 +- .../mapbox/mapboxsdk/geometry/LatLngSpan.java | 46 +- .../mapboxsdk/geometry/ProjectedMeters.java | 45 +- .../mapboxsdk/geometry/VisibleRegion.java | 31 +- .../mapboxsdk/location/LocationSource.java | 73 +- .../maps/CameraChangeDispatcher.java | 8 +- .../mapboxsdk/maps/MapGestureDetector.java | 24 +- .../mapbox/mapboxsdk/maps/MapKeyListener.java | 3 +- .../com/mapbox/mapboxsdk/maps/MapView.java | 32 +- .../com/mapbox/mapboxsdk/maps/MapboxMap.java | 47 +- .../mapboxsdk/maps/MapboxMapOptions.java | 6 +- .../mapboxsdk/maps/TrackingSettings.java | 56 +- .../com/mapbox/mapboxsdk/maps/Transform.java | 33 +- .../com/mapbox/mapboxsdk/maps/UiSettings.java | 10 +- .../maps/widgets/MyLocationView.java | 257 +- .../maps/widgets/MyLocationViewSettings.java | 7 +- .../mapboxsdk/net/ConnectivityReceiver.java | 7 +- .../mapboxsdk/offline/OfflineManager.java | 6 + .../mapboxsdk/offline/OfflineRegion.java | 1 + .../offline/OfflineRegionStatus.java | 60 +- .../mapbox/mapboxsdk/storage/FileSource.java | 19 +- .../mapboxsdk/style/layers/PropertyValue.java | 30 + .../mapbox/mapboxsdk/style/light/Light.java | 22 +- .../mapboxsdk/style/light/Position.java | 4 +- .../mapboxsdk/style/light/light.java.ejs | 2 +- .../mapbox/mapboxsdk/utils/BitmapUtils.java | 16 + .../mapbox/mapboxsdk/utils/ColorUtils.java | 10 +- .../mapboxsdk/utils/MapFragmentUtils.java | 13 + ...ox.mapboxsdk.mapbox-android-sdk.properties | 2 +- .../java/com/mapbox/mapboxsdk/MapboxTest.java | 5 +- .../gradle-checkstyle.gradle | 1 + .../testapp/action/MapboxMapAction.java | 49 + .../testapp/annotations/MarkerTest.java | 111 +- .../testapp/annotations/MarkerViewTest.java | 123 +- .../testapp/annotations/PolygonTest.java | 86 +- .../testapp/annotations/PolylineTest.java | 79 +- .../testapp/camera/CameraAnimateTest.java | 303 +- .../testapp/camera/CameraEaseTest.java | 305 +- .../testapp/camera/CameraMoveTest.java | 304 +- .../testapp/geometry/LatLngBoundsTest.java | 40 + .../testapp/maps/widgets/CompassViewTest.java | 101 +- .../maps/widgets/MyLocationViewTest.java | 4 +- .../testapp/style/BackgroundLayerTest.java | 284 +- .../testapp/style/BaseStyleTest.java | 15 - .../testapp/style/CircleLayerTest.java | 2025 +++--- .../testapp/style/FillExtrusionLayerTest.java | 1035 ++-- .../testapp/style/FillLayerTest.java | 970 +-- .../mapboxsdk/testapp/style/LightTest.java | 122 +- .../testapp/style/LineLayerTest.java | 1840 +++--- .../testapp/style/RasterLayerTest.java | 596 +- .../RuntimeStyleBackgroundLayerTest.java | 61 - .../testapp/style/RuntimeStyleTests.java | 106 +- .../testapp/style/SymbolLayerTest.java | 5510 ++++++++++------- .../mapboxsdk/testapp/style/layer.junit.ejs | 482 +- .../mapboxsdk/testapp/style/light.junit.ejs | 58 +- .../activity/FeatureOverviewActivity.java | 52 +- .../camera/CameraPositionActivity.java | 10 +- .../activity/style/FillExtrusionActivity.java | 9 +- .../userlocation/BaseLocationActivity.java | 46 +- .../CustomLocationEngineActivity.java | 36 +- .../userlocation/MockLocationEngine.java | 125 +- .../MyLocationDrawableActivity.java | 45 +- .../userlocation/MyLocationTintActivity.java | 3 - .../MyLocationToggleActivity.java | 65 +- .../MyLocationTrackingModeActivity.java | 167 +- .../annotations/PulseMarkerViewOptions.java | 12 +- .../layout/activity_my_location_tracking.xml | 2 +- .../main/res/menu/menu_location_engine.xml | 20 + .../src/main/res/values/strings.xml | 3 + platform/android/dependencies.gradle | 4 +- .../android/scripts/generate-style-code.js | 4 +- .../android/scripts/generate-test-code.js | 2 +- .../android/src/geometry/lat_lng_bounds.cpp | 8 +- .../docs/guides/For Style Authors.md.ejs | 2 + .../darwin/scripts/generate-style-code.js | 39 +- .../scripts/style-spec-overrides-v8.json | 6 + platform/darwin/src/MGLForegroundStyleLayer.h | 7 +- platform/darwin/src/MGLGeometry.h | 4 +- platform/darwin/src/MGLLight.h | 120 +- platform/darwin/src/MGLLight.h.ejs | 100 + platform/darwin/src/MGLLight.mm | 41 +- platform/darwin/src/MGLLight.mm.ejs | 114 + platform/darwin/src/MGLMultiPoint.h | 5 +- platform/darwin/src/MGLOfflinePack.h | 2 +- platform/darwin/src/MGLShape.h | 10 +- platform/darwin/src/MGLSource.h | 8 +- platform/darwin/src/MGLStyleLayer.h | 8 +- platform/darwin/src/MGLStyleValue.h | 9 +- platform/darwin/src/MGLTileSource.h | 6 +- platform/darwin/src/MGLTypes.h | 2 +- platform/darwin/src/MGLVectorStyleLayer.h | 9 +- platform/darwin/test/MGLLightTest.mm | 177 +- platform/darwin/test/MGLLightTest.mm.ejs | 92 + platform/default/resources/default_marker.svg | 2 +- platform/ios/CHANGELOG.md | 20 +- platform/ios/DEVELOPING.md | 1 - platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- platform/ios/app/hu.lproj/Localizable.strings | 0 platform/ios/docs/guides/For Style Authors.md | 2 + platform/ios/ios.xcodeproj/project.pbxproj | 41 +- .../default_marker.pdf | Bin 2601 -> 4354 bytes ...t.der => api_mapbox_com-digicert_2016.der} | Bin .../api_mapbox_com-digicert_2017.der | Bin 0 -> 2030 bytes ...t.der => api_mapbox_com-geotrust_2016.der} | Bin .../api_mapbox_com-geotrust_2017.der | Bin 0 -> 1758 bytes .../resources/de.lproj/Localizable.strings | 18 + .../resources/hu.lproj/Localizable.strings | 93 + platform/ios/scripts/deploy-packages.sh | 1 - platform/ios/scripts/release-fabric.sh | 37 - ...abric-zip.sh => validate-framework-zip.sh} | 0 platform/ios/src/MGLAPIClient.m | 114 +- platform/ios/src/MGLMapView.mm | 61 +- platform/ios/src/MGLScaleBar.mm | 2 +- platform/ios/src/MGLUserLocation.h | 2 +- platform/macos/CHANGELOG.md | 31 +- .../macos/Mapbox-macOS-SDK-symbols.podspec | 2 +- platform/macos/Mapbox-macOS-SDK.podspec | 2 +- platform/macos/docs/img/screenshot.jpg | Bin 445665 -> 351938 bytes platform/macos/sdk/default_marker.pdf | Bin 2601 -> 4354 bytes platform/macos/src/MGLMapView.mm | 2 +- src/mbgl/util/std.hpp | 8 +- 145 files changed, 10678 insertions(+), 7314 deletions(-) create mode 100644 platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/action/MapboxMapAction.java create mode 100644 platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/geometry/LatLngBoundsTest.java delete mode 100644 platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/BaseStyleTest.java delete mode 100644 platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleBackgroundLayerTest.java create mode 100644 platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_location_engine.xml create mode 100644 platform/darwin/src/MGLLight.h.ejs create mode 100644 platform/darwin/src/MGLLight.mm.ejs create mode 100644 platform/darwin/test/MGLLightTest.mm.ejs create mode 100644 platform/ios/app/hu.lproj/Localizable.strings rename platform/ios/resources/{api_mapbox_com-digicert.der => api_mapbox_com-digicert_2016.der} (100%) create mode 100644 platform/ios/resources/api_mapbox_com-digicert_2017.der rename platform/ios/resources/{api_mapbox_com-geotrust.der => api_mapbox_com-geotrust_2016.der} (100%) create mode 100644 platform/ios/resources/api_mapbox_com-geotrust_2017.der create mode 100644 platform/ios/resources/hu.lproj/Localizable.strings delete mode 100755 platform/ios/scripts/release-fabric.sh rename platform/ios/scripts/{validate-fabric-zip.sh => validate-framework-zip.sh} (100%) diff --git a/Makefile b/Makefile index debca8730ac..ba2f1ae31d0 100644 --- a/Makefile +++ b/Makefile @@ -253,11 +253,6 @@ iframework: $(IOS_PROJ_PATH) FORMAT=dynamic BUILD_DEVICE=$(BUILD_DEVICE) SYMBOLS=$(SYMBOLS) \ ./platform/ios/scripts/package.sh -.PHONY: ifabric -ifabric: $(IOS_PROJ_PATH) - FORMAT=static BUILD_DEVICE=$(BUILD_DEVICE) SYMBOLS=NO SELF_CONTAINED=YES \ - ./platform/ios/scripts/package.sh - .PHONY: ideploy ideploy: caffeinate -i ./platform/ios/scripts/deploy-packages.sh diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index d8a58fe1403..fa54b1e3ed5 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -2,12 +2,46 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started. -## master +## 5.2.0 - TBA + * Add support for ImageSource [#9110](https://github.com/mapbox/mapbox-gl-native/pull/9110) -## 5.1.0 - TBA +## 5.1.0 - June 30, 2017 + +* Update to MAS 2.1.3 [#9402](https://github.com/mapbox/mapbox-gl-native/pull/9402) +* Downgrade LOST to v1.1.1 [#9394](https://github.com/mapbox/mapbox-gl-native/pull/9394) +* OnCameraIdle hook into quickzoom gesture [#9339](https://github.com/mapbox/mapbox-gl-native/pull/9339) +* LatLngBounds conversion regression, add test [#9324](https://github.com/mapbox/mapbox-gl-native/pull/9324) + +## 5.1.0-beta.5 - June 21, 2017 + +* Update MAS dependency to 2.1.2 [#9311](https://github.com/mapbox/mapbox-gl-native/pull/9311) +* Update LOST dependency to 3.0.1 [#9302](https://github.com/mapbox/mapbox-gl-native/pull/9302) +* Fix Pulse example Parcelable creator [#9283](https://github.com/mapbox/mapbox-gl-native/pull/9283) +* Custom marker view anchoring [#9282](https://github.com/mapbox/mapbox-gl-native/pull/9282) +* Update Activity test generation [#9276](https://github.com/mapbox/mapbox-gl-native/pull/9276) +* Validate camera position before transforming [#9275](https://github.com/mapbox/mapbox-gl-native/pull/9275) +* Revisit javadoc [#9266](https://github.com/mapbox/mapbox-gl-native/pull/9266) +* Build with NDK 15 [#9263](https://github.com/mapbox/mapbox-gl-native/pull/9263) +* Snapshot with view content [#9263](https://github.com/mapbox/mapbox-gl-native/pull/9263) +* Update source changed javadoc [#9243](https://github.com/mapbox/mapbox-gl-native/pull/9243) +* Run tests on UI-thread [#9198](https://github.com/mapbox/mapbox-gl-native/pull/9198) +* Fix trackball on worker thread [#9305](https://github.com/mapbox/mapbox-gl-native/pull/9305) + +## 5.1.0-beta.4 - June 9, 2017 + +* Option to disable location change animation [#9210](https://github.com/mapbox/mapbox-gl-native/pull/9210) +* Invalidating MyLocationView bearing when not following [#9212](https://github.com/mapbox/mapbox-gl-native/pull/9212) +* Remove upgrade runtime exceptions [#9191](https://github.com/mapbox/mapbox-gl-native/pull/9191) +* Check source usage before removal [#9129](https://github.com/mapbox/mapbox-gl-native/pull/9129) * Fix tracking mode + camera race condition [#9133](https://github.com/mapbox/mapbox-gl-native/pull/9133) * Harden orientation changes [#9128](https://github.com/mapbox/mapbox-gl-native/pull/9128) +* Infinite location animation updates [#9194](https://github.com/mapbox/mapbox-gl-native/pull/9194) +* Invoke callback with valid fling gestures [#9192](https://github.com/mapbox/mapbox-gl-native/pull/9192) +* Keep location tracking after screen rotation [#9187](https://github.com/mapbox/mapbox-gl-native/pull/9187) +* Update components with camera values when animating [#9174](https://github.com/mapbox/mapbox-gl-native/pull/9174) +* Validate if gestures should execute [#9173](https://github.com/mapbox/mapbox-gl-native/pull/9173) +* Custom location source and LOST integration [#9142](https://github.com/mapbox/mapbox-gl-native/pull/9142) ## 5.1.0-beta.3 - May 26, 2017 diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle index adbc7cad7fc..8b92fa1af22 100644 --- a/platform/android/MapboxGLAndroidSDK/build.gradle +++ b/platform/android/MapboxGLAndroidSDK/build.gradle @@ -6,7 +6,9 @@ dependencies { compile rootProject.ext.dep.supportDesign compile rootProject.ext.dep.timber compile rootProject.ext.dep.okhttp3 - compile rootProject.ext.dep.lost + compile(rootProject.ext.dep.lost) { + exclude group: 'com.google.guava' + } testCompile rootProject.ext.dep.junit testCompile rootProject.ext.dep.mockito diff --git a/platform/android/MapboxGLAndroidSDK/gradle.properties b/platform/android/MapboxGLAndroidSDK/gradle.properties index 9f555da5f8a..078fdbc801c 100644 --- a/platform/android/MapboxGLAndroidSDK/gradle.properties +++ b/platform/android/MapboxGLAndroidSDK/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.mapbox.mapboxsdk -VERSION_NAME=5.1.0-SNAPSHOT +VERSION_NAME=5.2.0-SNAPSHOT POM_DESCRIPTION=Mapbox GL Android SDK POM_URL=https://github.com/mapbox/mapbox-gl-native diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java index bc1049d146b..3af79215961 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java @@ -1,6 +1,5 @@ package com.mapbox.mapboxsdk; -import android.app.Application; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; @@ -17,10 +16,10 @@ import com.mapbox.services.android.telemetry.location.LocationEnginePriority; /** - * The entry point of the Mapbox Android SDK. + * The entry point to initialize the Mapbox Android SDK. *

* Obtain a reference by calling {@link #getInstance(Context, String)}. Usually this class is configured in - * {@link Application#onCreate()} and is responsible for the active access token, application context, and + * Application#onCreate() and is responsible for the active access token, application context, and * connectivity state. *

*/ @@ -31,6 +30,7 @@ public final class Mapbox { private Context context; private String accessToken; private Boolean connected; + private LocationSource locationSource; /** * Get an instance of Mapbox. @@ -46,8 +46,8 @@ public final class Mapbox { public static synchronized Mapbox getInstance(@NonNull Context context, @NonNull String accessToken) { if (INSTANCE == null) { Context appContext = context.getApplicationContext(); - INSTANCE = new Mapbox(appContext, accessToken); - LocationEngine locationEngine = LocationSource.getLocationEngine(appContext); + INSTANCE = new Mapbox(appContext, accessToken, new LocationSource(appContext)); + LocationEngine locationEngine = new LocationSource(appContext); locationEngine.setPriority(LocationEnginePriority.NO_POWER); MapboxTelemetry.getInstance().initialize( appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT, locationEngine); @@ -56,9 +56,10 @@ public static synchronized Mapbox getInstance(@NonNull Context context, @NonNull return INSTANCE; } - Mapbox(@NonNull Context context, @NonNull String accessToken) { + Mapbox(@NonNull Context context, @NonNull String accessToken, LocationSource locationSource) { this.context = context; this.accessToken = accessToken; + this.locationSource = locationSource; } /** @@ -96,6 +97,8 @@ private static void validateAccessToken() throws MapboxConfigurationException { /** * Application context + * + * @return the application context */ public static Context getApplicationContext() { return INSTANCE.context; @@ -129,4 +132,8 @@ public static synchronized Boolean isConnected() { NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); return (activeNetwork != null && activeNetwork.isConnected()); } + + public static LocationSource getLocationSource() { + return INSTANCE.locationSource; + } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java index 07e038c08cf..c58cc310a8e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java @@ -27,14 +27,32 @@ public class BubbleLayout extends LinearLayout { private float strokeWidth; private int strokeColor; + /** + * Creates an instance of bubble layout. + * + * @param context The context used to inflate this bubble layout + */ public BubbleLayout(Context context) { this(context, null, 0); } + /** + * Creates an instance of bubble layout. + * + * @param context The context used to inflate this bubble layout + * @param attrs The attribute set to initialise this bubble layout from + */ public BubbleLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } + /** + * Creates an instance of bubble layout. + * + * @param context The context used to inflate this bubble layout + * @param attrs The attribute set to initialise this bubble layout from + * @param defStyleAttr The default style to apply this bubble layout with + */ public BubbleLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); @@ -78,10 +96,21 @@ static float convertDpToPixel(float dp, Context context) { return dp * (metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT); } + /** + * Get the arrow direction. + * + * @return the arrow direction + */ public ArrowDirection getArrowDirection() { return arrowDirection; } + /** + * Set the arrow direction. + * + * @param arrowDirection The direction of the arrow + * @return this + */ public BubbleLayout setArrowDirection(ArrowDirection arrowDirection) { resetPadding(); this.arrowDirection = arrowDirection; @@ -89,10 +118,21 @@ public BubbleLayout setArrowDirection(ArrowDirection arrowDirection) { return this; } + /** + * Get the arrow width. + * + * @return the width of the arrow + */ public float getArrowWidth() { return arrowWidth; } + /** + * Set the arrow width. + * + * @param arrowWidth The width of the arrow + * @return this + */ public BubbleLayout setArrowWidth(float arrowWidth) { resetPadding(); this.arrowWidth = arrowWidth; @@ -100,10 +140,21 @@ public BubbleLayout setArrowWidth(float arrowWidth) { return this; } + /** + * Get the arrow height + * + * @return the height of the arrow + */ public float getArrowHeight() { return arrowHeight; } + /** + * Set the arrow height. + * + * @param arrowHeight The height of the arrow + * @return this + */ public BubbleLayout setArrowHeight(float arrowHeight) { resetPadding(); this.arrowHeight = arrowHeight; @@ -111,10 +162,21 @@ public BubbleLayout setArrowHeight(float arrowHeight) { return this; } + /** + * Get the arrow position. + * + * @return the arrow position + */ public float getArrowPosition() { return arrowPosition; } + /** + * Get the arrow position. + * + * @param arrowPosition The arrow position + * @return this + */ public BubbleLayout setArrowPosition(float arrowPosition) { resetPadding(); this.arrowPosition = arrowPosition; @@ -122,30 +184,63 @@ public BubbleLayout setArrowPosition(float arrowPosition) { return this; } + /** + * Get the corner radius + * + * @return the corner radius + */ public float getCornersRadius() { return cornersRadius; } + /** + * Set the corner radius + * + * @param cornersRadius The corner radius + * @return this + */ public BubbleLayout setCornersRadius(float cornersRadius) { this.cornersRadius = cornersRadius; requestLayout(); return this; } + /** + * Get the bubble color. + * + * @return the bubble color + */ public int getBubbleColor() { return bubbleColor; } + /** + * Set the bubble color. + * + * @param bubbleColor The buble color + * @return this + */ public BubbleLayout setBubbleColor(int bubbleColor) { this.bubbleColor = bubbleColor; requestLayout(); return this; } + /** + * Get stroke width. + * + * @return the stroke width + */ public float getStrokeWidth() { return strokeWidth; } + /** + * Set the stroke width. + * + * @param strokeWidth The stroke width + * @return this + */ public BubbleLayout setStrokeWidth(float strokeWidth) { resetPadding(); this.strokeWidth = strokeWidth; @@ -153,10 +248,21 @@ public BubbleLayout setStrokeWidth(float strokeWidth) { return this; } + /** + * Get the stroke color. + * + * @return the stroke color + */ public int getStrokeColor() { return strokeColor; } + /** + * Set the stroke color. + * + * @param strokeColor The stroke color + * @return this + */ public BubbleLayout setStrokeColor(int strokeColor) { this.strokeColor = strokeColor; requestLayout(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java index 57aa512401b..f9ca9bf4ccf 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java @@ -23,7 +23,7 @@ /** * Factory for creating Icons from bitmap images. *

- * {@link Icon} is used to display bitmaps on top of the map using {@link Marker} and {@link MarkerView}. + * icon is used to display bitmaps on top of the map using {@link Marker} and {@link MarkerView}. *

* * @see Icon @@ -42,6 +42,12 @@ public final class IconFactory { private int nextId = 0; + /** + * Get a single instance of IconFactory. + * + * @param context the context to derive the application context from + * @return the single instance of IconFactory + */ public static synchronized IconFactory getInstance(@NonNull Context context) { if (instance == null) { instance = new IconFactory(context.getApplicationContext()); @@ -71,10 +77,10 @@ private IconFactory(@NonNull Context context) { } /** - * Creates an {@link Icon} from a given Bitmap image. + * Creates an icon from a given Bitmap image. * * @param bitmap image used for creating the Icon. - * @return The {@link Icon} using the given Bitmap image. + * @return The icon using the given Bitmap image. */ public Icon fromBitmap(@NonNull Bitmap bitmap) { if (nextId < 0) { @@ -85,10 +91,10 @@ public Icon fromBitmap(@NonNull Bitmap bitmap) { } /** - * Create an {@link Icon} using the resource ID of a Bitmap image. + * Creates an icon using the resource ID of a Bitmap image. * * @param resourceId The resource ID of a Bitmap image. - * @return The {@link Icon} that was loaded from the asset or {@code null} if failed to load. + * @return The icon that was loaded from the asset or {@code null} if failed to load. */ public Icon fromResource(@DrawableRes int resourceId) { Drawable drawable = ContextCompat.getDrawable(context, resourceId); @@ -101,9 +107,9 @@ public Icon fromResource(@DrawableRes int resourceId) { } /** - * Provides an {@link Icon} using the default marker icon used for {@link Marker}. + * Provides an icon using the default marker icon used for {@link Marker}. * - * @return An {@link Icon} with the default {@link Marker} icon. + * @return An icon with the default {@link Marker} icon. */ public Icon defaultMarker() { if (defaultMarker == null) { @@ -113,9 +119,9 @@ public Icon defaultMarker() { } /** - * Provides an {@link Icon} using the default marker icon used for {@link MarkerView}. + * Provides an icon using the default marker icon used for {@link MarkerView}. * - * @return An {@link Icon} with the default {@link MarkerView} icon. + * @return An icon with the default {@link MarkerView} icon. */ public Icon defaultMarkerView() { if (defaultMarkerView == null) { @@ -130,10 +136,10 @@ private Icon fromInputStream(@NonNull InputStream is) { } /** - * Creates an {@link Icon} using the name of a Bitmap image in the assets directory. + * Creates an Icon using the name of a Bitmap image in the assets directory. * * @param assetName The name of a Bitmap image in the assets directory. - * @return The {@link Icon} that was loaded from the asset or {@code null} if failed to load. + * @return The Icon that was loaded from the asset or null if failed to load. */ public Icon fromAsset(@NonNull String assetName) { InputStream is; @@ -146,11 +152,10 @@ public Icon fromAsset(@NonNull String assetName) { } /** - * Creates an {@link Icon} using the absolute file path of a Bitmap image. + * Creates an Icon using the absolute file path of a Bitmap image. * * @param absolutePath The absolute path of the Bitmap image. - * @return The {@link Icon} that was loaded from the absolute path or {@code null} if failed to - * load. + * @return The Icon that was loaded from the absolute path or null if failed to load. */ public Icon fromPath(@NonNull String absolutePath) { Bitmap bitmap = BitmapFactory.decodeFile(absolutePath, options); @@ -158,11 +163,11 @@ public Icon fromPath(@NonNull String absolutePath) { } /** - * Create an {@link Icon} using the name of a Bitmap image file located in the internal storage. - * In particular, this calls {@link Context#openFileInput(String)}. + * Create an Icon using the name of a Bitmap image file located in the internal storage. + * In particular, this calls Context#openFileInput(String). * * @param fileName The name of the Bitmap image file. - * @return The {@link Icon} that was loaded from the asset or {@code null} if failed to load. + * @return The Icon that was loaded from the asset or null if failed to load. * @see * Using the Internal Storage */ @@ -177,12 +182,11 @@ public Icon fromFile(@NonNull String fileName) { } /** - * Create an {@link Icon} using a previously created icon identifier along with a provided - * Bitmap. + * Create an Icon using a previously created icon identifier along with a provided Bitmap. * - * @param iconId The {@link Icon} identifier you'd like to recreate. + * @param iconId The Icon identifier you'd like to recreate. * @param bitmap a Bitmap used to replace the current one. - * @return The {@link Icon} using the new Bitmap. + * @return The Icon using the new Bitmap. */ public static Icon recreate(@NonNull String iconId, @NonNull Bitmap bitmap) { return new Icon(iconId, bitmap); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java index bb51f3bfc29..dce6f6b2777 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java @@ -10,6 +10,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.ViewTreeObserver; import android.widget.ImageView; import com.mapbox.mapboxsdk.R; @@ -33,6 +34,15 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { private final ViewGroup markerViewContainer; + private final ViewTreeObserver.OnPreDrawListener markerViewPreDrawObserver = + new ViewTreeObserver.OnPreDrawListener() { + @Override + public boolean onPreDraw() { + invalidateViewMarkersInVisibleRegion(); + markerViewContainer.getViewTreeObserver().removeOnPreDrawListener(markerViewPreDrawObserver); + return false; + } + }; private final Map markerViewMap = new HashMap<>(); private final LongSparseArray markerViewAddedListenerMap = new LongSparseArray<>(); private final List markerViewAdapters = new ArrayList<>(); @@ -125,6 +135,12 @@ public void animateRotationBy(@NonNull MarkerView marker, float rotation) { } } + /** + * Set the rotation of a MarkerView to a given rotation value. + * + * @param marker The MarkerView to change its rotation value + * @param rotation The rotation value + */ public void setRotation(@NonNull MarkerView marker, float rotation) { View convertView = markerViewMap.get(marker); if (convertView != null) { @@ -180,14 +196,16 @@ public void updateMarkerViewsPosition() { PointF point = mapboxMap.getProjection().toScreenLocation(marker.getPosition()); if (marker.getOffsetX() == MapboxConstants.UNMEASURED) { // ensure view is measured first - if (marker.getWidth() == 0) { - convertView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); - if (convertView.getMeasuredWidth() != 0) { - marker.setWidth(convertView.getMeasuredWidth()); - marker.setHeight(convertView.getMeasuredHeight()); - } + // #6805 invalidate marker views to ensure convertView width and height + // values are properly measured and up to date + if (marker.getWidth() == 0 && marker.isVisible()) { + convertView.getViewTreeObserver().addOnPreDrawListener(markerViewPreDrawObserver); } } + + marker.setWidth(convertView.getWidth()); + marker.setHeight(convertView.getHeight()); + if (marker.getWidth() != 0) { int x = (int) (marker.getAnchorU() * marker.getWidth()); int y = (int) (marker.getAnchorV() * marker.getHeight()); @@ -532,10 +550,11 @@ public void invalidateViewMarkersInVisibleRegion() { } /** - * When the provided {@link MarkerView} is clicked on by a user, we check if a custom click - * event has been created and if not, display a {@link InfoWindow}. + * When the provided MarkerView is clicked on by a user, we check if a custom click + * event has been created and if not, display a InfoWindow. * - * @param markerView that the click event occurred. + * @param markerView that the click event occurred + * @return true if the marker view click has been handled, false if not */ public boolean onClickMarkerView(MarkerView markerView) { boolean clickHandled = false; @@ -560,9 +579,9 @@ public boolean onClickMarkerView(MarkerView markerView) { } /** - * Handles the {@link MarkerView}'s info window offset. + * Handles the MarkerView info window offset. * - * @param marker that we are ensuring info window offset. + * @param marker that we are ensuring info window offset */ public void ensureInfoWindowOffset(MarkerView marker) { View view = null; @@ -612,7 +631,7 @@ public void addOnMarkerViewAddedListener(MarkerView markerView, OnMarkerViewAdde } /** - * Default MarkerViewAdapter used for base class of {@link MarkerView} to adapt a MarkerView to + * Default MarkerViewAdapter used for base class of MarkerView to adapt a MarkerView to * an ImageView. */ private static class ImageMarkerViewAdapter extends MapboxMap.MarkerViewAdapter { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java index 66c261f1d0b..c2f19072dbd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java @@ -3,6 +3,7 @@ import android.content.res.TypedArray; import android.os.Parcel; import android.os.Parcelable; +import android.support.annotation.FloatRange; import com.mapbox.mapboxsdk.R; import com.mapbox.mapboxsdk.constants.MapboxConstants; @@ -166,14 +167,14 @@ public static final class Builder { private double zoom = -1; /** - * Creates an empty builder. + * Create an empty builder. */ public Builder() { super(); } /** - * Create Builder with an existing CameraPosition data. + * Create a builder with an existing CameraPosition data. * * @param previous Existing CameraPosition values to use */ @@ -188,7 +189,7 @@ public Builder(CameraPosition previous) { } /** - * Create Builder with an existing CameraPosition data. + * Create a builder with an existing CameraPosition data. * * @param typedArray TypedArray containing attribute values */ @@ -205,7 +206,7 @@ public Builder(TypedArray typedArray) { } /** - * Create Builder from an existing CameraPositionUpdate update. + * Create a builder from an existing CameraPositionUpdate update. * * @param update Update containing camera options */ @@ -220,7 +221,7 @@ public Builder(CameraUpdateFactory.CameraPositionUpdate update) { } /** - * Create Builder from an existing CameraPositionUpdate update. + * Create builder from an existing CameraPositionUpdate update. * * @param update Update containing camera options */ @@ -235,7 +236,7 @@ public Builder(CameraUpdateFactory.ZoomUpdate update) { * Sets the direction that the camera is pointing in, in degrees clockwise from north. * * @param bearing Bearing - * @return Builder + * @return this */ public Builder bearing(double bearing) { double direction = bearing; @@ -252,19 +253,10 @@ public Builder bearing(double bearing) { } /** - * Builds a CameraPosition. + * Sets the location where the camera is pointing at. * - * @return CameraPosition - */ - public CameraPosition build() { - return new CameraPosition(target, zoom, tilt, bearing); - } - - /** - * Sets the location that the camera is pointing at. - * - * @param location Location - * @return Builder + * @param location target of the camera + * @return this */ public Builder target(LatLng location) { this.target = location; @@ -272,28 +264,42 @@ public Builder target(LatLng location) { } /** - * Set the tilt in degrees + * Set the tilt of the camera in degrees *

- * value is clamped to 0 and 60. + * value is clamped to {@link MapboxConstants#MINIMUM_TILT} and {@link MapboxConstants#MAXIMUM_TILT}. *

* - * @param tilt Tilt value - * @return Builder + * @param tilt Tilt value of the camera + * @return this */ - public Builder tilt(double tilt) { + public Builder tilt(@FloatRange(from = MapboxConstants.MINIMUM_TILT, + to = MapboxConstants.MAXIMUM_TILT) double tilt) { this.tilt = MathUtils.clamp(tilt, MapboxConstants.MINIMUM_TILT, MapboxConstants.MAXIMUM_TILT); return this; } /** - * Set the zoom + * Set the zoom of the camera + *

+ * Zoom ranges from {@link MapboxConstants#MINIMUM_ZOOM} to {@link MapboxConstants#MAXIMUM_ZOOM} + *

* - * @param zoom Zoom value - * @return Builder + * @param zoom Zoom value of the camera + * @return this */ - public Builder zoom(double zoom) { + public Builder zoom(@FloatRange(from = MapboxConstants.MINIMUM_ZOOM, + to = MapboxConstants.MAXIMUM_ZOOM) double zoom) { this.zoom = zoom; return this; } + + /** + * Builds the CameraPosition. + * + * @return CameraPosition + */ + public CameraPosition build() { + return new CameraPosition(target, zoom, tilt, bearing); + } } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.java index 7e0dbf08fbd..31f13cbcff7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.java @@ -1,14 +1,22 @@ package com.mapbox.mapboxsdk.camera; import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.maps.MapboxMap; /** - * Interface definition for camera position changes. + * Interface definition for camera updates. */ public interface CameraUpdate { + /** + * Get the camera position from the camera update. + * + * @param mapboxMap Map object to build the position from + * @return the camera position from the implementing camera update + */ + @Nullable CameraPosition getCameraPosition(@NonNull MapboxMap mapboxMap); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java index 8e1411e2739..50e33f4f9fe 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.java @@ -42,7 +42,7 @@ public static CameraUpdate newLatLng(@NonNull LatLng latLng) { } /** - * Returns a {@link CameraUpdate} that transforms the camera such that the specified + * Returns a CameraUpdate that transforms the camera such that the specified * latitude/longitude bounds are centered on screen at the greatest possible zoom level. * You can specify padding, in order to inset the bounding box from the map view's edges. * The returned CameraUpdate has a bearing of 0 and a tilt of 0. @@ -56,7 +56,7 @@ public static CameraUpdate newLatLngBounds(@NonNull LatLngBounds bounds, int pad } /** - * Returns a {@link CameraUpdate} that transforms the camera such that the specified + * Returns a CameraUpdate that transforms the camera such that the specified * latitude/longitude bounds are centered on screen at the greatest possible zoom level. * You can specify padding, in order to inset the bounding box from the map view's edges. * The returned CameraUpdate has a bearing of 0 and a tilt of 0. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java index ecb6ffe24e4..1ee59057d23 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java @@ -133,5 +133,6 @@ public class MapboxConstants { public static final String STATE_ATTRIBUTION_MARGIN_RIGHT = "mapbox_attrMarginRight"; public static final String STATE_ATTRIBUTION_MARGIN_BOTTOM = "mapbox_atrrMarginBottom"; public static final String STATE_ATTRIBUTION_ENABLED = "mapbox_atrrEnabled"; - + public static final String STATE_LOCATION_CHANGE_ANIMATION_ENABLED = "mapbox_locationChangeAnimationEnabled"; + public static final String STATE_USING_CUSTOM_LOCATION_SOURCE = "mapbox_usingCustomLocationSource"; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyBearingTracking.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyBearingTracking.java index 88c3bef6733..ceac862f39a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyBearingTracking.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyBearingTracking.java @@ -2,23 +2,27 @@ import android.support.annotation.IntDef; +import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.widgets.MyLocationView; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** - * MyBearingTracking exposes different types bearing tracking modes. + * MyBearingTracking exposes different types of bearing tracking modes. + *

+ * These modes visualise the user direction by extracting the direction from either sensor or location data. + *

+ *

+ * Required to enable showing the user location first through {@link MapboxMap#setMyLocationEnabled(boolean)}. + *

* * @see com.mapbox.mapboxsdk.maps.TrackingSettings#setMyBearingTrackingMode(int) * @see MyLocationView#setMyBearingTrackingMode(int) */ public class MyBearingTracking { - /** - * Indicates that the parameter accepts one of the values from MyBearingTracking. - */ - @IntDef( {NONE, COMPASS, GPS, /**COMBINED**/}) + @IntDef( {NONE, COMPASS, GPS}) @Retention(RetentionPolicy.SOURCE) public @interface Mode { } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyLocationTracking.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyLocationTracking.java index a1744d701f2..1283283fa50 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyLocationTracking.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyLocationTracking.java @@ -3,29 +3,34 @@ import android.support.annotation.IntDef; import com.mapbox.mapboxsdk.maps.MapView; +import com.mapbox.mapboxsdk.maps.MapboxMap; +import com.mapbox.mapboxsdk.maps.TrackingSettings; import com.mapbox.mapboxsdk.maps.widgets.MyLocationView; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** - * MyLocationTracking exposes different types of locational tracking modes. + * MyLocationTracking exposes types of location tracking modes. + * *

+ * This allows tracking the user location on screen by updating the camera position when a location update occurs. + *

+ *

+ * Required to enable showing the user location first through {@link MapboxMap#setMyLocationEnabled(boolean)}. + *

* - * @see com.mapbox.mapboxsdk.maps.TrackingSettings#setMyLocationTrackingMode(int) - * @see MyLocationView#setMyLocationTrackingMode(int) + * @see MapboxMap#setMyLocationEnabled(boolean) + * @see TrackingSettings#setMyLocationTrackingMode(int) */ public class MyLocationTracking { - /** - * Indicates the parameter accepts one of the values from MyLocationTracking. - */ @IntDef( {TRACKING_NONE, TRACKING_FOLLOW}) @Retention(RetentionPolicy.SOURCE) public @interface Mode { } /** - * Location tracking is disabled. + * Tracking the location of the user is disabled. */ public static final int TRACKING_NONE = 0x00000000; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java index 31e6313509c..9943a72e060 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java @@ -17,7 +17,6 @@ */ public class Style { - /** * Indicates the parameter accepts one of the values from Style. Using one of these * constants means your map style will always use the latest version and may change as we diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/IconBitmapChangedException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/IconBitmapChangedException.java index 7154049bd7f..1f6b0efc4d2 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/IconBitmapChangedException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/IconBitmapChangedException.java @@ -1,15 +1,13 @@ package com.mapbox.mapboxsdk.exceptions; -import android.graphics.Bitmap; - import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.Marker; import com.mapbox.mapboxsdk.maps.MapView; /** *

- * A {@code IconBitmapChangedException} is thrown by {@link MapView} when a {@link Marker} is added - * that has a {@link Icon} with a {@link Bitmap} that has been modified since the creation of the Icon. + * An IconBitmapChangedException is thrown by MapView when a Marker is added + * that has an Icon with a Bitmap that has been modified since the creation of the Icon. *

* You cannot modify a {@code Icon} after it has been added to the map in a {@code Marker} * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidLatLngBoundsException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidLatLngBoundsException.java index 08a23a7373f..c1d03858156 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidLatLngBoundsException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidLatLngBoundsException.java @@ -1,8 +1,8 @@ package com.mapbox.mapboxsdk.exceptions; /** - * A InvalidLatLngBoundsException is thrown by {@link com.mapbox.mapboxsdk.geometry.LatLngBounds} - * when there aren't enough {@link com.mapbox.mapboxsdk.geometry.LatLng} to create a bounds. + * An InvalidLatLngBoundsException is thrown by LatLngBounds + * when there aren't enough LatLng to create a bounds. */ public class InvalidLatLngBoundsException extends RuntimeException { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java index f0f9b9236b2..44ee83265db 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java @@ -5,6 +5,9 @@ */ public class InvalidMarkerPositionException extends RuntimeException { + /** + * Creates a invalid marker position exception thrown when a Marker object is created with an invalid LatLng position. + */ public InvalidMarkerPositionException() { super("Adding an invalid Marker to a Map. " + "Missing the required position field. " diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java index 74bceb196c7..e9a0261d850 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java @@ -8,10 +8,14 @@ * This occurs either when {@link com.mapbox.mapboxsdk.Mapbox} is not correctly initialised or the provided access token * through {@link com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String)} isn't valid. *

+ * * @see com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String) */ public class MapboxConfigurationException extends RuntimeException { + /** + * Creates a Mapbox configuration exception thrown by MapboxMap when the SDK hasn't been properly initialised. + */ public MapboxConfigurationException() { super("\nUsing MapView requires setting a valid access token. Use Mapbox.getInstance(Context context, " + "String accessToken) to provide one. " diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/TooManyIconsException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/TooManyIconsException.java index 8923d822f2c..bffc10dc048 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/TooManyIconsException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/TooManyIconsException.java @@ -1,12 +1,11 @@ package com.mapbox.mapboxsdk.exceptions; -import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.IconFactory; /** *

- * A {@code TooManyIconsException} is thrown by {@link IconFactory} when it - * cannot create a {@link Icon} because there are already too many icons created. + * A TooManyIconsException is thrown by IconFactory when it + * cannot create a Icon because there are already too many icons created. *

* You should try to reuse Icon objects whenever possible. * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ILatLng.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ILatLng.java index 1af8e7cfc76..07df87af3a4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ILatLng.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ILatLng.java @@ -1,12 +1,28 @@ package com.mapbox.mapboxsdk.geometry; /** - * Describes a latitude, longitude point. + * Describes a latitude, longitude, and altitude tuple. */ public interface ILatLng { + + /** + * Get the latitude, in degrees. + * + * @return the latitude value in degrees + */ double getLatitude(); + /** + * Get the longitude, in degrees. + * + * @return the longitude value in degrees + */ double getLongitude(); + /** + * Get the altitude, in meters. + * + * @return the altitude value in meters + */ double getAltitude(); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/IProjectedMeters.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/IProjectedMeters.java index 694c9351434..db459d7cbb4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/IProjectedMeters.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/IProjectedMeters.java @@ -4,7 +4,19 @@ * Describes a projection in Mercator meters. */ public interface IProjectedMeters { + + /** + * Get the north projection, in meters. + * + * @return the projected meters in north direction + */ double getNorthing(); + /** + * Get the east projection, in meters. + * + * @return the projected meters in east direction + */ double getEasting(); + } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.java index ca2d3673b27..eb572411969 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.java @@ -3,6 +3,7 @@ import android.location.Location; import android.os.Parcel; import android.os.Parcelable; +import android.support.annotation.FloatRange; import com.mapbox.services.android.telemetry.constants.GeoConstants; import com.mapbox.services.android.telemetry.utils.MathUtils; @@ -21,6 +22,9 @@ */ public class LatLng implements ILatLng, Parcelable { + /** + * Inner class responsible for recreating Parcels into objects. + */ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public LatLng createFromParcel(Parcel in) { return new LatLng(in); @@ -44,7 +48,7 @@ public LatLng() { } /** - * Construct a new latitude, longitude point given float arguments + * Construct a new latitude, longitude point given double arguments * * @param latitude Latitude in degrees * @param longitude Longitude in degrees @@ -55,7 +59,7 @@ public LatLng(double latitude, double longitude) { } /** - * Construct a new latitude, longitude, altitude point given float arguments + * Construct a new latitude, longitude, altitude point given double arguments * * @param latitude Latitude in degrees * @param longitude Longitude in degress @@ -68,7 +72,7 @@ public LatLng(double latitude, double longitude, double altitude) { } /** - * Transform a Location into a LatLng point + * Construct a new latitude, longitude, altitude point given location argument * * @param location Android Location */ @@ -77,23 +81,40 @@ public LatLng(Location location) { } /** - * Clone an existing latitude longitude point + * Construct a new latitude, longitude, altitude point given another latitude, longitude, altitude point. * - * @param aLatLng LatLng + * @param latLng LatLng to be cloned. */ - public LatLng(LatLng aLatLng) { - this.latitude = aLatLng.latitude; - this.longitude = aLatLng.longitude; - this.altitude = aLatLng.altitude; + public LatLng(LatLng latLng) { + this.latitude = latLng.latitude; + this.longitude = latLng.longitude; + this.altitude = latLng.altitude; } + /** + * Constructs a new latitude, longitude, altitude tuple given a parcel. + * + * @param in the parcel containing the latitude, longitude, altitude values + */ protected LatLng(Parcel in) { setLatitude(in.readDouble()); setLongitude(in.readDouble()); setAltitude(in.readDouble()); } - public void setLatitude(double latitude) { + /** + * Set the latitude, in degrees. + *

+ * This value is in the range of [-85.05112878, 85.05112878], see {@link GeoConstants#MIN_LATITUDE} and + * {@link GeoConstants#MAX_LATITUDE} + *

+ * + * @param latitude the latitude value in degrees + * @see GeoConstants#MIN_LATITUDE + * @see GeoConstants#MAX_LATITUDE + */ + public void setLatitude( + @FloatRange(from = GeoConstants.MIN_LATITUDE, to = GeoConstants.MAX_LATITUDE) double latitude) { if (Double.isNaN(latitude)) { throw new IllegalArgumentException("latitude must not be NaN"); } @@ -103,12 +124,35 @@ public void setLatitude(double latitude) { this.latitude = latitude; } + /** + * Get the latitude, in degrees. + *

+ * This value is in the range of [-85.05112878, 85.05112878], see {@link GeoConstants#MIN_LATITUDE} and + * {@link GeoConstants#MAX_LATITUDE} + *

+ * + * @return the latitude value in degrees + * @see GeoConstants#MIN_LATITUDE + * @see GeoConstants#MAX_LATITUDE + */ @Override public double getLatitude() { return latitude; } - public void setLongitude(double longitude) { + /** + * Set the longitude, in degrees. + *

+ * This value is in the range of [-180, 180], see {@link GeoConstants#MIN_LONGITUDE} and + * {@link GeoConstants#MAX_LONGITUDE} + *

+ * + * @param longitude the longitude value in degrees + * @see GeoConstants#MIN_LONGITUDE + * @see GeoConstants#MAX_LONGITUDE + */ + public void setLongitude(@FloatRange(from = GeoConstants.MIN_LONGITUDE, to = GeoConstants.MAX_LONGITUDE) + double longitude) { if (Double.isNaN(longitude)) { throw new IllegalArgumentException("longitude must not be NaN"); } @@ -118,15 +162,36 @@ public void setLongitude(double longitude) { this.longitude = longitude; } + /** + * Get the longitude, in degrees. + *

+ * This value is in the range of [-180, 180], see {@link GeoConstants#MIN_LONGITUDE} and + * {@link GeoConstants#MAX_LONGITUDE} + *

+ * + * @return the longitude value in degrees + * @see GeoConstants#MIN_LONGITUDE + * @see GeoConstants#MAX_LONGITUDE + */ @Override public double getLongitude() { return longitude; } + /** + * Set the altitude, in meters. + * + * @param altitude the altitude in meters + */ public void setAltitude(double altitude) { this.altitude = altitude; } + /** + * Get the altitude, in meters. + * + * @return the altitude value in meters + */ @Override public double getAltitude() { return altitude; @@ -136,13 +201,19 @@ public double getAltitude() { * Return a new LatLng object with a wrapped Longitude. This allows original data object * to remain unchanged. * - * @return New LatLng object with wrapped Longitude + * @return new LatLng object with wrapped Longitude */ public LatLng wrap() { longitude = MathUtils.wrap(longitude, GeoConstants.MIN_LONGITUDE, GeoConstants.MAX_LONGITUDE); return this; } + /** + * Indicates whether some other object is "equal to" this one. + * + * @param object The object to compare + * @return True if equal, false if not + */ @Override public boolean equals(Object object) { if (this == object) { @@ -158,6 +229,11 @@ public boolean equals(Object object) { && Double.compare(latLng.longitude, longitude) == 0; } + /** + * Returns a hash code value for the object. + * + * @return the hash code value + */ @Override public int hashCode() { int result; @@ -171,16 +247,32 @@ public int hashCode() { return result; } + /** + * Returns a string representation of the object. + * + * @return the string representation + */ @Override public String toString() { return "LatLng [latitude=" + latitude + ", longitude=" + longitude + ", altitude=" + altitude + "]"; } + /** + * Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. + * + * @return a bitmask indicating the set of special object types marshaled by this Parcelable object instance. + */ @Override public int describeContents() { return 0; } + /** + * Flatten this object in to a Parcel. + * + * @param out The Parcel in which the object should be written. + * @param flags Additional flags about how the object should be written + */ @Override public void writeToParcel(Parcel out, int flags) { out.writeDouble(latitude); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java index 4a4e2a30aac..505b2db1924 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java @@ -3,6 +3,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.exceptions.InvalidLatLngBoundsException; import com.mapbox.services.android.telemetry.constants.GeoConstants; @@ -18,10 +19,10 @@ */ public class LatLngBounds implements Parcelable { - private final double mLatNorth; - private final double mLatSouth; - private final double mLonEast; - private final double mLonWest; + private final double latitudeNorth; + private final double latitudeSouth; + private final double longitudeEast; + private final double longitudeWest; /** * Construct a new LatLngBounds based on its corners, given in NESW @@ -34,10 +35,10 @@ public class LatLngBounds implements Parcelable { */ LatLngBounds(final double northLatitude, final double eastLongitude, final double southLatitude, final double westLongitude) { - this.mLatNorth = northLatitude; - this.mLonEast = eastLongitude; - this.mLatSouth = southLatitude; - this.mLonWest = westLongitude; + this.latitudeNorth = northLatitude; + this.longitudeEast = eastLongitude; + this.latitudeSouth = southLatitude; + this.longitudeWest = westLongitude; } /** @@ -59,8 +60,8 @@ public static LatLngBounds world() { * @return LatLng center of this LatLngBounds */ public LatLng getCenter() { - return new LatLng((this.mLatNorth + this.mLatSouth) / 2, - (this.mLonEast + this.mLonWest) / 2); + return new LatLng((this.latitudeNorth + this.latitudeSouth) / 2, + (this.longitudeEast + this.longitudeWest) / 2); } /** @@ -69,7 +70,7 @@ public LatLng getCenter() { * @return double latitude value for north */ public double getLatNorth() { - return this.mLatNorth; + return this.latitudeNorth; } /** @@ -78,7 +79,7 @@ public double getLatNorth() { * @return double latitude value for south */ public double getLatSouth() { - return this.mLatSouth; + return this.latitudeSouth; } /** @@ -87,7 +88,7 @@ public double getLatSouth() { * @return double longitude value for east */ public double getLonEast() { - return this.mLonEast; + return this.longitudeEast; } /** @@ -96,7 +97,7 @@ public double getLonEast() { * @return double longitude value for west */ public double getLonWest() { - return this.mLonWest; + return this.longitudeWest; } /** @@ -105,7 +106,7 @@ public double getLonWest() { * @return LatLng of the south west corner */ public LatLng getSouthWest() { - return new LatLng(mLatSouth, mLonWest); + return new LatLng(latitudeSouth, longitudeWest); } /** @@ -114,7 +115,7 @@ public LatLng getSouthWest() { * @return LatLng of the north east corner */ public LatLng getNorthEast() { - return new LatLng(mLatNorth, mLonEast); + return new LatLng(latitudeNorth, longitudeEast); } /** @@ -123,7 +124,7 @@ public LatLng getNorthEast() { * @return LatLng of the south east corner */ public LatLng getSouthEast() { - return new LatLng(mLatSouth, mLonEast); + return new LatLng(latitudeSouth, longitudeEast); } /** @@ -132,7 +133,7 @@ public LatLng getSouthEast() { * @return LatLng of the north west corner */ public LatLng getNorthWest() { - return new LatLng(mLatNorth, mLonWest); + return new LatLng(latitudeNorth, longitudeWest); } /** @@ -151,7 +152,7 @@ public LatLngSpan getSpan() { * @return Span distance */ public double getLatitudeSpan() { - return Math.abs(this.mLatNorth - this.mLatSouth); + return Math.abs(this.latitudeNorth - this.latitudeSouth); } /** @@ -161,7 +162,7 @@ public double getLatitudeSpan() { * @return Span distance */ public double getLongitudeSpan() { - return Math.abs(this.mLonEast - this.mLonWest); + return Math.abs(this.longitudeEast - this.longitudeWest); } @@ -174,9 +175,15 @@ public boolean isEmptySpan() { return getLongitudeSpan() == 0.0 || getLatitudeSpan() == 0.0; } + /** + * Returns a string representaton of the object. + * + * @return the string representation + */ @Override public String toString() { - return "N:" + this.mLatNorth + "; E:" + this.mLonEast + "; S:" + this.mLatSouth + "; W:" + this.mLonWest; + return "N:" + this.latitudeNorth + "; E:" + this.longitudeEast + "; S:" + this.latitudeSouth + + "; W:" + this.longitudeWest; } /** @@ -241,10 +248,10 @@ public boolean equals(final Object o) { } if (o instanceof LatLngBounds) { LatLngBounds other = (LatLngBounds) o; - return mLatNorth == other.getLatNorth() - && mLatSouth == other.getLatSouth() - && mLonEast == other.getLonEast() - && mLonWest == other.getLonWest(); + return latitudeNorth == other.getLatNorth() + && latitudeSouth == other.getLatSouth() + && longitudeEast == other.getLonEast() + && longitudeWest == other.getLonWest(); } return false; } @@ -258,10 +265,10 @@ public boolean equals(final Object o) { public boolean contains(final ILatLng latLng) { final double latitude = latLng.getLatitude(); final double longitude = latLng.getLongitude(); - return ((latitude <= this.mLatNorth) - && (latitude >= this.mLatSouth)) - && ((longitude <= this.mLonEast) - && (longitude >= this.mLonWest)); + return ((latitude <= this.latitudeNorth) + && (latitude >= this.latitudeSouth)) + && ((longitude <= this.longitudeEast) + && (longitude >= this.longitudeWest)); } /** @@ -295,10 +302,10 @@ public LatLngBounds union(LatLngBounds bounds) { * @return BoundingBox */ public LatLngBounds union(final double lonNorth, final double latEast, final double lonSouth, final double latWest) { - return new LatLngBounds((this.mLatNorth < lonNorth) ? lonNorth : this.mLatNorth, - (this.mLonEast < latEast) ? latEast : this.mLonEast, - (this.mLatSouth > lonSouth) ? lonSouth : this.mLatSouth, - (this.mLonWest > latWest) ? latWest : this.mLonWest); + return new LatLngBounds((this.latitudeNorth < lonNorth) ? lonNorth : this.latitudeNorth, + (this.longitudeEast < latEast) ? latEast : this.longitudeEast, + (this.latitudeSouth > lonSouth) ? lonSouth : this.latitudeSouth, + (this.longitudeWest > latWest) ? latWest : this.longitudeWest); } /** @@ -307,6 +314,7 @@ public LatLngBounds union(final double lonNorth, final double latEast, final dou * @param box LatLngBounds to intersect with * @return LatLngBounds */ + @Nullable public LatLngBounds intersect(LatLngBounds box) { double minLatWest = Math.max(getLonWest(), box.getLonWest()); double maxLatEast = Math.min(getLonEast(), box.getLonEast()); @@ -334,6 +342,9 @@ public LatLngBounds intersect(double northLatitude, double eastLongitude, double return intersect(new LatLngBounds(northLatitude, eastLongitude, southLatitude, westLongitude)); } + /** + * Inner class responsible for recreating Parcels into objects. + */ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @Override @@ -347,25 +358,41 @@ public LatLngBounds[] newArray(final int size) { } }; + /** + * Returns a hash code value for the object. + * + * @return the hash code + */ @Override public int hashCode() { - return (int) ((mLatNorth + 90) - + ((mLatSouth + 90) * 1000) - + ((mLonEast + 180) * 1000000) - + ((mLonEast + 180) * 1000000000)); + return (int) ((latitudeNorth + 90) + + ((latitudeSouth + 90) * 1000) + + ((longitudeEast + 180) * 1000000) + + ((longitudeEast + 180) * 1000000000)); } + /** + * Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. + * + * @return a bitmask indicating the set of special object types marshaled by this Parcelable object instance. + */ @Override public int describeContents() { return 0; } + /** + * Flatten this object in to a Parcel. + * + * @param out The Parcel in which the object should be written. + * @param flags Additional flags about how the object should be written + */ @Override - public void writeToParcel(final Parcel out, final int arg1) { - out.writeDouble(this.mLatNorth); - out.writeDouble(this.mLonEast); - out.writeDouble(this.mLatSouth); - out.writeDouble(this.mLonWest); + public void writeToParcel(final Parcel out, final int flags) { + out.writeDouble(this.latitudeNorth); + out.writeDouble(this.longitudeEast); + out.writeDouble(this.latitudeSouth); + out.writeDouble(this.longitudeWest); } private static LatLngBounds readFromParcel(final Parcel in) { @@ -381,28 +408,51 @@ private static LatLngBounds readFromParcel(final Parcel in) { */ public static final class Builder { - private List mLatLngList; + private List latLngList; + /** + * Constructs a builder to compose LatLng objects to a LatLngBounds. + */ public Builder() { - mLatLngList = new ArrayList<>(); + latLngList = new ArrayList<>(); } + /** + * Builds a new LatLngBounds. + *

+ * Throws an {@link InvalidLatLngBoundsException} when no LatLngBounds can be created. + *

+ * + * @return the build LatLngBounds + */ public LatLngBounds build() { - if (mLatLngList.size() < 2) { - throw new InvalidLatLngBoundsException(mLatLngList.size()); + if (latLngList.size() < 2) { + throw new InvalidLatLngBoundsException(latLngList.size()); } - return LatLngBounds.fromLatLngs(mLatLngList); + return LatLngBounds.fromLatLngs(latLngList); } + /** + * Adds a LatLng object to the LatLngBounds.Builder. + * + * @param latLngs the List of LatLng objects to be added + * @return this + */ public Builder includes(List latLngs) { for (LatLng point : latLngs) { - mLatLngList.add(point); + latLngList.add(point); } return this; } + /** + * Adds a LatLng object to the LatLngBounds.Builder. + * + * @param latLng the LatLng to be added + * @return this + */ public Builder include(@NonNull LatLng latLng) { - mLatLngList.add(latLng); + latLngList.add(latLng); return this; } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngSpan.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngSpan.java index d00ccdb9b83..322c7dfb74a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngSpan.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngSpan.java @@ -64,19 +64,28 @@ public void setLongitudeSpan(double longitudeSpan) { mLongitudeSpan = longitudeSpan; } + /** + * Indicates whether some other object is "equal to" this one. + * + * @param object The object to compare + * @return True if equal, false if not + */ @Override - public boolean equals(Object o) { - if (this == o) { + public boolean equals(Object object) { + if (this == object) { return true; } - if (o instanceof LatLngSpan) { - LatLngSpan other = (LatLngSpan) o; + if (object instanceof LatLngSpan) { + LatLngSpan other = (LatLngSpan) object; return mLongitudeSpan == other.getLongitudeSpan() && mLatitudeSpan == other.getLatitudeSpan(); } return false; } + /** + * Inner class responsible for recreating Parcels into objects. + */ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @Override @@ -90,14 +99,41 @@ public LatLngSpan[] newArray(int size) { } }; + /** + * Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. + * + * @return a bitmask indicating the set of special object types marshaled by this Parcelable object instance. + */ @Override public int describeContents() { return 0; } + /** + * Flatten this object in to a Parcel. + * + * @param out Parcel in which the object should be written + * @param flags Additional flags about how the object should be written + */ @Override - public void writeToParcel(Parcel out, int arg1) { + public void writeToParcel(Parcel out, int flags) { out.writeDouble(mLatitudeSpan); out.writeDouble(mLongitudeSpan); } + + /** + * Returns a hash code value for the object. + * + * @return hash code value of this + */ + @Override + public int hashCode() { + int result; + long temp; + temp = Double.doubleToLongBits(mLatitudeSpan); + result = (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(mLongitudeSpan); + result = 31 * result + (int) (temp ^ (temp >>> 32)); + return result; + } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ProjectedMeters.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ProjectedMeters.java index 761d8f2a8bb..fa84c33b2b9 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ProjectedMeters.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ProjectedMeters.java @@ -13,6 +13,9 @@ */ public class ProjectedMeters implements IProjectedMeters, Parcelable { + /** + * Inner class responsible for recreating Parcels into objects. + */ public static final Creator CREATOR = new Creator() { public ProjectedMeters createFromParcel(Parcel in) { return new ProjectedMeters(in); @@ -47,6 +50,12 @@ public ProjectedMeters(ProjectedMeters projectedMeters) { this.easting = projectedMeters.easting; } + /** + * Creates a ProjectedMeters from a Parcel. + * + * @param in The parcel to create from + * @return a bitmask indicating the set of special object types marshaled by this Parcelable object instance. + */ private ProjectedMeters(Parcel in) { northing = in.readDouble(); easting = in.readDouble(); @@ -72,22 +81,32 @@ public double getEasting() { return easting; } + /** + * Indicates whether some other object is "equal to" this one. + * + * @param other The object to compare this to + * @return true if equal, false if not + */ @Override - public boolean equals(Object o) { - if (this == o) { + public boolean equals(Object other) { + if (this == other) { return true; } - if (o == null || getClass() != o.getClass()) { + if (other == null || getClass() != other.getClass()) { return false; } - ProjectedMeters projectedMeters = (ProjectedMeters) o; + ProjectedMeters projectedMeters = (ProjectedMeters) other; return Double.compare(projectedMeters.easting, easting) == 0 && Double.compare(projectedMeters.northing, northing) == 0; - } + /** + * Returns a hash code value for the object. + * + * @return the hash code of this + */ @Override public int hashCode() { int result; @@ -99,16 +118,32 @@ public int hashCode() { return result; } + /** + * Returns a string representation of the object. + * + * @return the string representation of this + */ @Override public String toString() { return "ProjectedMeters [northing=" + northing + ", easting=" + easting + "]"; } + /** + * Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. + * + * @return a bitmask indicating the set of special object types marshaled by this Parcelable object instance. + */ @Override public int describeContents() { return 0; } + /** + * Flatten this object in to a Parcel. + * + * @param out The Parcel in which the object should be written. + * @param flags Additional flags about how the object should be written + */ @Override public void writeToParcel(Parcel out, int flags) { out.writeDouble(northing); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java index c5b8ad3077a..c09c00fcedf 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.java @@ -37,6 +37,11 @@ public class VisibleRegion implements Parcelable { */ public final LatLngBounds latLngBounds; + /** + * Creates a VisibleRegion from a Parcel. + * + * @param in The Parcel to create this from + */ private VisibleRegion(Parcel in) { this.farLeft = in.readParcelable(LatLng.class.getClassLoader()); this.farRight = in.readParcelable(LatLng.class.getClassLoader()); @@ -46,7 +51,7 @@ private VisibleRegion(Parcel in) { } /** - * Creates a new VisibleRegion given the four corners of the camera. + * Creates a VisibleRegion given the four corners of the camera. * * @param farLeft A LatLng object containing the latitude and longitude of the near left corner of the region. * @param farRight A LatLng object containing the latitude and longitude of the near left corner of the region. @@ -88,12 +93,22 @@ public boolean equals(Object o) { && latLngBounds.equals(visibleRegion.latLngBounds); } + /** + * The string representation of the object. + * + * @return the string representation of this + */ @Override public String toString() { return "[farLeft [" + farLeft + "], farRight [" + farRight + "], nearLeft [" + nearLeft + "], nearRight [" + nearRight + "], latLngBounds [" + latLngBounds + "]]"; } + /** + * Returns a hash code value for the object. + * + * @return the hash code + */ @Override public int hashCode() { return ((farLeft.hashCode() + 90) @@ -102,11 +117,22 @@ public int hashCode() { + ((nearRight.hashCode() + 180) * 1000000000)); } + /** + * Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. + * + * @return a bitmask indicating the set of special object types marshaled by this Parcelable object instance. + */ @Override public int describeContents() { return 0; } + /** + * Flatten this object in to a Parcel. + * + * @param out The Parcel in which the object should be written. + * @param flags Additional flags about how the object should be written + */ @Override public void writeToParcel(Parcel out, int flags) { out.writeParcelable(farLeft, flags); @@ -116,6 +142,9 @@ public void writeToParcel(Parcel out, int flags) { out.writeParcelable(latLngBounds, flags); } + /** + * Inner class responsible for recreating Parcels into objects. + */ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public VisibleRegion createFromParcel(Parcel in) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java index 4e934fa3ccb..6652142be3e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java @@ -2,7 +2,7 @@ import android.content.Context; import android.location.Location; -import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import com.mapbox.services.android.telemetry.location.LocationEngine; import com.mapbox.services.android.telemetry.location.LocationEngineListener; @@ -13,10 +13,6 @@ import com.mapzen.android.lost.api.LocationServices; import com.mapzen.android.lost.api.LostApiClient; -import java.lang.ref.WeakReference; - -import timber.log.Timber; - /** * Manages locational updates. Contains methods to register and unregister location listeners. *