Changeset View
Changeset View
Standalone View
Standalone View
src/lib/marble/declarative/MarbleQuickItem.cpp
Show First 20 Lines • Show All 604 Lines • ▼ Show 20 Line(s) | 603 | if (d->m_placemark && placemark->coordinate() == d->m_placemark->placemark().coordinate()) { | |||
---|---|---|---|---|---|
605 | d->m_placemark = nullptr; | 605 | d->m_placemark = nullptr; | ||
606 | } else { | 606 | } else { | ||
607 | if (d->m_placemark) { | 607 | if (d->m_placemark) { | ||
608 | d->m_placemark->deleteLater(); | 608 | d->m_placemark->deleteLater(); | ||
609 | } | 609 | } | ||
610 | d->m_placemark = new Placemark(this); | 610 | d->m_placemark = new Placemark(this); | ||
611 | d->m_placemark->setGeoDataPlacemark(*placemark); | 611 | d->m_placemark->setGeoDataPlacemark(*placemark); | ||
612 | if (placemark->parent() && placemark->parent()->nodeType() == GeoDataTypes::GeoDataDocumentType) { | 612 | if (placemark->parent() && placemark->parent()->nodeType() == GeoDataTypes::GeoDataDocumentType) { | ||
613 | QVector<const GeoDataRelation*> relations; | ||||
613 | auto const document = static_cast<const GeoDataDocument*>(placemark->parent()); | 614 | auto const document = static_cast<const GeoDataDocument*>(placemark->parent()); | ||
614 | for (auto feature: document->featureList()) { | 615 | for (auto feature: document->featureList()) { | ||
615 | if (feature->nodeType() == GeoDataTypes::GeoDataRelationType) { | 616 | if (feature->nodeType() == GeoDataTypes::GeoDataRelationType) { | ||
616 | auto const relation = static_cast<const GeoDataRelation*>(feature); | 617 | auto relation = static_cast<const GeoDataRelation*>(feature); | ||
617 | if (relation->memberIds().contains(placemark->osmData().oid())) { | 618 | if (relation->memberIds().contains(placemark->osmData().oid())) { | ||
618 | // @TODO Can be used to present relations to the user, e.g. | 619 | relations.push_back(relation); | ||
619 | // selecting a hiking route for highlighting | | |||
620 | } | 620 | } | ||
621 | } | 621 | } | ||
622 | } | 622 | } | ||
623 | if (!relations.isEmpty()) | ||||
624 | d->m_placemark->setRelations(relations); | ||||
623 | } | 625 | } | ||
624 | } | 626 | } | ||
625 | delete d->m_placemarkItem; | 627 | delete d->m_placemarkItem; | ||
626 | d->m_placemarkItem = nullptr; | 628 | d->m_placemarkItem = nullptr; | ||
627 | updatePlacemarks(); | 629 | updatePlacemarks(); | ||
628 | return; | 630 | return; | ||
629 | } | 631 | } | ||
630 | 632 | | |||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |