Using Tegola and Tegola-OSM I’ve been working on approximating the HOT OSM map style in Mapbox GL. Using the handy CartoCSS available for this style, by-eye comparisons with the raster tile map, and personal interpretation for the 3d building elements, we’ve got this going:
View the demo live here. It’ll be a bit slow and not so great at zoom 4, but we are working on that. I mean, it’s the OSM data of the entire world styled at all zoom levels (plus a bit of natural earth data for admin boundaries and more to come) so there’s a huge amount of data to work with here and lots of things to work out to get right.
If you aren’t familiar with vector tile maps, note that you can shift the pitch (tilt) via Ctrl + left-click + drag. That’s something that we cartographic consultants need to start teaching our clients. Also, different parts of the GL spec are operational on desktop vs iOS vs Android so depending on your device your results will vary a bit at this time.
Maputnik, for the most part, makes it “easy” to style a map as long as you have an endpoint like Tegola serving up some good data (the Tegola endpoint is still very much under development and is undergoing some optimizations and doesn’t have every single map item we’d like to have quite yet).
I say “easy” in quotes because as with everything there is still a learning curve and, as with everything, it is still under development as well. There are a few things that have to be added to the style.json by hand so anything beyond its interface capabilities will require knowledge of json.
Like the data-driven styling on the buildings in this map. You can see an example of that in the image above where the hospital building (type=hospital) is a bit reddish compared to the other buildings. In Maputnik this style still looks like all the buildings except the hospitals and schools are black whereas live it looks the way it is supposed to. Thus I await with eagerness the incorporation of all the cool new things available in the GL spec.
Here’s that bit of code for the building tilt data-driven styling. You can see the “default” property isn’t used and instead, mysteriously, the empty quote does the job for providing the default gray color.
One of the more interesting style choices that came up was where to put the road labels. Google maps puts road labels above 3d buildings when you view on your mobile device and tilt (two finger swipe). This might be ideal for a small amount of screen real estate when you’re using the map for navigation but I think that on larger screens and with different map purposes the street labels can look cleaner when they are beneath the 3d buildings. Take a look at this thread for some opinions on this:
How do we feel about labels floating above extruded buildings? pic.twitter.com/zpSrVuDCgU
— Gretchen Peterson (@PetersonGIS) April 18, 2017
————————————————————————————————————
Styling and stuff, Maputnik, WYSIWYG, osm, all the things except chocolate. https://t.co/Bhxm9zgGRs.
— Gretchen Peterson (@PetersonGIS) April 27, 2017
Great work as always @PetersonGIS Have you seen the @awesomeposm style, subtle changes for field data collection https://t.co/xjnDznikde https://t.co/BRGX41ZFJT
— Dale Kunce (@calimapnerd) April 27, 2017
@calimapnerd @awesomeposm No but I’ll definitely check it out. Thanks!
— Gretchen Peterson (@PetersonGIS) April 27, 2017
@PetersonGIS Wow – nice work! Some thoughts: initial view with no bldg borders and hard 1px shadows is too mazy/abstract. Antialiasing would really help.
— Tom Chadwin (@tomchadwin) April 27, 2017
@PetersonGIS @awesomeposm work is incomplete and yours is better _obviously_ but its our standard for now.
— Dale Kunce (@calimapnerd) April 27, 2017
Fun. New. Exciting! And Stuff. https://t.co/bkzjiY0ieu
— David Puckett (@BrightRain) April 27, 2017
Recent Comments