Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Master #8

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,33 @@ Currently OPFMaps supports the following maps: [Google Maps][google-maps], [Amaz
The main dependencies are the `opfmaps` module and the [OPFUtils][opfutils] library:

```gradle
compile 'org.onepf:opfmaps:0.1.1@aar'
compile 'com.github.siekierskip.OPFMaps:opfmaps:v0.1.6'
compile 'org.onepf:opfutils:0.1.26'
```
Then you have to add at least one map provider dependency.

*Google Maps Provider*:

```gradle
compile 'org.onepf:opfmaps-google:0.1.1@aar'
compile 'com.google.android.gms:play-services-maps:8.1.0'
compile 'com.github.siekierskip.OPFMaps:google:v0.1.6'
compile 'com.google.android.gms:play-services-maps:10.0.1'
```

*NOTE:* Also for Google Maps you must add [Maps API Key][google-api-key] to the AndroidManifest.xml file.

*Amazon Maps Provider*:

```gradle
compile 'org.onepf:opfmaps-amazon:0.1.1@aar'
compile 'com.github.siekierskip.OPFMaps:amazon:v0.1.6'
compile 'com.amazon:amazon-maps-api:2.0'
```

*Osmdroid Provider*:

```gradle
compile 'org.onepf:opfmaps-osmdroid:0.1.1@aar'
compile 'org.osmdroid:osmdroid-android:4.3'
compile 'org.osmdroid:bonuspack:5.3'
compile 'com.github.siekierskip.OPFMaps:osmdroid:v0.1.6'
compile 'org.osmdroid:osmdroid-android:5.6.4'
compile 'com.github.MKergall:osmbonuspack:6.3'
compile 'org.slf4j:slf4j-android:1.7.12'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.google.code.gson:gson:2.3.1'
Expand All @@ -53,14 +53,15 @@ allprojects {
...
// third-party dependencies
maven { url 'https://raw.githubusercontent.com/onepf/OPF-mvn-repo/master/' }
maven { url "https://jitpack.io" }
}
}
```

*Yandex Maps Provider*:

```gradle
compile 'org.onepf:opfmaps-yandex-web:0.1.1@aar'
compile 'com.github.siekierskip.OPFMaps:yandex:v0.1.6'
```


Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ task wrapper(type: Wrapper) {
buildscript {
repositories {
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.kageiit:url-cache-plugin:1.0.0'
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.noveogroup.android:check:1.1.2'
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:latest.release'
classpath 'com.github.dcendents:android-maven-plugin:1.2'

}
}

Expand All @@ -36,6 +39,8 @@ allprojects {

repositories {
jcenter()
maven { url 'https://jitpack.io' }

}

ext {
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
# org.gradle.parallel=true

GROUP = org.onepf
POM_URL = https://github.com/onepf/OPFMaps
POM_SCM_URL = https://github.com/onepf/OPFMaps
POM_SCM_CONNECTION = scm:[email protected]:onepf/OPFMaps.git
POM_SCM_DEV_CONNECTION = scm:[email protected]:onepf/OPFMaps.git
POM_URL = https://github.com/siekierskip/OPFMaps
POM_SCM_URL = https://github.com/siekierskip/OPFMaps
POM_SCM_CONNECTION = scm:[email protected]:siekierskip/OPFMaps.git
POM_SCM_DEV_CONNECTION = scm:[email protected]:siekierskip/OPFMaps.git
POM_LICENCE_NAME = The Apache Software License, Version 2.0
POM_LICENCE_URL = http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST = repo
POM_DEVELOPER_ID = onepf
POM_DEVELOPER_NAME = One Platform Foundation
POM_DEVELOPER_ID = siekierskip
POM_DEVELOPER_NAME = Asseco Data Systems
POM_PACKAGING = aar

SNAPSHOT_REPOSITORY_URL = https://oss.sonatype.org/content/repositories/snapshots/
Expand Down
7 changes: 6 additions & 1 deletion opfmaps-providers/amazon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ android {
targetSdkVersion 23
versionName "0.1.1"
}

lintOptions {
abortOnError false
}
}

dependencies {
compile 'org.onepf:opfmaps:0.1.1@aar'
provided 'com.github.siekierskip.OPFMaps:opfmaps:v0.1.5'
provided 'org.onepf:opfutils:0.1.26'

compile 'com.amazon:amazon-maps-api:2.0'
provided 'com.android.support:support-annotations:23.1.0'
}
7 changes: 4 additions & 3 deletions opfmaps-providers/google/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionName "0.1.1"
versionName "0.1.6"
}
}

dependencies {
compile 'org.onepf:opfmaps:0.1.1@aar'
provided 'com.github.siekierskip.OPFMaps:opfmaps:v0.1.5'
provided 'org.onepf:opfutils:0.1.26'
compile 'com.google.android.gms:play-services-maps:8.1.0'

compile 'com.google.android.gms:play-services-maps:10.0.1'
provided 'com.android.support:support-annotations:23.1.0'
}
6 changes: 3 additions & 3 deletions opfmaps-providers/google/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ POM_NAME = Google Map Provider
POM_ARTIFACT_ID = opfmaps-google
POM_DESCRIPTION = Google Map provider implementation for OPFMaps library
POM_PACKAGING = aar
POM_SCM_URL = https://github.com/onepf/OPFMaps.git
POM_SCM_CONNECTION = scm:[email protected]:onepf/OPFMaps.git
POM_SCM_DEV_CONNECTION = scm:[email protected]:onepf/OPFMaps.git
POM_SCM_URL = https://github.com/siekierskip/OPFMaps.git
POM_SCM_CONNECTION = scm:[email protected]:siekierskip/OPFMaps.git
POM_SCM_DEV_CONNECTION = scm:[email protected]:siekierskip/OPFMaps.git
20 changes: 10 additions & 10 deletions opfmaps-providers/osmdroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionName "0.1.1"
versionName "0.1.6"
}
}

lintOptions {
abortOnError true
checkAllWarnings true
warningsAsErrors true
disable 'IconDensities'
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
flatDir {
dirs 'libs'
}
}

dependencies {
compile 'org.onepf:opfmaps:0.1.1@aar'
provided 'com.github.siekierskip.OPFMaps:opfmaps:v0.1.5'
provided 'org.onepf:opfutils:0.1.26'

compile 'org.osmdroid:bonuspack:5.3'
//noinspection NewerVersionAvailable
compile 'org.osmdroid:osmdroid-android:4.3'
compile 'org.osmdroid:osmdroid-android:5.6.4'
compile 'com.github.MKergall:osmbonuspack:6.3'

//noinspection NewerVersionAvailable
compile 'org.slf4j:slf4j-android:1.7.12'
Expand Down
6 changes: 3 additions & 3 deletions opfmaps-providers/osmdroid/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ POM_NAME = Osmdroid Map Provider
POM_ARTIFACT_ID = opfmaps-osmdroid
POM_DESCRIPTION = Osmdroid Map provider implementation for OPFMaps library
POM_PACKAGING = aar
POM_SCM_URL = https://github.com/onepf/OPFMaps.git
POM_SCM_CONNECTION = scm:[email protected]:onepf/OPFMaps.git
POM_SCM_DEV_CONNECTION = scm:[email protected]:onepf/OPFMaps.git
POM_SCM_URL = https://github.com/siekierskip/OPFMaps.git
POM_SCM_CONNECTION = scm:[email protected]:siekierskip/OPFMaps.git
POM_SCM_DEV_CONNECTION = scm:[email protected]:siekierskip/OPFMaps.git
1 change: 1 addition & 0 deletions opfmaps-providers/osmdroid/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-dontwarn okio.**
8 changes: 7 additions & 1 deletion opfmaps-providers/osmdroid/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.onepf.opfmaps.osmdroid">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.onepf.opfmaps.osmdroid">

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import org.onepf.opfmaps.model.OPFLatLng;
import org.onepf.opfmaps.model.OPFLatLngBounds;
import org.onepf.opfmaps.model.OPFUrlTileProvider.TileUrlProvider;
import org.osmdroid.util.BoundingBoxE6;
import org.osmdroid.util.BoundingBox;
import org.osmdroid.util.GeoPoint;

/**
Expand Down Expand Up @@ -102,7 +102,7 @@ public LatLngDelegate createLatLngDelegate(final double latitude, final double l
@Override
public LatLngBoundsDelegate createLatLngBoundsDelegate(@NonNull final OPFLatLng southwest,
@NonNull final OPFLatLng northeast) {
return new OsmdroidLatLngBoundsDelegate(new BoundingBoxE6(
return new OsmdroidLatLngBoundsDelegate(new BoundingBox(
northeast.getLat(),
northeast.getLng(),
southwest.getLat(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,13 @@ private static Map<OPFMapType, ITileSource> createDefaultTileSourceMap() {
final Map<OPFMapType, ITileSource> tileSourceMap = new HashMap<>();
tileSourceMap.put(OPFMapType.NONE, TileSourceFactory.MAPNIK);
tileSourceMap.put(OPFMapType.NORMAL, TileSourceFactory.MAPNIK);
tileSourceMap.put(OPFMapType.SATELLITE, TileSourceFactory.MAPQUESTAERIAL);
tileSourceMap.put(OPFMapType.SATELLITE, TileSourceFactory.MAPNIK);
tileSourceMap.put(OPFMapType.TERRAIN, TileSourceFactory.MAPNIK);
tileSourceMap.put(OPFMapType.HYBRID, TileSourceFactory.MAPNIK);

/*tileSourceMap.put(OPFMapType.SATELLITE, TileSourceFactory.MAPQUESTAERIAL);
tileSourceMap.put(OPFMapType.TERRAIN, TileSourceFactory.MAPQUESTOSM);
tileSourceMap.put(OPFMapType.HYBRID, TileSourceFactory.MAPQUESTOSM);
tileSourceMap.put(OPFMapType.HYBRID, TileSourceFactory.MAPQUESTOSM);*/
return tileSourceMap;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
import org.osmdroid.api.IGeoPoint;
import org.osmdroid.api.IMapController;
import org.osmdroid.bonuspack.overlays.GroundOverlay;
import org.osmdroid.bonuspack.overlays.InfoWindow;
import org.osmdroid.bonuspack.overlays.Marker;
import org.osmdroid.bonuspack.overlays.Polygon;
import org.osmdroid.bonuspack.overlays.Polyline;
import org.osmdroid.views.MapView;
import org.osmdroid.views.Projection;
import org.osmdroid.views.overlay.Marker;
import org.osmdroid.views.overlay.Overlay;
import org.osmdroid.views.overlay.Polygon;
import org.osmdroid.views.overlay.Polyline;
import org.osmdroid.views.overlay.infowindow.InfoWindow;

import java.util.Iterator;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public OsmdroidMapViewDelegate(final Context context) {
}

public OsmdroidMapViewDelegate(final Context context, @Nullable final OsmdroidMapOptions options) {
super(context, context.getResources().getInteger(R.integer.default_tile_size_pixels));
// super(context, context.getResources().getInteger(R.integer.default_tile_size_pixels));
super(context);
this.options = options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.onepf.opfmaps.model.OPFCameraUpdate;
import org.onepf.opfmaps.model.OPFLatLng;
import org.onepf.opfmaps.model.OPFLatLngBounds;
import org.osmdroid.util.BoundingBoxE6;
import org.osmdroid.util.BoundingBox;
import org.osmdroid.util.GeoPoint;

/**
Expand Down Expand Up @@ -60,7 +60,7 @@ public OPFCameraUpdate newLatLng(@NonNull final OPFLatLng latLng) {
@Override
public OPFCameraUpdate newLatLngBounds(@NonNull final OPFLatLngBounds bounds, final int padding) {
return new OPFCameraUpdate(new OsmdroidCameraUpdateDelegate(CameraUpdateFactory.newLatLngBounds(
new BoundingBoxE6(
new BoundingBox(
bounds.getNortheast().getLat(),
bounds.getNortheast().getLng(),
bounds.getSouthwest().getLat(),
Expand All @@ -77,7 +77,7 @@ public OPFCameraUpdate newLatLngBounds(@NonNull final OPFLatLngBounds bounds,
final int height,
final int padding) {
return new OPFCameraUpdate(new OsmdroidCameraUpdateDelegate(CameraUpdateFactory.newLatLngBounds(
new BoundingBoxE6(
new BoundingBox(
bounds.getNortheast().getLat(),
bounds.getNortheast().getLng(),
bounds.getSouthwest().getLat(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.onepf.opfmaps.delegate.model.CircleDelegate;
import org.onepf.opfmaps.model.OPFLatLng;
import org.onepf.opfutils.OPFLog;
import org.osmdroid.bonuspack.overlays.Polygon;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView;
import org.osmdroid.views.overlay.Polygon;

/**
* @author Roman Savin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.onepf.opfmaps.model.OPFBitmapDescriptor;
import org.onepf.opfmaps.model.OPFLatLng;
import org.onepf.opfmaps.model.OPFLatLngBounds;
import org.osmdroid.util.BoundingBoxE6;
import org.osmdroid.util.BoundingBox;
import org.osmdroid.util.GeoPoint;

/**
Expand Down Expand Up @@ -90,7 +90,7 @@ public float getBearing() {
@Nullable
@Override
public OPFLatLngBounds getBounds() {
final BoundingBoxE6 bounds = groundOverlayOptions.getBounds();
final BoundingBox bounds = groundOverlayOptions.getBounds();
if (bounds != null) {
return new OPFLatLngBounds(new OsmdroidLatLngBoundsDelegate(bounds));
}
Expand Down Expand Up @@ -168,7 +168,7 @@ public OsmdroidGroundOverlayOptionsDelegate position(@NonNull final OPFLatLng lo
@NonNull
@Override
public OsmdroidGroundOverlayOptionsDelegate positionFromBounds(@NonNull final OPFLatLngBounds bounds) {
groundOverlayOptions.positionFromBounds(new BoundingBoxE6(
groundOverlayOptions.positionFromBounds(new BoundingBox(
bounds.getNortheast().getLat(),
bounds.getNortheast().getLng(),
bounds.getSouthwest().getLat(),
Expand Down
Loading