Is it possible to fetch tile sets with data conditions without the GL version of mapbox? - mapbox

I am currently using leaflet (target systems do not have GPU's).
I'm looking to retrieve tile sets from mapbox styles but need to add data conditions but there doesn't seem to be a way based from documentation.

Related

Mapbox - Show point of interest markers regardless of zoom level

I'm filtering on the 'poi-label' layer on the default Mapbox Streets V8 data source. What I'd like to have is that certain maki or class labels like 'fitness-centere' to always be visible (both icon and label) regardless of the zoom level.
I see no clear documentation on how to do this using Mapbox studio. Can it be done in that tool?
It is generally not possible to have layers in vector tile sources display at "all zoom levels" because they don't exist at all zoom levels within the vector tile sources.
Generally, the Mapbox tilesets are heavily optimised and only include data at the zoom levels that they are intended to display at in the corresponding Mapbox styles.

Mapbox gl change poi_label name style using geocoder search result

I'm using Mapbox gl for showing POI in using the geocoder. for some reason, the location of most of the poi is not accurate, because this marker is not getting placed on the POI. Is it possible to change the poi label style based upon the search result? I know using setLayoutProperty we can change all the poi label names but I want to change the specific poi name which comes out of the geocoder search result. Any help is much appreciated.
Adding more information, I'm creating a marker using the geocoder results, however, there were a good amount of restaurants whose marker is positioned away from the actual location. Maybe because of the incorrect coordinates. So the idea is to change the style of the restaurant name in the map instead of creating a maker, this will remove the marker floating around the wrong location.
My question is it possible to do such kind of styling or is there a way we can get more accurate coordinates. I could able to see using SetLayoutProperty for "POI_LABLE" we can change the styles of the name attribute. Is it possible to apply a filter here and change the style of the matched name?. Thanks for looking into this question.
Styles which use Mapbox Streets data show POIs from OpenStreetMap data unless you are in Japan, this is documented at https://docs.mapbox.com/vector-tiles/reference/mapbox-streets-v8/#data-sources--updates.
According to https://docs.mapbox.com/help/how-mapbox-works/geocoding/#source-data,
The Mapbox Geocoding API contains data sources from governments, open data projects, and private companies. In some cases, results from the Geocoding API may differ from Mapbox Streets or OpenStreetMap data.
So the POI results from the Mapbox Geocoder aren't guaranteed to be the same as those POIs shown on the map as they come from different data sources, hence won't always be in the same location and aren't linked with any form of ID.

Leaflet - How to query rendered features in Vector tiles

I am new to leaflet. currently I am working on leaflet to render vector tiles. my application's requirement is that on click i should get features from map tiles in geojson format.
In Mapbox map.queryRenderedFeatures(e.point). I want to do exact same thing, but in leaflet. Please check here to check how mapbox is fetching features.
Please help.
Current Leaflet implementation does not supports querying rendered features. Hence switching to Mapboxgl

How to access vector objects in mapbox styles(road, water etc.)?

In mapbox studio I have a lot of layers for customizations. Is there a way to access those layers programmatically with js. For example hide all WATER or ROAD layer on the map with js?
Thanks.
You can try using https://github.com/mapbox/vt2geojson to get geojson data for whichever layers you are interested in and then use this data and add styling using mapbox gl js maps.
Hope that answers your question.

Mapbox GL / style - data separation

I have played with Mapbox and can quite easily create a Choropleth map in Mapbox studio and interact with it in Javascript.
I would like to create Choropleth map of the states with the ability to change the colours of the states for 100 years of different data points. I'm not allowed to upload the data into Mapbox as its sensitive healthcare data and I can't get sign of for the $499 a month cost.
My idea is I create a mapbox style layer in MapBox Studio then push the data client side for each of the states depending on the year x that the user selects. I have seen quite a few cloropeth tutorials such as this https://www.mapbox.com/help/choropleth-studio-gl-pt-1/ but the data is added in through a layer in Mapbox Studio. My thoughts are to embed the large GeoJson in the style and only push the data to the Polygon ID's, whilst creating transtions between the two.
Does anyone have any ideas if this is possible? and perhaps any useful API requests which may help me achieve this https://www.mapbox.com/api-documentation/.
It's possible. There are two approaches:
Upload the geometry as a Dataset in Studio, or load it directly as a GeoJSON.
Set data attributes directly on the geometry.
Create a style with data-driven styles (eg, map "47" to "rgb(100,0,0)" and "153" to "rgb(250,250,0)" and let Mapbox interpolate.
Or:
Upload the geometry as a Tileset to Studio.
Calculate the color you want to represent each possible value of each state.
Generate a data-driven style property that maps each state's code to the color you want, like ...['FL','rgb(143,15,0)']....
Neither method will cope with large numbers of regions, but should be ok for 50 US states at low resolution.
More discussion here: https://github.com/mapbox/mapbox-gl-js/issues/4261