UNPKG

mappls-map-react-native

Version:

A Mappls GL react native module for creating custom maps

49 lines (33 loc) 3.33 kB
<!-- This file was autogenerated from VectorSource.js do not modify --> ## <MapplsGL.VectorSource /> ### VectorSource is a map content source that supplies tiled vector data in Mappls Vector Tile format to be shown on the map.<br/>The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification. ### props | Prop | Type | Default | Required | Description | | ---- | :--: | :-----: | :------: | :----------: | | id | `string` | `MapplsGL.StyleSource.DefaultSourceID` | `false` | A string that uniquely identifies the source. | | url | `string` | `none` | `false` | A URL to a TileJSON configuration file describing the source’s contents and other metadata. | | tileUrlTemplates | `array` | `none` | `false` | An array of tile URL templates. If multiple endpoints are specified, clients may use any combination of endpoints.<br/>Example: https://example.com/vector-tiles/{z}/{x}/{y}.pbf | | minZoomLevel | `number` | `none` | `false` | An unsigned integer that specifies the minimum zoom level at which to display tiles from the source.<br/>The value should be between 0 and 22, inclusive, and less than<br/>maxZoomLevel, if specified. The default value for this option is 0. | | maxZoomLevel | `number` | `none` | `false` | An unsigned integer that specifies the maximum zoom level at which to display tiles from the source.<br/>The value should be between 0 and 22, inclusive, and less than<br/>minZoomLevel, if specified. The default value for this option is 22. | | tms | `bool` | `none` | `false` | Influences the y direction of the tile coordinates. (tms inverts y axis) | | attribution | `string` | `none` | `false` | An HTML or literal text string defining the buttons to be displayed in an action sheet when the<br/>source is part of a map view’s style and the map view’s attribution button is pressed. | | onPress | `func` | `none` | `false` | Source press listener, gets called when a user presses one of the children layers only<br/>if that layer has a higher z-index than another source layers | | hitbox | `shape` | `none` | `false` | Overrides the default touch hitbox(44x44 pixels) for the source layers | | &nbsp;&nbsp;width | `number` | `none` | `true` | `width` of hitbox | | &nbsp;&nbsp;height | `number` | `none` | `true` | `height` of hitbox | ### methods #### features([layerIDs][, filter]) Returns all features that match the query parameters regardless of whether or not the feature is<br/>currently rendered on the map. The domain of the query includes all currently-loaded vector tiles<br/>and GeoJSON source tiles. This function does not check tiles outside of the visible viewport. ##### arguments | Name | Type | Required | Description | | ---- | :--: | :------: | :----------: | | `layerIDs` | `Array` | `No` | A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. | | `filter` | `Array` | `No` | an optional filter statement to filter the returned Features. | ```javascript vectorSource.features(['id1', 'id2']) ``` #### onPress(event) ##### arguments | Name | Type | Required | Description | | ---- | :--: | :------: | :----------: | | `event` | `n/a` | `Yes` | undefined |