Mapbox Studio: landuse=residential not available? - mapbox

I try to build a map for my stormchasing community. It is very important to see urban areas on the map. I tried to add a landuse=residential layer/filter but it seems Mapbox does not support this at all.
Any ideas or solutions on this?

You are correct that the Mapbox Streets v8 tileset does not contain a landuse=residential field. However, this type of data is available in OSM as shown here and can be downloaded using Overpass Turbo - you can refer to the "Add OpenStreetMap data to your Mapbox project" tutorial for steps on how to do that.
Once you've downloaded this data, you can upload it to your Mapbox account, add it as a new layer to your map, and style it accordingly.

Related

Mapbox Static API - How to use custom markers in GeoJSON overlay?

The docs say it's possible so I'm obviously missing something. So far I've tested different variations of marker-url and url- in the Mapbox playground with both single point and feature collections (as shown in the examples) but all I'm getting are the generic markers.
Any guidance to point me in the right direction?
https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/geojson({"type":"FeatureCollection","features":[{"type":"Feature","properties":{"url-":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2599,37.8098]}},{"type":"Feature","properties":{"url-":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2591,37.8062]}},{"type":"Feature","properties":{"url-":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2565,37.8063]}}]})/-122.2647,37.8006,12,0/1080x1080#2x?access_token={token}
This is not reflected in the official documentation, but in order to use a custom marker with a geojson overlay, you can rely on the marker-url property for your features.
If you update your request to the API to the following, you should achieve the desired result:
https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/geojson({"type":"FeatureCollection","features":[{"type":"Feature","properties":{"marker-url":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2599,37.8098]}},{"type":"Feature","properties":{"marker-url":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2591,37.8062]}},{"type":"Feature","properties":{"marker-url":"http%253A%252F%252Fwebsite.com%252Ffiles%252Fmarkers%252Fgreenpin.png"},"geometry":{"type":"Point","coordinates":[-122.2565,37.8063]}}]})/-122.2647,37.8006,12,0/1080x1080#2x?access_token={token}
Disclaimer: I currently work at Mapbox

Mapbox point is not as accurate as the point in Mapbox studio dataset

Hello
I started to work with mapbox about a month ago now but I'm stuck with some issues.
One of theses issues are related to the accuracy of the point displayed in Mapbox.
To sum up, I uploaded geojson data through mapbox studio dataset. When I look up for a particular point (to check) I see that the point is in the right place. However when I go the Mapbox Style editor and when I added the source of my previous dataset (I'm looking for the same point to check), I realized that the point is not at the right place anymore (few meters away).
Do you have any idea please ?
This the point in the dataset :
And the following is in mapbox style studio :
Thanks for your help !
I found the issue.
The issue came from the convertion from the dataset to the tileset...
When you upload your data through mapbox studio > dataset, to use these data you have to "transform" it into tileset (it is generated automatically to use it in mapbox studio style). So I was wondering if this transformation process removed some decimals or something. I looked to a lot of mapbox documentations page and I found this one. If I understood well the issue is caused by the zoom level (see the link above).
To bypass the "default" transformation from dataset to tileset, I tried to upload directly my geojson data through mapbox studio > tileset. But the issue was still present. I presume that they apply a default zoom level (Which limits accuracy) even through the mapbox studio tileset. I found a useful tool to modify the zoom level of a geojson data before uploading to mapbox studio tileset : tippecanoe
If I'm not wrong, according to the good options, the tool can choose the best zoom for the precisions of your coordinates. So, according to the documentation "If you aren't sure what options to use" I tried this :
tippecanoe -zg -o outputFile.mbtiles --drop-densest-as-needed inputData.geojson
Then I uploaded the outputFile into mapbox studio tileset and all the coordinates were well located !!

How to display MapBox data using ARCGIS JS API?

Suppose, I've a MapBox Dataset in the form of an URL/Link. How to display that data in a Web Application that uses ArcGIS-js-API.
Any help will be appreciated!
If your Mapbox Dataset is GeoJSON, you could use geojson-layer-js to add the layer to the map.
A sample app, to use Mapbox Style as a Web Tile Layer in Arcgis-JS-API 4.4. Uses Mapbox DatasetID to visualise Popup content of that Mapbox style/Data.
Helps to Visualise & Interact with Mapbox data using an ARCGIS JS API 4.4 application
https://github.com/hostasite/MapboxDataUsingArcGis4.4

Using OpenStreet map in website with LeafletJS to display heapmap

Is it possible to download OSM or embed OSM and use leafletjs on top of it to display heat map?
I have searched a lot and could not find anything related. I wanted something like this form Google Maps.
https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap
I did find the mapbox but we need to pay them. I need something open source.
Please suggest me.
You can create heatmaps with Leaflet by using the various available plugins:
http://leafletjs.com/plugins.html#heatmaps
However, you'll need some vector data to build a heatmap, not just the tilelayer. If you want to use OpenStreetMap to get your data, try a service like http://overpass-turbo.eu/ to download the things you want in this format.

MapQuest Android API and Mapnik

I have implemented MapQuest's Android API. In the documentation for the general API it says when using the OpenStreetMap data it is possible to use "Custom map tiles via the Mapnik style files". I was wondering if that meant that you could host your own tile server running Mapnik and get the API to use those tiles or something else. There is no more mention of this in any of the documentation that I can find. Can someone help me clear this up please?
The reference to using Mapnik style files has to do with the fact that MapQuest offers the style files to developers who want to tweak them and then generate their own tiles based on OpenStreetMap data. This isn't specific to the Android API, however, and the Android API does not support custom map tiles. I apologize for the confusion (I work at MapQuest).
As I know, you are right and you can't use custom tile styles but custom UI styles (UI styles guide)