I've wanted to write a GLES 2 map renderer for ages -- ever since I saw that the Apple Maps app on iOS uses MSAA for antialiasing (yuck!).
It's funny to see all the usual 2D suspects in the source (clipper, GLU tessellator). They used a distance-based edge shader for antialiasing, so it should look much better than MSAA.
I'm not sure why there's a bias factor of 2 in the "raster" fragment shader -- looks like it might have been added by accident. It's interesting that they use both the stencil and depth buffers for clipping -- I hope they do a write up on some of the techniques they developed!
> I'm not sure why there's a bias factor of 2 in the "raster" fragment shader -- looks like it might have been added by accident.
Yes, that was an accident. Thanks for noticing! We definitely have a lot of information to share about the process. Regarding clipping, we're not sure yet whether what we have right now is the best thing; there will certainly be improvements in that area.
From looking at the build code, you should be able to just set CC=gcc-4.9 and CXX=g++-4.9 in your environment.
This is a pretty standard practice and the reason that it's set to "gcc-4.8" rather than "gcc" by default is because it requires real C++11 support in order to compile.
This is really cool. It seems that instead of using mipmaps to generate a map, they are using a combination of curves and 2D shapes. This is very smart since the data is not only more compact but can also be visualised in a very fluid manner. The bottleneck is now the GPU instead of the data connection. Give me the ability to download a city's map on Android and I'm dropping google maps like a brick.
Yes, the data is fairly compact. Data for the entire world enough for rendering to zoom level 18 generally comes in under 35GB (give or take 10 GB depending on what features you need). If you need to got to zoom levels approaching ~18 then there is no way to do this with image tiles. Vector tiles are the more efficient way. More details on the encoding at https://github.com/mapbox/vector-tile-spec and the encoder at https://github.com/mapbox/mapnik-vector-tile
Unfortunately AFAIK most of them are missing many of the things that makes Google maps useful. Real time traffic data, real time road closure data, updated public transportation schedules and closures, search by something other than address, ...
Also I believe online vector based maps teams found that vector map data was actually larger than tiled map data. I thought as you did lines = smaller but lines + colors + line weights + building outlines + elevation contours + street names + road direction info etc adds up were as jpeg tiles can be pretty lossy.
I played around with the demo map and the scrolling was indeed super quick, along with zoom level changes. If they could do the same thing with WebGL so that we'd have vector maps in the browser (like Google maps) that would be awesome. The competition would be good for everyone.
The vector map demo on the page has a serious issue with street names not showing up until you zoom way in, so far in that you can't see the context of the street anymore.
I assume this is for performance purposes, but it makes the map feel much less usable than Apple Maps in my opinion.
Of course. I've used Mapbox before and messed around with customizing the stylesheets. But the reality is that creating your own stylesheets is a level of effort and attention to detail that most projects/startups can't afford to take on, at least not at first.
The default stylesheets should look good and work well out of the box. Then if you have the time and manpower to customize them further great.
One of the design goals with GL was to support cascading styles, so you can start with the predefined world map and just provide deltas of the things you want to change. For example: "Hide the buildings, set the text font to X, swap the stacking order of layers A and B, and override the default park color to blue".
Does anyone know if they are planning perspective (affine) transformation? Specifically, relief maps drawn at the correct (or exaggerated) elevation, with the labels still drawn upright?
You might want to use a nice HTML5 video instead of a .gif, then. It didn't make for a good first impression.