A colleague pointed out that, when you change the style for a VectorTileLayer in the JavaScript Maps SDK, the browser goes and fetches tiles of data for that layer.
You can see/reproduce this behavior when looking at the CodePen example posted by @UndralBatsukh in an earlier thread in this forum.
Is this to be expected? Is it possibly a bug?
I was about to implement this behavior with a "mouseover" event. This would cause it to fire quite frequently as the user moves their cursor around over various features (even with some debouce handling). I wasn't expecting it to initiate any data fetches because it is just changing the color of an existing layer style.
[I can reproduce behavior running latest 4.31 version of the API].
Solved! Go to Solution.
Hi there,
This is expected behavior. When calling setStyleLayer, even if it modifies an existing layer—or adds a new one—the layer may have a different query or layout. As a result, we need to access the PBF (protocol buffer) and reprocess the features to ensure they align with the updated configuration. We fetch pbf for visible tiles.
Hi there,
This is expected behavior. When calling setStyleLayer, even if it modifies an existing layer—or adds a new one—the layer may have a different query or layout. As a result, we need to access the PBF (protocol buffer) and reprocess the features to ensure they align with the updated configuration. We fetch pbf for visible tiles.
Ah interesting thanks. I didn't think that queries or styling changes on the frontend would affect what was being fetched over the wire from the VectorTileServer. I figured it fetched everything as raw data and then drew what was needed according to whatever filters and/or styling rules were present on the ESRI layers.