1 Star 0 Fork 43

张洛宜/easygis

forked from qizr/easygis 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
maplayer.cpp 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
张洛宜 提交于 2022-01-15 15:49 . windows vs2017 Qt5.13.2编译
#include <QObject>
#include <include/maplayer.h>
#include <include/mapcanvas.h>
#include <QDateTime>
#pragma execution_character_set("utf-8")
namespace EasyGIS {
MapLayer::MapLayer(
const QString &id,
EasyGIS::CRS *crs,
EasyGIS::MapCanvas *mapCanvas)
: mId(id),
mCrs(crs),
mZValue(-1),
mZoomValue(kDefaultZoomValue),
mProvider(nullptr),
mMapCanvasMap(new MapCanvasMap(this)),
mMapCanvas(mapCanvas) {
}
MapLayer::~MapLayer() {
delete mCrs;
delete mProvider;
}
MapLayer::MapLayer(const MapLayer &other) {
mId = other.mId;
mZValue = other.mZValue;
mCrs = other.mCrs;
mMapCanvas = other.mMapCanvas;
}
MapLayer::MapLayer(MapLayer &&other) noexcept {
mId = other.mId;
mZValue = other.mZValue;
mCrs = other.mCrs;
mMapCanvas = other.mMapCanvas;
other.mId = QString{};
other.mCrs = nullptr;
other.mZValue = 0;
other.mMapCanvas = nullptr;
}
MapLayer &
MapLayer::operator=(const MapLayer &other) {
if (this != &other) {
mId = other.mId;
mZValue = other.mZValue;
mCrs = other.mCrs;
mMapCanvas = other.mMapCanvas;
}
return *this;
}
MapLayer &
MapLayer::operator=(MapLayer &&other) noexcept {
if (this != &other) {
mId = other.mId;
mZValue = other.mZValue;
mCrs = other.mCrs;
mMapCanvas = other.mMapCanvas;
other.mId = QString{};
other.mCrs = nullptr;
other.mZValue = 0;
other.mMapCanvas = nullptr;
}
return *this;
}
void
MapLayer::update() {
if(!isVisible()){
qDebug() << id() << "=>图层不显示,跳过刷新操作";
mMapCanvasMap->hide();
return;
}
//qDebug() << "刷新图层内容=>" << mMapCanvas->viewExtent()<<QDateTime::currentDateTime()<<"zoom"<<mZoomValue;
mProvider->createTask(mMapCanvas->viewExtent(), mZoomValue);
mMapCanvasMap->show();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/muye91/easygis.git
[email protected]:muye91/easygis.git
muye91
easygis
easygis
master

搜索帮助