Display US State Abbreviations instead of full name on openMapTiles map? - openmaptiles

I'm using a locally hosted openMapTiles server with a custom style based on positron. I'm looking to have US State two letter abbreviations instead of State names on my maps. Is that data able to be referenced? If so, how do I pull it into the place_state layer?
I've tried these, but no abbreviations are shown.
{iso_a2:latin}{iso_a2:nonlatin}
{abbrev:latin}{abbrev:nonlatin}
How?

Related

Set language in Mapbox Static Image

I am using the Mapbox Static Image API to show users an image of a slice of a map relating to the page they are viewing. Our users are from many countries and expect properly localized country, city names etc.
Question
Is it possible to set the language of all labels in a Mapbox Static Image somehow?
I think I can achieve this by creating a Mapbox Studio Style for each language we want to support, but we have quite a lot of customization in our custom style so I would rather avoid having to manually maintain a version for all supported languages.
I have tried using the playground https://docs.mapbox.com/playground/static/ and also read through the documentation, without finding anything reminiscent of setting the locale
I think your only option is to create multiple styles for each language you want to support.
You probably use a call like this to get your map:
/styles/v1/{username}/{style_id}/static/{overlay}/{lon},{lat},{zoom},{bearing},{pitch}|{auto}/{width}x{height}{#2x}
Use javascript to find your users browser preferred language: How to get the browser language using JavaScript
and change your {style_id} to the requested language.
Another option that comes to mind is to try to use multiple layers.
All the background data and (complex) style in one layer, and make a separate layer with your labels. This way you only need to have different styles for your labels and the maintenance will be less of a hassle.

Is it still not possible to use english names for all countries even in non-english Countries in OpenStreetMaps

Not sure if this helps. I am using vue-leaflet and using OpenStreetMaps('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png') as tileProvider.
That's because your TileLayer URL tile.openstreetmap.org uses local names for labels. Labels in England will be in English, labels in France will be in French and so on.
If you want to have all-English labels then use an all-English tile server. Read map internationalization for more information. Also make sure to check the usage policy of the tile server you have chosen.
Please note that his question has already been answered dozens of time.

Search Mapbox dataset

I use a Mapbox dataset converted to a tileset to show features on a map. I would like to add a search facility which goes through all the features in the dataset (not only the one shown on the screen which I could search locally thanks to queryRenderedFeatures).
I do not see how to do this without implementing my own search facility server side. I would like to avoid that because it would mean my dataset needs to be stored at two different places (on Mapbox and on my server).
In this related question, someone suggested to use querySourceFeatures but it only checks features in the currently visible viewport.
Did I miss any search through dataset facility offered by Mapbox ?
You could use the Datasets API to download you whole GeoJSON dataset to the client, then using the mapbox-gl-geocoder's localGeocoder option implement you own custom search.

use one visualization with multiple filters

Let's say I have a visualization that is displaying production line output over time. There are 6 production lines and I only want to display one production line on the visualization at a time. I can add a Production Line filter to accommodate this.
I want to create a dashboard view for each production line. So I want to create 6 dashboard views each with the same visualization filtered for a different value. However, I do not know how to do this without creating a copy of the visualization and dictating the exact Production Line filter.
Reasons for doing this:
I want to publish the specific dashboards and be able to embed the view into a SharePoint site (that is Production Line specific) and not require the user to filter the view each time
If I make a change to visualization, I want it to be transferred to all dashboard views for all Production Lines and do not want to make the same change to 6 visualizations.
Is this possible?
You can't do it with a dashboard. Try doing it with stories though. Create one story point for each production line. You can drop a single copy of your viz onto multiple story points, each with filters independent of each other, and any changes to the worksheet will be reflected in all six story points.
Yes it is possible. You could use a story as Sam M says, with 6 views of your dashboard each with a different filter setting,
Another choice that works in the embedded viz use case is to create a single dashboard, and apply a filter to all the worksheets on that dashboard. When using Tableau Server, you can supply the filter value as a query parameter in the URL (see the documentation)
After you test it out and are happy with the result, you can remove the filter control from the dashboard so it is no longer visible. You can still control the filter setting via the URL (or via the JavaScript API)
This allows you to adjust the viz that users see in your embedded view without making them manually select the filter setting, and also without creating six nearly identical dashboards.

Leaflet choropleth map - polygon colors linked to spreadsheet?

I'm new to using Leaflet after having made some interactive choropleth maps using Mapbox's TileMill. If I add a custom polygon layer through using geoJSON, is there any way for me to symbolize (i.e. color) polygons based on values in a linked spreadsheet? What I'm trying to do is find a way to create an online interactive choropleth that can be automatically updated with current data just by making changes to a spreadsheet (i.e. Google doc) rather than adding a new geoJSON layer. Thank you for your help!
You can request your Google Spreadsheet data as JSON and then parse the data on the client-side, updating the data inside your geoJSON. Here's some more documentation via Google. Basically you'd call the spreadsheet, pass the spreadsheet data as JSON to a callback function, then have that function update your geoJSON with the new values. The basic API looks like this, where feed is the type of feed (either list or cell) you'd want and key is your Google Spreadsheet's key.
http://spreadsheets.google.com/feeds/feed/key/worksheet/public/basic?alt=json-in-script&callback=myFunc
It seems like you might have two different Qs there, and since I can't comment to ask for clarification, here are answers to both:
If you're referring to updating colors in Tilemill, then (the title of your question shouldn't refer to Leaflet, and) there's a pretty good workflow here for using a google spreadsheet as a Tilemill data source. Unfortunately though, fill colors are not data-driven properties, so you'll still need to assign colors conditionally in CartoCSS.
If you're referring to updating a thematic layer in the Leaflet client, then there are two options:
Write a script to populate this function and this line with values brought in from your google spreadsheet endpoint.
Use CartoDB. It does pretty much all of what your referring to, with live changes on a leaflet map as you update the table and CartoCSS styles. You can also synchronize a CartoDB table with a google spreadsheet.