diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-03-30 06:42:47 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-04-02 10:42:54 -0700 |
commit | 9faed7293b0585c329f4993b865b1fb820cfab65 (patch) | |
tree | 3c7570a670e4dd4954dc60d495609ac3f249e1f0 /platform/darwin/src/MGLShapeSource.h | |
parent | a877b6dbe8ff576f82ab9222f418da51591dd423 (diff) | |
download | qtlocation-mapboxgl-9faed7293b0585c329f4993b865b1fb820cfab65.tar.gz |
[ios, macos] Eliminated MGLAbstractShapeSource
MGLComputedShapeSource is now a direct subclass of MGLSource and sibling of MGLShapeSource.
Diffstat (limited to 'platform/darwin/src/MGLShapeSource.h')
-rw-r--r-- | platform/darwin/src/MGLShapeSource.h | 92 |
1 files changed, 88 insertions, 4 deletions
diff --git a/platform/darwin/src/MGLShapeSource.h b/platform/darwin/src/MGLShapeSource.h index 929609e91f..6f7ca00bc8 100644 --- a/platform/darwin/src/MGLShapeSource.h +++ b/platform/darwin/src/MGLShapeSource.h @@ -1,12 +1,92 @@ -#import "MGLAbstractShapeSource.h" - #import "MGLFoundation.h" #import "MGLTypes.h" -#import "MGLShape.h" +#import "MGLSource.h" NS_ASSUME_NONNULL_BEGIN @protocol MGLFeature; +@class MGLShape; + +/** + Options for `MGLShapeSource` objects. + */ +typedef NSString *MGLShapeSourceOption NS_STRING_ENUM; + +/** + An `NSNumber` object containing a Boolean enabling or disabling clustering. + If the `shape` property contains point shapes, setting this option to + `YES` clusters the points by radius into groups. The default value is `NO`. + + This attribute corresponds to the + <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-cluster"><code>cluster</code></a> + source property in the Mapbox Style Specification. + + This option only affects point features within a shape source. + */ +extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClustered; + +/** + An `NSNumber` object containing an integer; specifies the radius of each + cluster if clustering is enabled. A value of 512 produces a radius equal to + the width of a tile. The default value is 50. + */ +extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClusterRadius; + +/** + An `NSNumber` object containing an integer; specifies the maximum zoom level at + which to cluster points if clustering is enabled. Defaults to one zoom level + less than the value of `MGLShapeSourceOptionMaximumZoomLevel` so that, at the + maximum zoom level, the shapes are not clustered. + + This attribute corresponds to the + <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-clusterMaxZoom"><code>clusterMaxZoom</code></a> + source property in the Mapbox Style Specification. + */ +extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMaximumZoomLevelForClustering; + +/** + An `NSNumber` object containing an integer; specifies the minimum zoom level at + which to create vector tiles. The default value is 0. + + This attribute corresponds to the + <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-minzoom"><code>minzoom</code></a> + source property in the Mapbox Style Specification. + */ +extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMinimumZoomLevel; + +/** + An `NSNumber` object containing an integer; specifies the maximum zoom level at + which to create vector tiles. A greater value produces greater detail at high + zoom levels. The default value is 18. + + This attribute corresponds to the + <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-maxzoom"><code>maxzoom</code></a> + source property in the Mapbox Style Specification. + */ +extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMaximumZoomLevel; + +/** + An `NSNumber` object containing an integer; specifies the size of the tile + buffer on each side. A value of 0 produces no buffer. A value of 512 produces a + buffer as wide as the tile itself. Larger values produce fewer rendering + artifacts near tile edges and slower performance. The default value is 128. + + This attribute corresponds to the + <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-buffer"><code>buffer</code></a> + source property in the Mapbox Style Specification. + */ +extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionBuffer; + +/** + An `NSNumber` object containing a double; specifies the Douglas-Peucker + simplification tolerance. A greater value produces simpler geometries and + improves performance. The default value is 0.375. + + This attribute corresponds to the + <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-tolerance"><code>tolerance</code></a> + source property in the Mapbox Style Specification. + */ +extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance; /** `MGLShapeSource` is a map content source that supplies vector shapes to be @@ -16,6 +96,10 @@ NS_ASSUME_NONNULL_BEGIN `MGLStyle` object along with an `MGLVectorStyleLayer` object. The vector style layer defines the appearance of any content supplied by the shape source. You can update a shape source by setting its `shape` or `URL` property. + + `MGLShapeSource` is optimized for data sets that change dynamically and fit + completely in memory. For large data sets that do not fit completely in memory, + use the `MGLComputedShapeSource` or `MGLVectorTileSource` class. Each <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson"><code>geojson</code></a> @@ -41,7 +125,7 @@ NS_ASSUME_NONNULL_BEGIN ``` */ MGL_EXPORT -@interface MGLShapeSource : MGLAbstractShapeSource +@interface MGLShapeSource : MGLSource #pragma mark Initializing a Source |