You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. *
  3. * This file is part of QMapControl,
  4. * an open-source cross-platform map widget
  5. *
  6. * Copyright (C) 2007 - 2008 Kai Winter
  7. * Copyright (C) 2014 Mattes Jaehne
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Lesser General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public License
  20. * along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. * original software by Kai Winter
  23. * Contact e-mail: kaiwinter@gmx.de
  24. * Program URL : http://qmapcontrol.sourceforge.net/
  25. *
  26. * modified to use Bing Maps by
  27. * Mattes Jaehne <mattes@dev.uavp.ch>
  28. * for
  29. * NGOS - The Next Generation multicopter OS
  30. * http://ng.uavp.ch
  31. *
  32. */
  33. #ifndef BINGAPIMAPADAPTER_H
  34. #define BINGAPIMAPADAPTER_H
  35. #include "qmapcontrol_global.h"
  36. #include "tilemapadapter.h"
  37. class bingApiMapadapter : public TileMapAdapter {
  38. // Q_OBJECT
  39. public:
  40. bingApiMapadapter(QString mapType = "Road", QString apiKey = "");
  41. virtual ~bingApiMapadapter();
  42. virtual QPoint coordinateToDisplay(const QPointF&) const;
  43. virtual QPointF displayToCoordinate(const QPoint&) const;
  44. void setKey(QString apiKey);
  45. void setMapType(QString mapType); /* Aerial, AerialWithLabels, Road */
  46. protected:
  47. virtual void zoom_in();
  48. virtual void zoom_out();
  49. private:
  50. virtual QString getQ(qreal longitude, qreal latitude, int zoom) const;
  51. qreal getMercatorLatitude(qreal YCoord) const;
  52. qreal getMercatorYCoord(qreal lati) const;
  53. qreal coord_per_x_tile;
  54. qreal coord_per_y_tile;
  55. int srvNum;
  56. QString myKey;
  57. QString myMapType;
  58. };
  59. #endif // BINGAPIMAPADAPTER_H