Acquisition of attribute data for MVT data

699
2
02-10-2021 01:48 AM
TakahiroKAMIYA
Esri Contributor

Hi,

As for the attribute data of MVT data, in Mapbox GL JS, I can get it as follows, but can't I get it in ArcGIS API for JavaScript?

 

map.on("click", "japan_ver821_layer", (e) => {
	const value = e.features[0];
	console.log(value)
	
	new mapboxgl.Popup()
		.setHTML(`<b>${value.properties.KEN}</b>${value.properties.SIKUCHOSON}`)
		.setLngLat(e.lngLat)
		.addTo(map);
});

 

スクリーンショット 2021-02-10 18.39.51.png

The code we used is shown below.

 https://github.com/tkamiya0625/Arc-MVT

ArcGIS API for JavaScript

https://tkamiya0625.github.io/Arc-MVT/20210210/arcgis.html

Mapbox GL JS

https://tkamiya0625.github.io/Arc-MVT/20210210/mapbox.html

 

 

0 Kudos
2 Replies
JohnGrayson
Esri Regular Contributor

Are you trying to get back data from the GeoJson layer?

https://github.com/tkamiya0625/Arc-MVT/blob/main/20210210/arcgis.html#L88

Q: Maybe try this?

const opts = {
  include: geoJSONLayer
};

 

0 Kudos
TakahiroKAMIYA
Esri Contributor

Thank you very much.
No, I want to get the data from the following vector tile.

 

 const tileLayer = new VectorTileLayer({
          title: "National City Boundary Data (Vector Tile)",
          url: ". /style.json",
          opacity: 0.5
  });

 

I understand how to get attribute data from GeoJSON.

0 Kudos