summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/esri/geotiledmap_esri.cpp
blob: 08b8f09b75923d28c5df58bece2cfe6e46a20a62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (C) 2013-2018 Esri <contracts@esri.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "geotiledmap_esri.h"
#include "geotiledmappingmanagerengine_esri.h"

#include <QtLocation/private/qgeotilespec_p.h>

QT_BEGIN_NAMESPACE

GeoTiledMapEsri::GeoTiledMapEsri(GeoTiledMappingManagerEngineEsri *engine, QObject *parent) :
    Map(engine, parent), m_engine(engine), m_mapId(-1)
{
}

GeoTiledMapEsri::~GeoTiledMapEsri()
{
}

void GeoTiledMapEsri::evaluateCopyrights(const QSet<QGeoTileSpec> &visibleTiles)
{
    if (visibleTiles.isEmpty())
        return;

    QGeoTileSpec tile = *(visibleTiles.constBegin());
    if (tile.mapId() == m_mapId)
        return;

    m_mapId = tile.mapId();

    GeoMapSource *mapSource = engine()->mapSource(m_mapId);

    if (mapSource)
        emit copyrightsChanged(mapSource->copyright());
}

QT_END_NAMESPACE