Not able to display vector tile layer in MapLibre

1584
1
Jump to solution
02-13-2023 06:53 AM
Labels (1)
DanielDormont
New Contributor III

Hi, I'm starting to explore MapLibre and following the example in https://developers.arcgis.com/maplibre-gl-js/layers/add-a-vector-tile-layer/ but with a data set of my own. I added this pretty simple code:

 

 

 

 

      map.addSource("lights", {
        type: "vector",
        tiles: [
 'https://vectortileservices7.arcgis.com/kh264m9HYKfSLRfM/arcgis/rest/services/den_vector/VectorTileServer/tile/{z}/{y}/{x}.pbf'

        ]
      });

      map.addLayer({
        id: "parcels-fill",
		type: 'circle',
        source: "lights",
        "source-layer": "den_vector",
		'paint': {
			'circle-radius': 6,
			'circle-color': '#B42222'
		},
      });

 

 

 

 

and while my basemap renders just fine, nothing appears for the vector tile layer and I'm having trouble figuring out why not. Any ideas?

CodePen example: https://codepen.io/dandormont-the-decoder/pen/yLxBqby

The tile data is public so you should be able to view it with any key.  And the layer itself shows up just fine in AGOL: https://veoci.maps.arcgis.com/apps/mapviewer/index.html?layers=623a51817d69494ca303f6be5fe4afcb so I don't think it's a data issue. I've also tested with Leaflet and ArcGIS Javascript, those both are able to show it. Just trying to figure out how to make it work with MapLibre.  

Thanks,
Dan

0 Kudos
1 Solution

Accepted Solutions
DanielDormont
New Contributor III

Turns out it was my own mistake. I didn't realize that the source-layer within the vector tileset was not the same name I used when creating the layer. I'm not (yet) an expert in vector tile layers, as it turns out 🙂

I do see an issue which is that the feature properties seem to be missing, but that's not a MapLibre issue.

View solution in original post

1 Reply
DanielDormont
New Contributor III

Turns out it was my own mistake. I didn't realize that the source-layer within the vector tileset was not the same name I used when creating the layer. I'm not (yet) an expert in vector tile layers, as it turns out 🙂

I do see an issue which is that the feature properties seem to be missing, but that's not a MapLibre issue.