0
votes

I'd like to do exactly what https://api.mapbox.com/styles/v1/zugaldia/cimteac7b00mrb8m7okkkol8d.html?title=true&access_token=pk.eyJ1IjoienVnYWxkaWEiLCJhIjoiY2ltNnI0YXM0MDA0YXR5bHgxOTU0N2h5YyJ9.kBUkyDqT5S1gJOsMIAdJSw#11/38.8993/-77.0146 is doing.

It seems to use the MapBox GL tileset and style to place text on the map. It even shows more text at a zoomed in level.

How do we do that?

Can you point to a detailed example or video that shows the steps for loading the tileset (maybe from a GeoJSON file, etc)

Thanks.

It is really nice that we can do so much without javascript at all :)

This makes it easier for Android and iOS etc.

Notice the text for the School names:

enter image description here

Then when you zoom in, you see the text for the crime:

enter image description here

1

1 Answers

1
votes

That is indeed a very nice map, he created it using Mapbox Studio uploading crime and school data as layer sources. You can learn more about creating your own map style by following along with the "design a map" guides. Once you've created a map you'll need to get the style ID by doing this:


(source: mapbox.com)

and then...


(source: mapbox.com)

Now you also mentioned using these maps within your Android or iOS app which is similar to using the api (link you gave above). Follow this example about including Mapbox studio style in your Android app. The example places the style url within XML like so:

<com.mapbox.mapboxsdk.maps.MapView

...

    mapbox:style_url="mapbox://styles/<your-account-name>/<your-style-ID>"
/>

Hope this helps!