diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2018-03-27 00:39:59 +0300 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2018-08-20 22:49:01 +0300 |
commit | ca0f2f925d38c190957241f7fa2375a90fa87f45 (patch) | |
tree | 92b642bb87e1fd25e22bc9458ae6c7155237472f /platform/darwin/src/MGLShapeOfflineRegion.h | |
parent | 4fedcf8d061d835e71df80dbc20a32ee4ec8fd21 (diff) | |
download | qtlocation-mapboxgl-ca0f2f925d38c190957241f7fa2375a90fa87f45.tar.gz |
[darwin] arbitrary offline region geometries
Diffstat (limited to 'platform/darwin/src/MGLShapeOfflineRegion.h')
-rw-r--r-- | platform/darwin/src/MGLShapeOfflineRegion.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLShapeOfflineRegion.h b/platform/darwin/src/MGLShapeOfflineRegion.h new file mode 100644 index 0000000000..ac54dc137b --- /dev/null +++ b/platform/darwin/src/MGLShapeOfflineRegion.h @@ -0,0 +1,72 @@ +#import <Foundation/Foundation.h> + +#import "MGLFoundation.h" +#import "MGLOfflineRegion.h" +#import "MGLShape.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + An offline region defined by a style URL, geographic shape, and + range of zoom levels. + + This class requires fewer resources than MGLTilePyramidOfflineRegion + for irregularly shaped regions. + */ +MGL_EXPORT +@interface MGLShapeOfflineRegion : NSObject <MGLOfflineRegion, NSSecureCoding, NSCopying> + +/** + The shape for the geographic region covered by the downloaded + tiles. + */ +@property (nonatomic, readonly) MGLShape *shape; + +/** + The minimum zoom level for which to download tiles and other resources. + + For more information about zoom levels, `-[MGLMapView zoomLevel]`. + */ +@property (nonatomic, readonly) double minimumZoomLevel; + +/** + The maximum zoom level for which to download tiles and other resources. + + For more information about zoom levels, `-[MGLMapView zoomLevel]`. + */ +@property (nonatomic, readonly) double maximumZoomLevel; + +- (instancetype)init NS_UNAVAILABLE; + +/** + Initializes a newly created offline region with the given style URL, geometry, + and range of zoom levels. + + This is the designated initializer for `MGLShapeOfflineRegion`. + + @param styleURL URL of the map style for which to download resources. The URL + may be a full HTTP or HTTPS URL or a Mapbox URL indicating the style’s map + ID (`mapbox://styles/{user}/{style}`). Specify `nil` for the default style. + Relative file URLs cannot be used as offline style URLs. To download the + online resources required by a local style, specify a URL to an online copy + of the style. + @param shape The shape of the geographic region to be covered by + the downloaded tiles. + @param minimumZoomLevel The minimum zoom level to be covered by the downloaded + tiles. This parameter should be set to at least 0 but no greater than the + value of the `maximumZoomLevel` parameter. For each required tile source, if + this parameter is set to a value less than the tile source’s minimum zoom + level, the download covers zoom levels down to the tile source’s minimum + zoom level. + @param maximumZoomLevel The maximum zoom level to be covered by the downloaded + tiles. This parameter should be set to at least the value of the + `minimumZoomLevel` parameter. For each required tile source, if this + parameter is set to a value greater than the tile source’s minimum zoom + level, the download covers zoom levels up to the tile source’s maximum zoom + level. + */ +- (instancetype)initWithStyleURL:(nullable NSURL *)styleURL shape:(MGLShape *)shape fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END |