9 , _showRotation (false)
10 , _clockwiseRotation(true)
20 , _interactive (false)
21 , _showRotation (showRotation)
22 , _clockwiseRotation(clockwiseRotation)
24 _radius.setRawValue(
radius);
31 , _center (other._center)
33 , _interactive (false)
34 , _showRotation (other._showRotation)
35 , _clockwiseRotation(other._clockwiseRotation)
37 _radius.setRawValue(other._radius.rawValue());
44 _radius.setRawValue(other._radius.rawValue());
50void QGCMapCircle::_init(
void)
53 _radius.setMetaData(_nameToMetaDataMap[_radiusFactName]);
61 if (_dirty !=
dirty) {
67void QGCMapCircle::saveToJson(QJsonObject& json)
70 QJsonObject circleObject;
73 circleObject.insert(_jsonCenterKey, jsonValue);
74 circleObject.insert(_jsonRadiusKey, _radius.rawValue().toDouble());
83 QList<JsonHelper::KeyValidateInfo> circleKeyInfo = {
92 QList<JsonHelper::KeyValidateInfo> circleObjectKeyInfo = {
93 { _jsonCenterKey, QJsonValue::Array,
true },
94 { _jsonRadiusKey, QJsonValue::Double,
true },
105 _radius.setRawValue(circleObject[_jsonRadiusKey].toDouble());
107 _interactive =
false;
108 _showRotation =
false;
109 _clockwiseRotation =
true;
116 if (newCenter != _center) {
123void QGCMapCircle::_setDirty(
void)
void rawValueChanged(const QVariant &value)
The QGCMapCircle represents a circular area which can be displayed on a Map control.
void setInteractive(bool interactive)
bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged(QGeoCoordinate center READ center WRITE setCenter NOTIFY centerChanged) 1(Fact *radius READ radius CONSTANT) 1(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged) 1(bool showRotation READ showRotation WRITE setShowRotation NOTIFY showRotationChanged) 1(bool clockwiseRotation READ clockwiseRotation WRITE setClockwiseRotation NOTIFY clockwiseRotationChanged) void saveToJson(QJsonObject &json)
void interactiveChanged(bool interactive)
bool clockwiseRotation(void) const
void setClockwiseRotation(bool clockwiseRotation)
QGCMapCircle(QObject *parent=nullptr)
static constexpr const char * jsonCircleKey
void clockwiseRotationChanged(bool clockwiseRotation)
bool interactive(void) const
void setShowRotation(bool showRotation)
void centerChanged(QGeoCoordinate center)
bool showRotation(void) const
void showRotationChanged(bool showRotation)
void setDirty(bool dirty)
void setCenter(QGeoCoordinate newCenter)
const QGCMapCircle & operator=(const QGCMapCircle &other)
QGeoCoordinate center(void) const
bool loadFromJson(const QJsonObject &json, QString &errorString)
bool validateKeys(const QJsonObject &jsonObject, const QList< KeyValidateInfo > &keyInfo, QString &errorString)
void saveGeoCoordinate(const QGeoCoordinate &coordinate, bool writeAltitude, QJsonValue &jsonValue, bool geoJsonFormat=false)
bool loadGeoCoordinate(const QJsonValue &jsonValue, bool altitudeRequired, QGeoCoordinate &coordinate, QString &errorString, bool geoJsonFormat=false)
if true, use [lon, lat], [lat, lon] otherwise