コード例 #1
0
void OnDisplay()
{
  osmscout::MapData data;

  projection.Set(osmscout::GeoCoord(lat,lon),
                 osmscout::Magnification(zoom),
                 DPI,
                 width,
                 height);

  if (!database.LoadData(projection,
                         data)) {
    std::cerr << "Cannot load data" << std::endl;
    return;
  }

  glClear(GL_COLOR_BUFFER_BIT);
  glLoadIdentity();

  //glTranslated(-width/2.0,-height/2.0,-9.0);
  //glRotatef(-15.0f,1.0f,0.0f,0.0f);

  if (!painter->DrawMap(projection,
                        drawParameter,
                        data)) {
    std::cerr << "Cannot render" << std::endl;
    return;
  }

  // swap buffers to display, since we're double buffered.
  glutSwapBuffers();
}
コード例 #2
0
void DBThread::GetProjection(osmscout::MercatorProjection& projection)
{
    QMutexLocker locker(&mutex);

    projection.Set(this->projection.GetCenter(),
                   this->projection.GetAngle(),
                   this->projection.GetMagnification(),
                   this->projection.GetDPI(),
                   this->projection.GetWidth(),
                   this->projection.GetHeight());
}