Loyalist1
Loyalist1

Reputation: 120

cant find source-Layer Ids after reading Vector Tile using vector-tile JS library

I took a vector tile to read the Layer and its corresponding features.

I found

My layer is "Landuse" I found all the features that are inside the "Landuse" Layer. I know that some of the features belong to Cemetry, Education etc..

The problem is , i am not able to find the ID of each feature like its been represented in the StyleSheet.

With out the "id", i cannot cannot seperate and display my features with in "landuse" layer

Here is one sample from the style sheet

 "id": "landuse_cemetery",
            "source": "orgVector",
            "source-layer": "landuse",
            "type": "fill",
            "minzoom": 11

My question is how to get the "id" along with features?

Please help me if i am missing some thing while reading the MVT tile.

Upvotes: 0

Views: 811

Answers (1)

Steve Bennett
Steve Bennett

Reputation: 126245

You're confusing vector tile layers and style layers.

Your vector tiles contain a layer called landuse.

Your style can contain layers called whatever they want. In this case your style layer is called landuse_cemetery, but you could call it something else. The link between your style layer and the vector tile layer is this:

        "source-layer": "landuse",

If you want your cemetery layer to only include cemeteries, you probably want to add a further filter, which make use of other attributes in the data.

You can use Vector Inspector to better understand what those are.

Upvotes: 1

Related Questions