Manage bookmarks

Loading

Code

#ifndef MANAGE_BOOKMARKS_H
#define MANAGE_BOOKMARKS_H

namespace Esri
{
  namespace ArcGISRuntime
  {
    class Map;
    class MapQuickView;
    class Viewpoint;
  }
}

class QStringList;
class QString;

#include <QAbstractListModel>
#include <QQuickItem>

class ManageBookmarks : public QQuickItem
{
  Q_OBJECT
  Q_PROPERTY(QAbstractListModel* bookmarks READ bookmarks NOTIFY bookmarksChanged)

public:
  explicit ManageBookmarks(QQuickItem* parent = nullptr);
  ~ManageBookmarks();

  void componentComplete() Q_DECL_OVERRIDE;
  static void init();
  Q_INVOKABLE void goToBookmark(int bookmarkIndex);
  Q_INVOKABLE void addBookmark(QString newBookmarkName);

signals:
  void bookmarksChanged();

private:
  void createInitialBookmarks();
  void createBookmark(QString name, Esri::ArcGISRuntime::Viewpoint viewpoint);
  QAbstractListModel* bookmarks() const;

private:
  Esri::ArcGISRuntime::Map* m_map = nullptr;
  Esri::ArcGISRuntime::MapQuickView* m_mapView = nullptr;
  QAbstractListModel* m_bookmarks = nullptr;
};

#endif // MANAGE_BOOKMARKS_H


In this topic
  1. Code