-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QMapboxGL got merged into Mapbox GL Native
Fixes #14
- Loading branch information
Showing
15 changed files
with
5 additions
and
11,784 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,11 @@ | ||
# QMapboxGL | ||
# QMapboxGL is now on the Mapbox GL Native tree! | ||
|
||
QMapboxGL is a Qt-enabled viewport for vector tiles using [Mapbox GL](https://github.com/mapbox/mapbox-gl-native) for rendering. It can be used for online and offline rendering of vector tiles. | ||
QMapboxGL got merged into [Mapbox GL Native](https://github.com/mapbox/mapbox-gl-native). | ||
|
||
### Demo | ||
You can browse the code [here](https://github.com/mapbox/mapbox-gl-native/blob/master/platform/qt). | ||
|
||
A simple example rendering the Mapbox base vector tiles layer based on [OpenStreetMap](http://www.openstreetmap.org) using different styles. | ||
|
||
 | ||
|
||
### Sample code | ||
|
||
```c++ | ||
#include <QtGui> | ||
#include <QMapboxGL> | ||
|
||
int main(int argc, char **argv) { | ||
QGuiApplication app(argc, argv); | ||
|
||
QFile data("/usr/share/mbgl/styles/emerald-v7.json"); | ||
data.open(QFile::ReadOnly); | ||
|
||
QTextStream style(&data); | ||
|
||
QMapboxGL map; | ||
map.setAccessToken(qgetenv("MAPBOX_ACCESS_TOKEN")); | ||
map.setStyleJSON(style.readAll()); | ||
|
||
map.resize(800, 600); | ||
map.show(); | ||
|
||
return app.exec(); | ||
} | ||
``` | ||
### Build instructions for Ubuntu Vivid or Debian Jessie | ||
##### Install the Mapbox GL development packages: | ||
``` | ||
$ sudo apt-add-repository ppa:tmpsantos/mapbox-gl | ||
$ sudo apt-get update | ||
$ sudo apt-get install libmbgl-dev | ||
``` | ||
##### Clone this repository and build: | ||
``` | ||
$ git clone https://github.com/tmpsantos/qmapboxgl.git | ||
$ cd qmapboxgl | ||
$ mkdir build | ||
$ cd build | ||
$ qmake .. | ||
$ make | ||
``` | ||
##### Run the example: | ||
You need to export `MAPBOX_ACCESS_TOKEN` if you are using vector tiles hosted at Mapbox servers. Get one access token for free [here](https://www.mapbox.com/). | ||
Try it now by cloning the Mapbox GL Native and running the following on Linux or OSX: | ||
|
||
``` | ||
$ MAPBOX_ACCESS_TOKEN=pk.XXXXXXXXXXXX ./qmapboxgl | ||
$ make run-qt-app | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.