Building CartoType for Linux
CartoType is written in standard C++ and will compile using CLANG and GCC. Its output is a bitmap in memory, which you can display on any device if you know how your proposed device handles bitmaps. The license allows you to distribute it as part of a binary package, not as source for on-platform compilation. Linux users tend to expect binary packages, so this should not be a problem.
To obtain a Linux library you can simply take the source code, which is supplied to Cartotype licensees, and compile it (using a script provided as part of the CartoType distribution) on the target you need. If you need the library pre-compiled for any reason please
Using CartoType on Linux
The simplest way to use CartoType on Linux is the high-level C++ CFramework API. It wraps all the various objects you need - the map, style sheet, fonts, and routing profiles - and gives you a simple set of functions for drawing the map, interacting with it and searching it, calculating routes and performing turn by turn navigation. The only platform-dependent code you need to write, apart from your application logic, is a routine to draw a CartoType bitmap to your display surface.
Sample code using GLFW
There is a simple demonstration program using the GLFW framework.
The prerequisites are:
- The CartoType Linux evaluation library, libcartotype.a, which is part of the evaluation SDK; you need to link the demo to it.
- The GLFW windowing library, which you will need to install on your Linux computer:
sudo apt-get update
sudo apt-get install libglfw3
sudo apt-get install libglfw3-dev - You may need to install OpenGL libraries on your Linux computer. I use Mesa, which may already be on your computer. If not, there are various ways to install Mesa. There is some guidance here: https://itsfoss.com/install-mesa-ubuntu/.
Sample code using Qt
The source code of the CartoType Maps App is also available. It uses Qt and runs on Windows, mac OS and Linux.