From 01e55f183e4468d040e7b144536ca592c9b64cb5 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Wed, 17 Feb 2016 10:55:12 -0500 Subject: # This is a combination of 8 commits. # The first commit's message is: # This is a combination of 2 commits. # The first commit's message is: # This is a combination of 3 commits. # The first commit's message is: # This is a combination of 2 commits. # The first commit's message is: # This is a combination of 21 commits. # The first commit's message is: [android] - Implements Android bindings for offline API Fixes #3891 # The 2nd commit message will be skipped: # [android] #3891 - rename OFFLINE_MAX_CACHE_SIZE to DEFAULT_MAX_CACHE_SIZE and adjust value # The 3rd commit message will be skipped: # [android] #3891 - makes de documentation more relevant to the current android implementation # The 4th commit message will be skipped: # [android] #3891 - rename isRequiredResourceCountIsIndeterminate() to isRequiredResourceCountPrecise() # The 5th commit message will be skipped: # [android] #3891 - rename complete() to isComplete() # The 6th commit message will be skipped: # [android] #3891 - rename OfflineRegionDefinition to OfflineTilePyramidRegionDefinition and make OfflineRegionDefinition an interface. Docs for corresponding classes updated. # The 7th commit message will be skipped: # [android] #3891 - make reason a more idiomatic ErrorReason Android IntDef and remove unnecessary constructor # The 8th commit message will be skipped: # [android] #3891 - reuse the calling object instead of creating a new manager # The 9th commit message will be skipped: # [android] #3891 - location, location, location # The 10th commit message will be skipped: # [android] #3891 - simpler list regions iteration # The 11th commit message will be skipped: # [android] #3891 - proper indeterminate -> precise transition # The 12th commit message will be skipped: # [android] #3891 - improve description for DEFAULT_MAX_CACHE_SIZE # The 13th commit message will be skipped: # [android] #3891 - delete global refs for obj and listCallback # The 14th commit message will be skipped: # [android] #3891 - simplify metadata conversion and fix metadata object # The 15th commit message will be skipped: # [android] - Implements Android bindings for offline API # Fixes #3891 # The 16th commit message will be skipped: # [android] #3891 - avoid exposing the int reason value in the public API # The 17th commit message will be skipped: # [android] #3891 - delete global refs for remaining callbacks and observer # The 18th commit message will be skipped: # [android] #3891 - remove unused offlineManagerClassConstructorId together with unnecessary private java constructor # The 19th commit message will be skipped: # [android] #3891 - remove non-relevant line # The 20th commit message will be skipped: # [android] #3891 - handle requiredResourceCountIsIndeterminate -> requiredResourceCountIsPrecise rename # The 21st commit message will be skipped: # [android] #3891 - revert map changes to allow rebase # The 2nd commit message will be skipped: # [android] #3891 - avoid exposing the int reason value in the public API # The 2nd commit message will be skipped: # [android] #3891 - rename complete() to isComplete() # The 3rd commit message will be skipped: # [android] #3891 - rename OfflineRegionDefinition to OfflineTilePyramidRegionDefinition and make OfflineRegionDefinition an interface. Docs for corresponding classes updated. # The 2nd commit message will be skipped: # [android] #3891 - location, location, location # The 2nd commit message will be skipped: # [android] #3891 - improve description for DEFAULT_MAX_CACHE_SIZE # The 3rd commit message will be skipped: # [android] #3891 - delete global refs for obj and listCallback # The 4th commit message will be skipped: # [android] #3891 - simplify metadata conversion and fix metadata object # The 5th commit message will be skipped: # [android] #3891 - delete global refs for remaining callbacks and observer # The 6th commit message will be skipped: # [android] #3891 - remove unused offlineManagerClassConstructorId together with unnecessary private java constructor # The 7th commit message will be skipped: # [android] #3891 - remove non-relevant line # The 8th commit message will be skipped: # [android] #3891 - handle requiredResourceCountIsIndeterminate -> requiredResourceCountIsPrecise rename --- .../OfflineTilePyramidRegionDefinition.java | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java new file mode 100644 index 0000000000..5a0be6b33f --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.java @@ -0,0 +1,65 @@ +package com.mapbox.mapboxsdk.offline; + +import com.mapbox.mapboxsdk.geometry.LatLngBounds; + +/** + * An offline region defined by a style URL, geographic bounding box, zoom range, and + * device pixel ratio. + * + * Both minZoom and maxZoom must be ≥ 0, and maxZoom must be ≥ minZoom. + * + * maxZoom may be ∞, in which case for each tile source, the region will include + * tiles from minZoom up to the maximum zoom level provided by that source. + * + * pixelRatio must be ≥ 0 and should typically be 1.0 or 2.0. + */ +public class OfflineTilePyramidRegionDefinition implements OfflineRegionDefinition { + + private String styleURL; + private LatLngBounds bounds; + private double minZoom; + private double maxZoom; + private float pixelRatio; + + /* + * Constructors + */ + + private OfflineTilePyramidRegionDefinition() { + // For JNI use only + } + + public OfflineTilePyramidRegionDefinition( + String styleURL, LatLngBounds bounds, double minZoom, double maxZoom, float pixelRatio) { + this.styleURL = styleURL; + this.bounds = bounds; + this.minZoom = minZoom; + this.maxZoom = maxZoom; + this.pixelRatio = pixelRatio; + } + + /* + * Getters + */ + + public String getStyleURL() { + return styleURL; + } + + public LatLngBounds getBounds() { + return bounds; + } + + public double getMinZoom() { + return minZoom; + } + + public double getMaxZoom() { + return maxZoom; + } + + public float getPixelRatio() { + return pixelRatio; + } + +} -- cgit v1.2.1