美文网首页
MapboxGL.ShapeSource

MapboxGL.ShapeSource

作者: jadefan | 来源:发表于2019-10-23 11:05 被阅读0次

    <MapboxGL.ShapeSource />

    ShapeSource is a map content source that supplies vector shapes to be shown on the map.
    The shape may be a url or a GeoJSON object
    ShapeSource是提供要在地图上显示的矢量形状的地图内容源。形状可以是URL或GeoJSON对象

    props

    Prop Type Default Required
    id string MapboxGL.StyleSource.DefaultSourceID false

    A string that uniquely identifies the source.
    唯一标识源的字符串。

    url string none false

    An HTTP(S) URL, absolute file URL, or local file URL relative to the current application’s resource bundle.
    相对于当前应用程序资源包的HTTP(S)URL、绝对文件URL或本地文件URL。

    shape object none false

    The contents of the source. A shape can represent a GeoJSON geometry, a feature, or a feature colllection.
    源的内容。形状可以表示GeoJSON几何图形、要素或要素集合。

    cluster bool none false

    Enables clustering on the source for point shapes.
    在源上启用点形状的群集。

    clusterRadius number none false

    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.
    如果启用了群集,则指定每个群集的半径。值为512会产生等于平铺宽度的半径。默认值为50。

    clusterMaxZoomLevel number none false

    Specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value of maxZoomLevel so that, at the maximum zoom level, the shapes are not clustered.
    指定在启用聚类时聚集点的最大缩放级别。默认为比maxZoomLevel的值小一个缩放级别,以便在最大缩放级别时不会聚集形状。

    maxZoomLevel number none false

    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.
    指定创建矢量平铺的最大缩放级别。值越大,在高缩放级别下产生的细节越多。默认值为18。

    buffer number none false

    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.
    指定两边平铺缓冲区的大小。值为0时不会产生缓冲区。值为512会产生与拼贴本身一样宽的缓冲区。值越大,在平铺边缘附近产生的渲染瑕疵越少,性能越低。默认值为128。

    tolerance number none false

    Specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.
    指定Douglas-Peucker简化公差。值越大,生成的几何图形越简单,性能也越好。默认值为0.375。

    images object none false

    Specifies the external images in key-value pairs required for the shape source. If you have an asset under Image.xcassets on iOS and the drawables directory on android you can specify an array of string names with assets as the key { assets: ['pin'] }. Deprecated, please use Images#images.
    指定形状源所需的键-值对中的外部图像。如果iOS上Image.xcsets下有资产,Android上Drawables目录下有资产,则可以指定一个字符串名称数组,以Assets作为key{Assets:[‘pin’]}。已弃用,请使用Images#images。

    onPress func none false

    Source press listener, gets called when a user presses one of the children layers only if that layer has a higher z-index than another source layers
    数据点击侦听器,当用户按下子图层之一时,仅当该图层具有比另一个源图层更高的z索引时才会调用

    hitbox shape none false

    Overrides the default touch hitbox(44x44 pixels) for the source layers
    覆盖源层的默认触摸Hitbox(44x44像素

      width number none true

    --

      height number none true

    相关文章

      网友评论

          本文标题:MapboxGL.ShapeSource

          本文链接:https://www.haomeiwen.com/subject/nhwhvctx.html