feature/#790: map scale merged into floating point zoom (#800)

* feature/#728 - related: more verbose assertions
Not very often the unit test fails. With more verbose assertions, we will be able to find out why.

Impacted class:
* `OpenStreetMapViewTest`: more verbose assertions

* feature/#790: map scale merged into floating point zoom

This is just a teaser, there are things to fix. For instance, the pinch gesture center is not yet taking into consideration (zooming in or out scrolls the map to the bottom right).
All comments are welcomed.

Impacted classes:
* `CompassOverlay`: used the new `Canvas` related `Matrix` methods of `Projection`
* `CopyrightOverlay`: used the new `Canvas` related `Matrix` methods of `Projection`
* `LinearRing`: integrated the fact that there's no map scale anymore / should be considered as equal to 1
* `MapController`
  * feature-related: edited `zoomToFixing` and `onAnimationUpdate`; simplified `onAnimationEnd`
  * refactoring: removed members `mZoomInAnimation` and `mZoomOutAnimation`; simplified methods `zoomIn`, `zoomInFixing`, `zoomOut`, `zoomOutFixing`
* `MapView`
  * feature-related: removed members `ZOOM_SENSITIVITY`, `ZOOM_LOG_BASE_INV`, `mTargetZoomLevel` and `mMultiTouchScale`; deprecated methods `getZoomLevel(final boolean aPending)`, `zoomIn`, `zoomOut` and `getMapScale`; simplified `canZoomIn` and `canZoomOut`; optimized `dispatchDraw` using the new `Canvas` related `Matrix` methods of `Projection`; created new methods `startAnimation`, `setMultiTouchScale` and new member `mStartAnimationZoom`; impacted pinch gesture methods `getPositionAndScale`, `selectObject` and `setPositionAndScale`
  * refactoring: removed members `sMotionEventTransformMethod` and `mMercatorPoint`; deprecated methods `getLatitudeSpan`, `getLongitudeSpan` and `getBoundingBoxE6`; simplified method `rotateTouchEvent`
* `MinimapOverlay`: removed the "display only when not animating" restriction
* `Projection`
  * feature-related: removed member `float mMultiTouchScale`; removed parameter `pScale` from constructor; removed scale operations from matrices; optimized the computation of `mCurrentCenter`; added methods `save` and `restore` that apply the matrices to canvas only if necessary.
  * refactoring: renamed member as `mWrapEnabled`; simplified the initialization of `mScreenRectProjection`; added generic method `apply` that apply a `Matrix` to a `Point`
* `ScaleBarOverlay`: used the new `Canvas` related `Matrix` methods of `Projection`
* `ZoomButtonsOverlay`: used the new `Canvas` related `Matrix` methods of `Projection`; restricted the zoom action to a `ACTION_UP` event

* Desperate try to resolve conflict

* Desperate try to resolve conflict

* Desperate try to resolve conflict

* Desperate try to resolve conflict

* Merging the pinch gesture scale into floating point zoom (last fix?)

Impacted classes:
* `Projection`: rewrote the code in order to comply with `ProjectionTest`'s important notice (cf. javadoc)
* `ProjectionTest`: fixed the call to `Projection` constructor

* Lousy attempt to decrease the time taken by travis.

Impacted classes:
* `ExtraSamplesTest`: limited to 60 the number of items to run.
13 files changed
tree: 5e48dfefba13032df132c2e8d0ce72602d839bcd
  1. config/
  2. GoogleWrapperSample/
  3. gradle/
  4. images/
  5. issues/
  6. OpenStreetMapViewer/
  7. osmdroid-android/
  8. osmdroid-android-it/
  9. osmdroid-dist/
  10. osmdroid-geopackage/
  11. osmdroid-mapsforge/
  12. osmdroid-server-jdk/
  13. osmdroid-third-party/
  14. osmdroid-wms/
  15. OSMMapTilePackager/
  16. .gitattributes
  17. .gitignore
  18. .gitmodules
  19. .travis.yml
  20. archive.sqlite
  21. build.gradle
  22. CHANGELOG.md
  23. CONTRIBUTING.md
  24. gradle.properties
  25. gradlew
  26. gradlew.bat
  27. ISSUE_TEMPLATE.md
  28. LICENSE
  29. OSMDroid_CleanUp_Settings.xml
  30. OSMDroid_Formatter_Settings.xml
  31. pom.xml
  32. proguard_openmap.txt
  33. proguard_osm.txt
  34. proguard_osm_min.txt
  35. README.md
  36. settings.fdroid
  37. settings.gradle
  38. travis.sh
  39. world.map
README.md

Build Status

Maven Central

Android Arsenal

Get it on Google Play

osmdroid

osmdroid is a (almost) full/free replacement for Android's MapView (v1 API) class. It also includes a modular tile provider system with support for numerous online and offline tile sources and overlay support with built-in overlays for plotting icons, tracking location, and drawing shapes.

Current Release: 5.6.5 July 1th, 2017

Note: check your calendar, it may take up to a few days for all global mirrors to update.

Please read the osmdroid wiki for tutorials on integration.

Gradle dependency

repositories {
        mavenCentral()
}

dependencies {
    compile 'org.osmdroid:osmdroid-android:5.6.5'
}

Maven dependency

<dependency>
  <groupId>org.osmdroid</groupId>
  <artifactId>osmdroid-android</artifactId>
  <version>5.6.5</version>
  <type>aar</type>
</dependency>

Platform or API Level (API level 8 = Platform 2.2)

<platform>8</platform>

You can also compile osmdroid from source or download the dependency directly from OSS or download the distribution package

OK now what?

Continue reading here, How-to-use-the-osmdroid-library

Related and important wiki articles

I have a question or want to report a bug

If you have a question, please view the osmdroid FAQ.
You can also view the Stack Overflow osmdroid tag and osmdroid Google Group where you can get feedback from a large pool of osmdroid users.

If you still have an issue, please check the Changelog page to see if this issue is fixed in a newer or upcoming version of osmdroid.

If think you have a legitimate bug to report then go to the Issues page to see if your issue has been reported. If your issue already exists then please contribute information that will help us track down the source of the issue. If your issue does not exist then create a new issue report. When creating an issue, please include the version of osmdroid, the Android platform target and test device you are using, and a detailed description of the problem with relevant code. It is particularly helpful if you can reproduce the problem using our OpenStreetMapViewer sample project as your starting point.

I want to contribute

See our contributing guide

I want more!

The OSMBonusPack project adds additional functionality for use with osmdroid projects.

Screenshots

Demo Videos

Free Draw

Maps Forge

Floating point zoom

IIS Tracker

Building from source and using the aar in your app

Thanks to Gradle Fury, this publishes the artifacts to mavenLocal.

./gradlew clean install

In your root build.gradle file, add mavenLocal() if not present.

allprojects {
    repositories {
            mavenCentral()
            mavenLocal()    //add this if it's missing
    }
}

Then in your APK or AAR project that needs osmdroid.

    compile 'org.osmdroid:osmdroid-android:VERSION-SNAPSHOT:debug@aar'

Where VERSION is the version listed as the value for pom.version in gradle.properties. Note that when using the release versions from Maven Central, drop the :debug@aar part. When using a “release” version that you build locally with gradle, you'll need :release@aar instead.