summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLVectorSource.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLVectorSource.h')
-rw-r--r--platform/darwin/src/MGLVectorSource.h79
1 files changed, 23 insertions, 56 deletions
diff --git a/platform/darwin/src/MGLVectorSource.h b/platform/darwin/src/MGLVectorSource.h
index 6cfab09489..f91a0cbb23 100644
--- a/platform/darwin/src/MGLVectorSource.h
+++ b/platform/darwin/src/MGLVectorSource.h
@@ -1,68 +1,35 @@
-#import "MGLSource.h"
-#import "MGLTypes.h"
-
-@class MGLTileSet;
+#import "MGLTileSource.h"
NS_ASSUME_NONNULL_BEGIN
/**
- A vector tile source. Tiles must be in Mapbox Vector Tile format.
-
- @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-vector">The
- style specification.</a>
- */
-@interface MGLVectorSource : MGLSource
-
-#pragma mark Initializing a Source
-
-/**
- Returns a vector source initialized with an identifier and TileJSON URL.
+ `MGLVectorSource` is a map content source that supplies tiled vector data in
+ <a href="https://www.mapbox.com/vector-tiles/">Mapbox Vector Tile</a> format to
+ be shown on the map. The location of and metadata about the tiles are defined
+ either by an option dictionary or by an external file that conforms to the
+ <a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>.
+ A vector source is added to an `MGLStyle` object along with one or more
+ `MGLVectorStyleLayer` objects. A vector style layer defines the appearance of
+ any content supplied by the vector source.
- After initializing and configuring the source, add it to a map view’s style
- using the `-[MGLStyle addSource:]` method.
+ Each
+ <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-vector"><code>vector</code></a>
+ source defined by the style JSON file is represented at runtime by an
+ `MGLVectorSource` object that you can use to initialize new style layers. You
+ can also add and remove sources dynamically using methods such as
+ `-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`.
- @param identifier A string that uniquely identifies the source in the style to
- which it is added.
- @param url A URL to a TileJSON configuration file describing the source’s
- contents and other metadata.
- @return An initialized vector source.
+ Within each vector tile, each geometric coordinate must lie between
+ −1&nbsp;×&nbsp;<var>extent</var> and
+ (<var>extent</var>&nbsp;×&nbsp;2)&nbsp;−&nbsp;1, inclusive. Any vector style
+ layer initialized with a vector source must have a non-`nil` value in its
+ `sourceLayerIdentifier` property.
*/
-- (instancetype)initWithIdentifier:(NSString *)identifier URL:(NSURL *)url NS_DESIGNATED_INITIALIZER;
-
-/**
- Returns a vector source initialized an identifier and tile set.
+@interface MGLVectorSource : MGLTileSource
- After initializing and configuring the source, add it to a map view’s style
- using the `-[MGLStyle addSource:]` method.
-
- @param identifier A string that uniquely identifies the source in the style to
- which it is added.
- @param tileSet A tile set describing the source’s contents and other metadata.
- @return An initialized vector source.
- */
-- (instancetype)initWithIdentifier:(NSString *)identifier tileSet:(MGLTileSet *)tileSet NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL NS_DESIGNATED_INITIALIZER;
-#pragma mark Accessing a Source’s Content
-
-/**
- A URL to a TileJSON configuration file describing the source’s contents and
- other metadata.
-
- The URL may be a full HTTP or HTTPS URL or a Mapbox URL indicating the tile
- set’s map ID (`mapbox://<mapid>`).
-
- If the receiver was initialized using `-initWithIdentifier:tileSet:`, this
- property is set to `nil`.
- */
-@property (nonatomic, readonly, copy) NSURL *URL;
-
-/**
- A tile set describing the source’s contents and other metadata.
-
- If the receiver was initialized using `-initWithIdentifier:URL:`, this property
- is set to `nil`.
- */
-@property (nonatomic, readonly, nullable) MGLTileSet *tileSet;
+- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NS_ARRAY_OF(NSString *) *)tileURLTemplates options:(nullable NS_DICTIONARY_OF(MGLTileSourceOption, id) *)options NS_DESIGNATED_INITIALIZER;
@end