summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-10-03 12:27:18 (GMT)
committerBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-10-03 13:58:10 (GMT)
commit405038106b41ba30da316641bef8231d7316fddd (patch)
treec6d0df2c36ec9feeb00628c33c99232c0d82e974
parent493ece18986ff3ac9e1904ec3c5f82c91dc645b0 (diff)
let visual categories only be defined for placemarks
Visual category should be a relation between styles and geometries.
-rw-r--r--src/lib/marble/BookmarkManager.cpp2
-rw-r--r--src/lib/marble/PlacemarkLayout.cpp2
-rw-r--r--src/lib/marble/StyleBuilder.cpp21
-rw-r--r--src/lib/marble/StyleBuilder.h4
-rw-r--r--src/lib/marble/geodata/data/GeoDataFeature.cpp315
-rw-r--r--src/lib/marble/geodata/data/GeoDataFeature.h16
-rw-r--r--src/lib/marble/geodata/data/GeoDataFeature_p.h5
-rw-r--r--src/lib/marble/geodata/data/GeoDataFolder.cpp1
-rw-r--r--src/lib/marble/geodata/data/GeoDataPlacemark.cpp312
-rw-r--r--src/lib/marble/geodata/data/GeoDataPlacemark.h22
-rw-r--r--src/lib/marble/geodata/data/GeoDataPlacemark_p.h11
-rw-r--r--src/lib/marble/graphicsview/GeoGraphicsItem.cpp10
-rw-r--r--src/lib/marble/layers/GeometryLayer.cpp7
13 files changed, 365 insertions, 363 deletions
diff --git a/src/lib/marble/BookmarkManager.cpp b/src/lib/marble/BookmarkManager.cpp
index c1740e7..08e016e 100644
--- a/src/lib/marble/BookmarkManager.cpp
+++ b/src/lib/marble/BookmarkManager.cpp
@@ -142,7 +142,7 @@ void BookmarkManager::addBookmark( GeoDataContainer *container, const GeoDataPla
}
if (d->m_styleBuilder && bookmark->style()->iconStyle().iconPath().isEmpty()) {
StyleParameters style;
- style.feature = bookmark;
+ style.placemark = bookmark;
bookmark->setStyle(GeoDataStyle::Ptr(new GeoDataStyle(*d->m_styleBuilder->createStyle(style))));
}
d->m_treeModel->addFeature( container, bookmark );
diff --git a/src/lib/marble/PlacemarkLayout.cpp b/src/lib/marble/PlacemarkLayout.cpp
index eb7a37f..362f722 100644
--- a/src/lib/marble/PlacemarkLayout.cpp
+++ b/src/lib/marble/PlacemarkLayout.cpp
@@ -567,7 +567,7 @@ bool PlacemarkLayout::layoutPlacemark( const GeoDataPlacemark *placemark, qreal
// create a new one...
StyleParameters parameters;
// @todo: Set / adjust to tile level
- parameters.feature = placemark;
+ parameters.placemark = placemark;
mark = new VisiblePlacemark(placemark, m_styleBuilder->createStyle(parameters));
m_visiblePlacemarks.insert( placemark, mark );
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index d9d54a8..7e29b47 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -499,10 +499,6 @@ void StyleBuilder::Private::initializeDefaultStyles()
= GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/unmanned_hard_landing.png" ),
QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor ));
- m_defaultStyle[GeoDataFeature::Folder]
- = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/folder.png" ),
- QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor ));
-
m_defaultStyle[GeoDataFeature::Bookmark]
= createPOIStyle(QFont( defaultFamily, defaultSize, 50, false ),
MarbleDirs::path("svg/bookmark.svg"), defaultLabelColor );
@@ -1193,22 +1189,22 @@ void StyleBuilder::setDefaultLabelColor( const QColor& color )
GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &parameters) const
{
- if (!parameters.feature) {
+ if (!parameters.placemark) {
Q_ASSERT(false && "Must not pass a null feature to StyleBuilder::createStyle");
return GeoDataStyle::Ptr();
}
- if (parameters.feature->customStyle()) {
- return parameters.feature->customStyle();
+ if (parameters.placemark->customStyle()) {
+ return parameters.placemark->customStyle();
}
- auto const visualCategory = parameters.feature->visualCategory();
+ auto const visualCategory = parameters.placemark->visualCategory();
GeoDataStyle::ConstPtr style = presetStyle(visualCategory);
- if (parameters.feature->nodeType() != GeoDataTypes::GeoDataPlacemarkType) {
+ if (parameters.placemark->nodeType() != GeoDataTypes::GeoDataPlacemarkType) {
return style;
}
- GeoDataPlacemark const * placemark = static_cast<GeoDataPlacemark const *>(parameters.feature);
+ GeoDataPlacemark const * placemark = static_cast<GeoDataPlacemark const *>(parameters.placemark);
OsmPlacemarkData const & osmData = placemark->osmData();
if (placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPointType) {
if (visualCategory == GeoDataFeature::NaturalTree) {
@@ -1644,7 +1640,6 @@ QString StyleBuilder::visualCategoryName(GeoDataFeature::GeoDataVisualCategory c
visualCategoryNames[GeoDataFeature::RoboticRover] = "RoboticRover";
visualCategoryNames[GeoDataFeature::UnmannedSoftLandingSite] = "UnmannedSoftLandingSite";
visualCategoryNames[GeoDataFeature::UnmannedHardLandingSite] = "UnmannedHardLandingSite";
- visualCategoryNames[GeoDataFeature::Folder] = "Folder";
visualCategoryNames[GeoDataFeature::Bookmark] = "Bookmark";
visualCategoryNames[GeoDataFeature::NaturalWater] = "NaturalWater";
visualCategoryNames[GeoDataFeature::NaturalReef] = "NaturalReef";
@@ -2055,8 +2050,8 @@ GeoDataFeature::GeoDataVisualCategory StyleBuilder::determineVisualCategory(cons
return GeoDataFeature::None;
}
-StyleParameters::StyleParameters(const GeoDataFeature *feature_, int tileLevel_) :
- feature(feature_),
+StyleParameters::StyleParameters(const GeoDataPlacemark *placemark_, int tileLevel_) :
+ placemark(placemark_),
tileLevel(tileLevel_)
{
// nothing to do
diff --git a/src/lib/marble/StyleBuilder.h b/src/lib/marble/StyleBuilder.h
index e4f262b..6acd2ad 100644
--- a/src/lib/marble/StyleBuilder.h
+++ b/src/lib/marble/StyleBuilder.h
@@ -29,9 +29,9 @@ class OsmPlacemarkData;
class MARBLE_EXPORT StyleParameters
{
public:
- explicit StyleParameters(const GeoDataFeature* feature=nullptr, int tileLevel=0);
+ explicit StyleParameters(const GeoDataPlacemark *placemark_ = nullptr, int tileLevel = 0);
- const GeoDataFeature* feature;
+ const GeoDataPlacemark *placemark;
int tileLevel;
};
diff --git a/src/lib/marble/geodata/data/GeoDataFeature.cpp b/src/lib/marble/geodata/data/GeoDataFeature.cpp
index f3d58bb..c71da23 100644
--- a/src/lib/marble/geodata/data/GeoDataFeature.cpp
+++ b/src/lib/marble/geodata/data/GeoDataFeature.cpp
@@ -396,17 +396,6 @@ void GeoDataFeature::setRegion( const GeoDataRegion& region )
d->featureExtendedData().m_region = region;
}
-GeoDataFeature::GeoDataVisualCategory GeoDataFeature::visualCategory() const
-{
- return d->m_visualCategory;
-}
-
-void GeoDataFeature::setVisualCategory( GeoDataFeature::GeoDataVisualCategory index )
-{
- detach();
- d->m_visualCategory = index;
-}
-
const QString GeoDataFeature::role() const
{
return d->m_role;
@@ -450,310 +439,6 @@ void GeoDataFeature::setPopularity( qint64 popularity )
d->m_popularity = popularity;
}
-QString GeoDataFeature::categoryName() const
-{
- switch (d->m_visualCategory) {
- case Valley: return GeoDataFeaturePrivate::tr("Valley");
- case OtherTerrain: return GeoDataFeaturePrivate::tr("Terrain");
- case Crater: return GeoDataFeaturePrivate::tr("Crater");
- case Mare: return GeoDataFeaturePrivate::tr("Sea");
- case MannedLandingSite: return GeoDataFeaturePrivate::tr("Manned Landing Site");
- case RoboticRover: return GeoDataFeaturePrivate::tr("Robotic Rover");
- case UnmannedSoftLandingSite: return GeoDataFeaturePrivate::tr("Unmanned Soft Landing Site");
- case UnmannedHardLandingSite: return GeoDataFeaturePrivate::tr("Unmanned Hard Landing Site");
- case Mons: return GeoDataFeaturePrivate::tr("Mountain");
- case SmallCity: return GeoDataFeaturePrivate::tr("City");
- case SmallCountyCapital: return GeoDataFeaturePrivate::tr("County Capital");
- case SmallStateCapital: return GeoDataFeaturePrivate::tr("State Capital");
- case SmallNationCapital: return GeoDataFeaturePrivate::tr("Nation Capital");
- case MediumCity: return GeoDataFeaturePrivate::tr("City");
- case MediumCountyCapital: return GeoDataFeaturePrivate::tr("County Capital");
- case MediumStateCapital: return GeoDataFeaturePrivate::tr("State Capital");
- case MediumNationCapital: return GeoDataFeaturePrivate::tr("Nation Capital");
- case BigCity: return GeoDataFeaturePrivate::tr("City");
- case BigCountyCapital: return GeoDataFeaturePrivate::tr("County Capital");
- case BigStateCapital: return GeoDataFeaturePrivate::tr("State Capital");
- case BigNationCapital: return GeoDataFeaturePrivate::tr("Nation Capital");
- case LargeCity: return GeoDataFeaturePrivate::tr("City");
- case LargeCountyCapital: return GeoDataFeaturePrivate::tr("County Capital");
- case LargeStateCapital: return GeoDataFeaturePrivate::tr("State Capital");
- case LargeNationCapital: return GeoDataFeaturePrivate::tr("Nation Capital");
- case Nation: return GeoDataFeaturePrivate::tr("Nation");
- case Mountain: return GeoDataFeaturePrivate::tr("Mountain");
- case Volcano: return GeoDataFeaturePrivate::tr("Volcano");
- case Continent: return GeoDataFeaturePrivate::tr("Continent");
- case Ocean: return GeoDataFeaturePrivate::tr("Ocean");
- case GeographicPole: return GeoDataFeaturePrivate::tr("Geographic Pole");
- case MagneticPole: return GeoDataFeaturePrivate::tr("Magnetic Pole");
- case ShipWreck: return GeoDataFeaturePrivate::tr("Ship Wreck");
- case AirPort: return GeoDataFeaturePrivate::tr("Air Port");
- case Observatory: return GeoDataFeaturePrivate::tr("Observatory");
- case MilitaryDangerArea: return GeoDataFeaturePrivate::tr("Military Danger Area");
- case OsmSite: return GeoDataFeaturePrivate::tr("OSM Site");
- case Coordinate: return GeoDataFeaturePrivate::tr("Coordinate");
- case Folder: return GeoDataFeaturePrivate::tr("Folder");
- case Bookmark: return GeoDataFeaturePrivate::tr("Bookmark");
- case Satellite: return GeoDataFeaturePrivate::tr("Satellite");
-
- // OpenStreetMap categories
- case PlaceCity: return GeoDataFeaturePrivate::tr("City");
- case PlaceCityCapital: return GeoDataFeaturePrivate::tr("City Capital");
- case PlaceSuburb: return GeoDataFeaturePrivate::tr("Suburb");
- case PlaceHamlet: return GeoDataFeaturePrivate::tr("Hamlet");
- case PlaceLocality: return GeoDataFeaturePrivate::tr("Locality");
- case PlaceTown: return GeoDataFeaturePrivate::tr("Town");
- case PlaceTownCapital: return GeoDataFeaturePrivate::tr("Town Capital");
- case PlaceVillage: return GeoDataFeaturePrivate::tr("Village");
- case PlaceVillageCapital: return GeoDataFeaturePrivate::tr("Village Capital");
- case NaturalWater: return GeoDataFeaturePrivate::tr("Water");
- case NaturalReef: return GeoDataFeaturePrivate::tr("Reef");
- case NaturalWood: return GeoDataFeaturePrivate::tr("Wood");
- case NaturalBeach: return GeoDataFeaturePrivate::tr("Beach");
- case NaturalWetland: return GeoDataFeaturePrivate::tr("Wetland");
- case NaturalGlacier: return GeoDataFeaturePrivate::tr("Glacier");
- case NaturalIceShelf: return GeoDataFeaturePrivate::tr("Ice Shelf");
- case NaturalScrub: return GeoDataFeaturePrivate::tr("Scrub");
- case NaturalCliff: return GeoDataFeaturePrivate::tr("Cliff");
- case NaturalHeath: return GeoDataFeaturePrivate::tr("Heath");
- case HighwayTrafficSignals: return GeoDataFeaturePrivate::tr("Traffic Signals");
- case HighwaySteps: return GeoDataFeaturePrivate::tr("Steps");
- case HighwayUnknown: return GeoDataFeaturePrivate::tr("Unknown Road");
- case HighwayPath: return GeoDataFeaturePrivate::tr("Path");
- case HighwayFootway: return GeoDataFeaturePrivate::tr("Footway");
- case HighwayTrack: return GeoDataFeaturePrivate::tr("Track");
- case HighwayPedestrian: return GeoDataFeaturePrivate::tr("Footway");
- case HighwayCycleway: return GeoDataFeaturePrivate::tr("Cycleway");
- case HighwayService: return GeoDataFeaturePrivate::tr("Service Road");
- case HighwayRoad: return GeoDataFeaturePrivate::tr("Road");
- case HighwayResidential: return GeoDataFeaturePrivate::tr("Residential Road");
- case HighwayLivingStreet: return GeoDataFeaturePrivate::tr("Living Street");
- case HighwayUnclassified: return GeoDataFeaturePrivate::tr("Unclassified Road");
- case HighwayTertiaryLink: return GeoDataFeaturePrivate::tr("Tertiary Link Road");
- case HighwayTertiary: return GeoDataFeaturePrivate::tr("Tertiary Road");
- case HighwaySecondaryLink: return GeoDataFeaturePrivate::tr("Secondary Link Road");
- case HighwaySecondary: return GeoDataFeaturePrivate::tr("Secondary Road");
- case HighwayPrimaryLink: return GeoDataFeaturePrivate::tr("Primary Link Road");
- case HighwayPrimary: return GeoDataFeaturePrivate::tr("Primary Road");
- case HighwayTrunkLink: return GeoDataFeaturePrivate::tr("Trunk Link Road");
- case HighwayTrunk: return GeoDataFeaturePrivate::tr("Trunk Road");
- case HighwayMotorwayLink: return GeoDataFeaturePrivate::tr("Motorway Link Road");
- case HighwayMotorway: return GeoDataFeaturePrivate::tr("Motorway");
- case Building: return GeoDataFeaturePrivate::tr("Building");
- case AccomodationCamping: return GeoDataFeaturePrivate::tr("Camping");
- case AccomodationHostel: return GeoDataFeaturePrivate::tr("Hostel");
- case AccomodationHotel: return GeoDataFeaturePrivate::tr("Hotel");
- case AccomodationMotel: return GeoDataFeaturePrivate::tr("Motel");
- case AccomodationYouthHostel: return GeoDataFeaturePrivate::tr("Youth Hostel");
- case AccomodationGuestHouse: return GeoDataFeaturePrivate::tr("Guest House");
- case AmenityLibrary: return GeoDataFeaturePrivate::tr("Library");
- case AmenityKindergarten: return GeoDataFeaturePrivate::tr("Kindergarten");
- case EducationCollege: return GeoDataFeaturePrivate::tr("College");
- case EducationSchool: return GeoDataFeaturePrivate::tr("School");
- case EducationUniversity: return GeoDataFeaturePrivate::tr("University");
- case FoodBar: return GeoDataFeaturePrivate::tr("Bar");
- case FoodBiergarten: return GeoDataFeaturePrivate::tr("Biergarten");
- case FoodCafe: return GeoDataFeaturePrivate::tr("Cafe");
- case FoodFastFood: return GeoDataFeaturePrivate::tr("Fast Food");
- case FoodPub: return GeoDataFeaturePrivate::tr("Pub");
- case FoodRestaurant: return GeoDataFeaturePrivate::tr("Restaurant");
- case HealthDentist: return GeoDataFeaturePrivate::tr("Dentist");
- case HealthDoctors: return GeoDataFeaturePrivate::tr("Doctors");
- case HealthHospital: return GeoDataFeaturePrivate::tr("Hospital");
- case HealthPharmacy: return GeoDataFeaturePrivate::tr("Pharmacy");
- case HealthVeterinary: return GeoDataFeaturePrivate::tr("Veterinary");
- case MoneyAtm: return GeoDataFeaturePrivate::tr("ATM");
- case MoneyBank: return GeoDataFeaturePrivate::tr("Bank");
- case AmenityArchaeologicalSite: return GeoDataFeaturePrivate::tr("Archaeological Site");
- case AmenityEmbassy: return GeoDataFeaturePrivate::tr("Embassy");
- case AmenityEmergencyPhone: return GeoDataFeaturePrivate::tr("Emergency Phone");
- case AmenityWaterPark: return GeoDataFeaturePrivate::tr("Water Park");
- case AmenityCommunityCentre: return GeoDataFeaturePrivate::tr("Community Centre");
- case AmenityFountain: return GeoDataFeaturePrivate::tr("Fountain");
- case AmenityNightClub: return GeoDataFeaturePrivate::tr("Night Club");
- case AmenityBench: return GeoDataFeaturePrivate::tr("Bench");
- case AmenityCourtHouse: return GeoDataFeaturePrivate::tr("Court House");
- case AmenityFireStation: return GeoDataFeaturePrivate::tr("Fire Station");
- case AmenityHuntingStand: return GeoDataFeaturePrivate::tr("Hunting Stand");
- case AmenityPolice: return GeoDataFeaturePrivate::tr("Police");
- case AmenityPostBox: return GeoDataFeaturePrivate::tr("Post Box");
- case AmenityPostOffice: return GeoDataFeaturePrivate::tr("Post Office");
- case AmenityPrison: return GeoDataFeaturePrivate::tr("Prison");
- case AmenityRecycling: return GeoDataFeaturePrivate::tr("Recycling");
- case AmenityShelter: return GeoDataFeaturePrivate::tr("Shelter");
- case AmenityTelephone: return GeoDataFeaturePrivate::tr("Telephone");
- case AmenityToilets: return GeoDataFeaturePrivate::tr("Toilets");
- case AmenityTownHall: return GeoDataFeaturePrivate::tr("Town Hall");
- case AmenityWasteBasket: return GeoDataFeaturePrivate::tr("Waste Basket");
- case AmenityDrinkingWater: return GeoDataFeaturePrivate::tr("Drinking Water");
- case AmenityGraveyard: return GeoDataFeaturePrivate::tr("Graveyard");
- case BarrierCityWall: return GeoDataFeaturePrivate::tr("City Wall");
- case BarrierGate: return GeoDataFeaturePrivate::tr("Gate");
- case BarrierLiftGate: return GeoDataFeaturePrivate::tr("Lift Gate");
- case BarrierWall: return GeoDataFeaturePrivate::tr("Wall");
- case NaturalPeak: return GeoDataFeaturePrivate::tr("Peak");
- case NaturalTree: return GeoDataFeaturePrivate::tr("Tree");
- case ShopBeverages: return GeoDataFeaturePrivate::tr("Beverages");
- case ShopHifi: return GeoDataFeaturePrivate::tr("Hifi");
- case ShopSupermarket: return GeoDataFeaturePrivate::tr("Supermarket");
- case ShopAlcohol: return GeoDataFeaturePrivate::tr("Alcohol");
- case ShopBakery: return GeoDataFeaturePrivate::tr("Bakery");
- case ShopButcher: return GeoDataFeaturePrivate::tr("Butcher");
- case ShopConfectionery: return GeoDataFeaturePrivate::tr("Confectionery");
- case ShopConvenience: return GeoDataFeaturePrivate::tr("Convenience Shop");
- case ShopGreengrocer: return GeoDataFeaturePrivate::tr("Greengrocer");
- case ShopSeafood: return GeoDataFeaturePrivate::tr("Seafood");
- case ShopDepartmentStore: return GeoDataFeaturePrivate::tr("Department Store");
- case ShopKiosk: return GeoDataFeaturePrivate::tr("Kiosk");
- case ShopBag: return GeoDataFeaturePrivate::tr("Bag");
- case ShopClothes: return GeoDataFeaturePrivate::tr("Clothes");
- case ShopFashion: return GeoDataFeaturePrivate::tr("Fashion");
- case ShopJewelry: return GeoDataFeaturePrivate::tr("Jewelry");
- case ShopShoes: return GeoDataFeaturePrivate::tr("Shoes");
- case ShopVarietyStore: return GeoDataFeaturePrivate::tr("Variety Store");
- case ShopBeauty: return GeoDataFeaturePrivate::tr("Beauty");
- case ShopChemist: return GeoDataFeaturePrivate::tr("Chemist");
- case ShopCosmetics: return GeoDataFeaturePrivate::tr("Cosmetics");
- case ShopHairdresser: return GeoDataFeaturePrivate::tr("Hairdresser");
- case ShopOptician: return GeoDataFeaturePrivate::tr("Optician");
- case ShopPerfumery: return GeoDataFeaturePrivate::tr("Perfumery");
- case ShopDoitYourself: return GeoDataFeaturePrivate::tr("Doit Yourself");
- case ShopFlorist: return GeoDataFeaturePrivate::tr("Florist");
- case ShopHardware: return GeoDataFeaturePrivate::tr("Hardware");
- case ShopFurniture: return GeoDataFeaturePrivate::tr("Furniture");
- case ShopElectronics: return GeoDataFeaturePrivate::tr("Electronics");
- case ShopMobilePhone: return GeoDataFeaturePrivate::tr("Mobile Phone");
- case ShopBicycle: return GeoDataFeaturePrivate::tr("Bicycle");
- case ShopCar: return GeoDataFeaturePrivate::tr("Car");
- case ShopCarRepair: return GeoDataFeaturePrivate::tr("Car Repair");
- case ShopCarParts: return GeoDataFeaturePrivate::tr("Car Parts");
- case ShopMotorcycle: return GeoDataFeaturePrivate::tr("Motorcycle");
- case ShopOutdoor: return GeoDataFeaturePrivate::tr("Outdoor");
- case ShopMusicalInstrument: return GeoDataFeaturePrivate::tr("Musical Instrument");
- case ShopPhoto: return GeoDataFeaturePrivate::tr("Photo");
- case ShopBook: return GeoDataFeaturePrivate::tr("Book");
- case ShopGift: return GeoDataFeaturePrivate::tr("Gift");
- case ShopStationery: return GeoDataFeaturePrivate::tr("Stationery");
- case ShopLaundry: return GeoDataFeaturePrivate::tr("Laundry");
- case ShopPet: return GeoDataFeaturePrivate::tr("Pet");
- case ShopToys: return GeoDataFeaturePrivate::tr("Toys");
- case ShopTravelAgency: return GeoDataFeaturePrivate::tr("Travel Agency");
- case Shop: return GeoDataFeaturePrivate::tr("Shop");
- case ManmadeBridge: return GeoDataFeaturePrivate::tr("Bridge");
- case ManmadeLighthouse: return GeoDataFeaturePrivate::tr("Lighthouse");
- case ManmadePier: return GeoDataFeaturePrivate::tr("Pier");
- case ManmadeWaterTower: return GeoDataFeaturePrivate::tr("Water Tower");
- case ManmadeWindMill: return GeoDataFeaturePrivate::tr("Wind Mill");
- case TouristAttraction: return GeoDataFeaturePrivate::tr("Tourist Attraction");
- case TouristCastle: return GeoDataFeaturePrivate::tr("Castle");
- case TouristCinema: return GeoDataFeaturePrivate::tr("Cinema");
- case TouristInformation: return GeoDataFeaturePrivate::tr("Information");
- case TouristMonument: return GeoDataFeaturePrivate::tr("Monument");
- case TouristMuseum: return GeoDataFeaturePrivate::tr("Museum");
- case TouristRuin: return GeoDataFeaturePrivate::tr("Ruin");
- case TouristTheatre: return GeoDataFeaturePrivate::tr("Theatre");
- case TouristThemePark: return GeoDataFeaturePrivate::tr("Theme Park");
- case TouristViewPoint: return GeoDataFeaturePrivate::tr("View Point");
- case TouristZoo: return GeoDataFeaturePrivate::tr("Zoo");
- case TouristAlpineHut: return GeoDataFeaturePrivate::tr("Alpine Hut");
- case TransportAerodrome: return GeoDataFeaturePrivate::tr("Aerodrome");
- case TransportHelipad: return GeoDataFeaturePrivate::tr("Helipad");
- case TransportAirportGate: return GeoDataFeaturePrivate::tr("Airport Gate");
- case TransportAirportRunway: return GeoDataFeaturePrivate::tr("Airport Runway");
- case TransportAirportApron: return GeoDataFeaturePrivate::tr("Airport Apron");
- case TransportAirportTaxiway: return GeoDataFeaturePrivate::tr("Airport Taxiway");
- case TransportAirportTerminal: return GeoDataFeaturePrivate::tr("Airport Terminal");
- case TransportBusStation: return GeoDataFeaturePrivate::tr("Bus Station");
- case TransportBusStop: return GeoDataFeaturePrivate::tr("Bus Stop");
- case TransportCarShare: return GeoDataFeaturePrivate::tr("Car Sharing");
- case TransportFuel: return GeoDataFeaturePrivate::tr("Gas Station");
- case TransportParking: return GeoDataFeaturePrivate::tr("Parking");
- case TransportParkingSpace: return GeoDataFeaturePrivate::tr("Parking Space");
- case TransportPlatform: return GeoDataFeaturePrivate::tr("Platform");
- case TransportRentalBicycle: return GeoDataFeaturePrivate::tr("Rental Bicycle");
- case TransportRentalCar: return GeoDataFeaturePrivate::tr("Rental Car");
- case TransportTaxiRank: return GeoDataFeaturePrivate::tr("Taxi Rank");
- case TransportTrainStation: return GeoDataFeaturePrivate::tr("Train Station");
- case TransportTramStop: return GeoDataFeaturePrivate::tr("Tram Stop");
- case TransportBicycleParking: return GeoDataFeaturePrivate::tr("Bicycle Parking");
- case TransportMotorcycleParking: return GeoDataFeaturePrivate::tr("Motorcycle Parking");
- case TransportSubwayEntrance: return GeoDataFeaturePrivate::tr("Subway Entrance");
- case ReligionPlaceOfWorship: return GeoDataFeaturePrivate::tr("Place Of Worship");
- case ReligionBahai: return GeoDataFeaturePrivate::tr("Bahai");
- case ReligionBuddhist: return GeoDataFeaturePrivate::tr("Buddhist");
- case ReligionChristian: return GeoDataFeaturePrivate::tr("Christian");
- case ReligionMuslim: return GeoDataFeaturePrivate::tr("Muslim");
- case ReligionHindu: return GeoDataFeaturePrivate::tr("Hindu");
- case ReligionJain: return GeoDataFeaturePrivate::tr("Jain");
- case ReligionJewish: return GeoDataFeaturePrivate::tr("Jewish");
- case ReligionShinto: return GeoDataFeaturePrivate::tr("Shinto");
- case ReligionSikh: return GeoDataFeaturePrivate::tr("Sikh");
- case LeisureGolfCourse: return GeoDataFeaturePrivate::tr("Golf Course");
- case LeisureMarina: return GeoDataFeaturePrivate::tr("Marina");
- case LeisurePark: return GeoDataFeaturePrivate::tr("Park");
- case LeisurePlayground: return GeoDataFeaturePrivate::tr("Playground");
- case LeisurePitch: return GeoDataFeaturePrivate::tr("Pitch");
- case LeisureSportsCentre: return GeoDataFeaturePrivate::tr("Sports Centre");
- case LeisureStadium: return GeoDataFeaturePrivate::tr("Stadium");
- case LeisureTrack: return GeoDataFeaturePrivate::tr("Track");
- case LeisureSwimmingPool: return GeoDataFeaturePrivate::tr("Swimming Pool");
- case LanduseAllotments: return GeoDataFeaturePrivate::tr("Allotments");
- case LanduseBasin: return GeoDataFeaturePrivate::tr("Basin");
- case LanduseCemetery: return GeoDataFeaturePrivate::tr("Cemetery");
- case LanduseCommercial: return GeoDataFeaturePrivate::tr("Commercial");
- case LanduseConstruction: return GeoDataFeaturePrivate::tr("Construction");
- case LanduseFarmland: return GeoDataFeaturePrivate::tr("Farmland");
- case LanduseFarmyard: return GeoDataFeaturePrivate::tr("Farmyard");
- case LanduseGarages: return GeoDataFeaturePrivate::tr("Garages");
- case LanduseGrass: return GeoDataFeaturePrivate::tr("Grass");
- case LanduseIndustrial: return GeoDataFeaturePrivate::tr("Industrial");
- case LanduseLandfill: return GeoDataFeaturePrivate::tr("Landfill");
- case LanduseMeadow: return GeoDataFeaturePrivate::tr("Meadow");
- case LanduseMilitary: return GeoDataFeaturePrivate::tr("Military");
- case LanduseQuarry: return GeoDataFeaturePrivate::tr("Quarry");
- case LanduseRailway: return GeoDataFeaturePrivate::tr("Railway");
- case LanduseReservoir: return GeoDataFeaturePrivate::tr("Reservoir");
- case LanduseResidential: return GeoDataFeaturePrivate::tr("Residential");
- case LanduseRetail: return GeoDataFeaturePrivate::tr("Retail");
- case LanduseOrchard: return GeoDataFeaturePrivate::tr("Orchard");
- case LanduseVineyard: return GeoDataFeaturePrivate::tr("Vineyard");
- case RailwayRail: return GeoDataFeaturePrivate::tr("Rail");
- case RailwayNarrowGauge: return GeoDataFeaturePrivate::tr("Narrow Gauge");
- case RailwayTram: return GeoDataFeaturePrivate::tr("Tram");
- case RailwayLightRail: return GeoDataFeaturePrivate::tr("Light Rail");
- case RailwayAbandoned: return GeoDataFeaturePrivate::tr("Abandoned Railway");
- case RailwaySubway: return GeoDataFeaturePrivate::tr("Subway");
- case RailwayPreserved: return GeoDataFeaturePrivate::tr("Preserved Railway");
- case RailwayMiniature: return GeoDataFeaturePrivate::tr("Miniature Railway");
- case RailwayConstruction: return GeoDataFeaturePrivate::tr("Railway Construction");
- case RailwayMonorail: return GeoDataFeaturePrivate::tr("Monorail");
- case RailwayFunicular: return GeoDataFeaturePrivate::tr("Funicular Railway");
- case PowerTower: return GeoDataFeaturePrivate::tr("Power Tower");
- case AdminLevel1: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 1)");
- case AdminLevel2: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 2)");
- case AdminLevel3: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 3)");
- case AdminLevel4: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 4)");
- case AdminLevel5: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 5)");
- case AdminLevel6: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 6)");
- case AdminLevel7: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 7)");
- case AdminLevel8: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 8)");
- case AdminLevel9: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 9)");
- case AdminLevel10: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 10)");
- case AdminLevel11: return GeoDataFeaturePrivate::tr("Admin Boundary (Level 11)");
- case BoundaryMaritime: return GeoDataFeaturePrivate::tr("Boundary (Maritime)");
- case Landmass: return GeoDataFeaturePrivate::tr("Land Mass");
- case UrbanArea: return GeoDataFeaturePrivate::tr("Urban Area");
- case InternationalDateLine: return GeoDataFeaturePrivate::tr("International Date Line");
- case Bathymetry: return GeoDataFeaturePrivate::tr("Bathymetry");
-
- case Default:
- case Unknown:
- case None:
- case LastIndex: return QString();
- }
-
- return QString();
-}
-
void GeoDataFeature::detach()
{
if(d->ref.load() == 1) {
diff --git a/src/lib/marble/geodata/data/GeoDataFeature.h b/src/lib/marble/geodata/data/GeoDataFeature.h
index 02b7047..46ce728 100644
--- a/src/lib/marble/geodata/data/GeoDataFeature.h
+++ b/src/lib/marble/geodata/data/GeoDataFeature.h
@@ -129,7 +129,6 @@ class GEODATA_EXPORT GeoDataFeature : public GeoDataObject
UnmannedSoftLandingSite, // u
UnmannedHardLandingSite, // i
- Folder,
Bookmark,
Satellite,
@@ -583,16 +582,6 @@ class GEODATA_EXPORT GeoDataFeature : public GeoDataObject
void setRegion( const GeoDataRegion& region );
/**
- * Return the symbol index of the placemark.
- */
- GeoDataVisualCategory visualCategory() const;
- /**
- * Sets the symbol @p index of the placemark.
- * @param category the new category to be used.
- */
- void setVisualCategory( GeoDataVisualCategory category );
-
- /**
* Return the role of the placemark.
*
* FIXME: describe roles here!
@@ -640,11 +629,6 @@ class GEODATA_EXPORT GeoDataFeature : public GeoDataObject
*/
void setStyleMap( const GeoDataStyleMap* map );
- /**
- * @since 0.26.0
- */
- QString categoryName() const;
-
/// Serialize the contents of the feature to @p stream.
virtual void pack( QDataStream& stream ) const;
/// Unserialize the contents of the feature from @p stream.
diff --git a/src/lib/marble/geodata/data/GeoDataFeature_p.h b/src/lib/marble/geodata/data/GeoDataFeature_p.h
index 5df69f4..86649c6 100644
--- a/src/lib/marble/geodata/data/GeoDataFeature_p.h
+++ b/src/lib/marble/geodata/data/GeoDataFeature_p.h
@@ -137,7 +137,6 @@ public:
class GeoDataFeaturePrivate
{
- Q_DECLARE_TR_FUNCTIONS(GeoDataFeature)
public:
GeoDataFeaturePrivate() :
m_name(),
@@ -145,7 +144,6 @@ class GeoDataFeaturePrivate
m_popularity( 0 ),
m_zoomLevel( 1 ),
m_visible( true ),
- m_visualCategory( GeoDataFeature::Default ),
m_role(" "),
m_style( 0 ),
m_styleMap( 0 ),
@@ -161,7 +159,6 @@ class GeoDataFeaturePrivate
m_popularity( other.m_popularity ),
m_zoomLevel( other.m_zoomLevel ),
m_visible( other.m_visible ),
- m_visualCategory( other.m_visualCategory ),
m_role( other.m_role ),
m_style( other.m_style ), //FIXME: both style and stylemap need to be reworked internally!!!!
m_styleMap( other.m_styleMap ),
@@ -184,7 +181,6 @@ class GeoDataFeaturePrivate
m_role = other.m_role;
m_style = other.m_style;
m_styleMap = other.m_styleMap;
- m_visualCategory = other.m_visualCategory;
m_extendedData = other.m_extendedData;
delete m_featureExtendedData;
m_featureExtendedData = nullptr;
@@ -230,7 +226,6 @@ class GeoDataFeaturePrivate
int m_zoomLevel; // Zoom Level of the feature
bool m_visible; // True if this feature should be shown.
- GeoDataFeature::GeoDataVisualCategory m_visualCategory; // the visual category
QString m_role;
diff --git a/src/lib/marble/geodata/data/GeoDataFolder.cpp b/src/lib/marble/geodata/data/GeoDataFolder.cpp
index bc1acb7..c7ccdc4 100644
--- a/src/lib/marble/geodata/data/GeoDataFolder.cpp
+++ b/src/lib/marble/geodata/data/GeoDataFolder.cpp
@@ -53,7 +53,6 @@ class GeoDataFolderPrivate : public GeoDataContainerPrivate
GeoDataFolder::GeoDataFolder()
: GeoDataContainer( new GeoDataFolderPrivate )
{
- setVisualCategory( GeoDataFeature::Folder );
}
GeoDataFolder::GeoDataFolder( const GeoDataFolder& other )
diff --git a/src/lib/marble/geodata/data/GeoDataPlacemark.cpp b/src/lib/marble/geodata/data/GeoDataPlacemark.cpp
index 9b92661..cad8297 100644
--- a/src/lib/marble/geodata/data/GeoDataPlacemark.cpp
+++ b/src/lib/marble/geodata/data/GeoDataPlacemark.cpp
@@ -166,6 +166,17 @@ bool GeoDataPlacemark::operator!=( const GeoDataPlacemark& other ) const
return !this->operator==( other );
}
+GeoDataFeature::GeoDataVisualCategory GeoDataPlacemark::visualCategory() const
+{
+ return p()->m_visualCategory;
+}
+
+void GeoDataPlacemark::setVisualCategory(GeoDataFeature::GeoDataVisualCategory index)
+{
+ detach();
+ p()->m_visualCategory = index;
+}
+
GeoDataPlacemarkPrivate* GeoDataPlacemark::p()
{
return static_cast<GeoDataPlacemarkPrivate*>(d);
@@ -333,7 +344,308 @@ QString GeoDataPlacemark::displayName() const
return name();
}
+QString GeoDataPlacemark::categoryName() const
+{
+ switch (p()->m_visualCategory) {
+ case Valley: return GeoDataPlacemarkPrivate::tr("Valley");
+ case OtherTerrain: return GeoDataPlacemarkPrivate::tr("Terrain");
+ case Crater: return GeoDataPlacemarkPrivate::tr("Crater");
+ case Mare: return GeoDataPlacemarkPrivate::tr("Sea");
+ case MannedLandingSite: return GeoDataPlacemarkPrivate::tr("Manned Landing Site");
+ case RoboticRover: return GeoDataPlacemarkPrivate::tr("Robotic Rover");
+ case UnmannedSoftLandingSite: return GeoDataPlacemarkPrivate::tr("Unmanned Soft Landing Site");
+ case UnmannedHardLandingSite: return GeoDataPlacemarkPrivate::tr("Unmanned Hard Landing Site");
+ case Mons: return GeoDataPlacemarkPrivate::tr("Mountain");
+ case SmallCity: return GeoDataPlacemarkPrivate::tr("City");
+ case SmallCountyCapital: return GeoDataPlacemarkPrivate::tr("County Capital");
+ case SmallStateCapital: return GeoDataPlacemarkPrivate::tr("State Capital");
+ case SmallNationCapital: return GeoDataPlacemarkPrivate::tr("Nation Capital");
+ case MediumCity: return GeoDataPlacemarkPrivate::tr("City");
+ case MediumCountyCapital: return GeoDataPlacemarkPrivate::tr("County Capital");
+ case MediumStateCapital: return GeoDataPlacemarkPrivate::tr("State Capital");
+ case MediumNationCapital: return GeoDataPlacemarkPrivate::tr("Nation Capital");
+ case BigCity: return GeoDataPlacemarkPrivate::tr("City");
+ case BigCountyCapital: return GeoDataPlacemarkPrivate::tr("County Capital");
+ case BigStateCapital: return GeoDataPlacemarkPrivate::tr("State Capital");
+ case BigNationCapital: return GeoDataPlacemarkPrivate::tr("Nation Capital");
+ case LargeCity: return GeoDataPlacemarkPrivate::tr("City");
+ case LargeCountyCapital: return GeoDataPlacemarkPrivate::tr("County Capital");
+ case LargeStateCapital: return GeoDataPlacemarkPrivate::tr("State Capital");
+ case LargeNationCapital: return GeoDataPlacemarkPrivate::tr("Nation Capital");
+ case Nation: return GeoDataPlacemarkPrivate::tr("Nation");
+ case Mountain: return GeoDataPlacemarkPrivate::tr("Mountain");
+ case Volcano: return GeoDataPlacemarkPrivate::tr("Volcano");
+ case Continent: return GeoDataPlacemarkPrivate::tr("Continent");
+ case Ocean: return GeoDataPlacemarkPrivate::tr("Ocean");
+ case GeographicPole: return GeoDataPlacemarkPrivate::tr("Geographic Pole");
+ case MagneticPole: return GeoDataPlacemarkPrivate::tr("Magnetic Pole");
+ case ShipWreck: return GeoDataPlacemarkPrivate::tr("Ship Wreck");
+ case AirPort: return GeoDataPlacemarkPrivate::tr("Air Port");
+ case Observatory: return GeoDataPlacemarkPrivate::tr("Observatory");
+ case MilitaryDangerArea: return GeoDataPlacemarkPrivate::tr("Military Danger Area");
+ case OsmSite: return GeoDataPlacemarkPrivate::tr("OSM Site");
+ case Coordinate: return GeoDataPlacemarkPrivate::tr("Coordinate");
+ case Bookmark: return GeoDataPlacemarkPrivate::tr("Bookmark");
+ case Satellite: return GeoDataPlacemarkPrivate::tr("Satellite");
+
+ // OpenStreetMap categories
+ case PlaceCity: return GeoDataPlacemarkPrivate::tr("City");
+ case PlaceCityCapital: return GeoDataPlacemarkPrivate::tr("City Capital");
+ case PlaceSuburb: return GeoDataPlacemarkPrivate::tr("Suburb");
+ case PlaceHamlet: return GeoDataPlacemarkPrivate::tr("Hamlet");
+ case PlaceLocality: return GeoDataPlacemarkPrivate::tr("Locality");
+ case PlaceTown: return GeoDataPlacemarkPrivate::tr("Town");
+ case PlaceTownCapital: return GeoDataPlacemarkPrivate::tr("Town Capital");
+ case PlaceVillage: return GeoDataPlacemarkPrivate::tr("Village");
+ case PlaceVillageCapital: return GeoDataPlacemarkPrivate::tr("Village Capital");
+ case NaturalWater: return GeoDataPlacemarkPrivate::tr("Water");
+ case NaturalReef: return GeoDataPlacemarkPrivate::tr("Reef");
+ case NaturalWood: return GeoDataPlacemarkPrivate::tr("Wood");
+ case NaturalBeach: return GeoDataPlacemarkPrivate::tr("Beach");
+ case NaturalWetland: return GeoDataPlacemarkPrivate::tr("Wetland");
+ case NaturalGlacier: return GeoDataPlacemarkPrivate::tr("Glacier");
+ case NaturalIceShelf: return GeoDataPlacemarkPrivate::tr("Ice Shelf");
+ case NaturalScrub: return GeoDataPlacemarkPrivate::tr("Scrub");
+ case NaturalCliff: return GeoDataPlacemarkPrivate::tr("Cliff");
+ case NaturalHeath: return GeoDataPlacemarkPrivate::tr("Heath");
+ case HighwayTrafficSignals: return GeoDataPlacemarkPrivate::tr("Traffic Signals");
+ case HighwaySteps: return GeoDataPlacemarkPrivate::tr("Steps");
+ case HighwayUnknown: return GeoDataPlacemarkPrivate::tr("Unknown Road");
+ case HighwayPath: return GeoDataPlacemarkPrivate::tr("Path");
+ case HighwayFootway: return GeoDataPlacemarkPrivate::tr("Footway");
+ case HighwayTrack: return GeoDataPlacemarkPrivate::tr("Track");
+ case HighwayPedestrian: return GeoDataPlacemarkPrivate::tr("Footway");
+ case HighwayCycleway: return GeoDataPlacemarkPrivate::tr("Cycleway");
+ case HighwayService: return GeoDataPlacemarkPrivate::tr("Service Road");
+ case HighwayRoad: return GeoDataPlacemarkPrivate::tr("Road");
+ case HighwayResidential: return GeoDataPlacemarkPrivate::tr("Residential Road");
+ case HighwayLivingStreet: return GeoDataPlacemarkPrivate::tr("Living Street");
+ case HighwayUnclassified: return GeoDataPlacemarkPrivate::tr("Unclassified Road");
+ case HighwayTertiaryLink: return GeoDataPlacemarkPrivate::tr("Tertiary Link Road");
+ case HighwayTertiary: return GeoDataPlacemarkPrivate::tr("Tertiary Road");
+ case HighwaySecondaryLink: return GeoDataPlacemarkPrivate::tr("Secondary Link Road");
+ case HighwaySecondary: return GeoDataPlacemarkPrivate::tr("Secondary Road");
+ case HighwayPrimaryLink: return GeoDataPlacemarkPrivate::tr("Primary Link Road");
+ case HighwayPrimary: return GeoDataPlacemarkPrivate::tr("Primary Road");
+ case HighwayTrunkLink: return GeoDataPlacemarkPrivate::tr("Trunk Link Road");
+ case HighwayTrunk: return GeoDataPlacemarkPrivate::tr("Trunk Road");
+ case HighwayMotorwayLink: return GeoDataPlacemarkPrivate::tr("Motorway Link Road");
+ case HighwayMotorway: return GeoDataPlacemarkPrivate::tr("Motorway");
+ case Building: return GeoDataPlacemarkPrivate::tr("Building");
+ case AccomodationCamping: return GeoDataPlacemarkPrivate::tr("Camping");
+ case AccomodationHostel: return GeoDataPlacemarkPrivate::tr("Hostel");
+ case AccomodationHotel: return GeoDataPlacemarkPrivate::tr("Hotel");
+ case AccomodationMotel: return GeoDataPlacemarkPrivate::tr("Motel");
+ case AccomodationYouthHostel: return GeoDataPlacemarkPrivate::tr("Youth Hostel");
+ case AccomodationGuestHouse: return GeoDataPlacemarkPrivate::tr("Guest House");
+ case AmenityLibrary: return GeoDataPlacemarkPrivate::tr("Library");
+ case AmenityKindergarten: return GeoDataPlacemarkPrivate::tr("Kindergarten");
+ case EducationCollege: return GeoDataPlacemarkPrivate::tr("College");
+ case EducationSchool: return GeoDataPlacemarkPrivate::tr("School");
+ case EducationUniversity: return GeoDataPlacemarkPrivate::tr("University");
+ case FoodBar: return GeoDataPlacemarkPrivate::tr("Bar");
+ case FoodBiergarten: return GeoDataPlacemarkPrivate::tr("Biergarten");
+ case FoodCafe: return GeoDataPlacemarkPrivate::tr("Cafe");
+ case FoodFastFood: return GeoDataPlacemarkPrivate::tr("Fast Food");
+ case FoodPub: return GeoDataPlacemarkPrivate::tr("Pub");
+ case FoodRestaurant: return GeoDataPlacemarkPrivate::tr("Restaurant");
+ case HealthDentist: return GeoDataPlacemarkPrivate::tr("Dentist");
+ case HealthDoctors: return GeoDataPlacemarkPrivate::tr("Doctors");
+ case HealthHospital: return GeoDataPlacemarkPrivate::tr("Hospital");
+ case HealthPharmacy: return GeoDataPlacemarkPrivate::tr("Pharmacy");
+ case HealthVeterinary: return GeoDataPlacemarkPrivate::tr("Veterinary");
+ case MoneyAtm: return GeoDataPlacemarkPrivate::tr("ATM");
+ case MoneyBank: return GeoDataPlacemarkPrivate::tr("Bank");
+ case AmenityArchaeologicalSite: return GeoDataPlacemarkPrivate::tr("Archaeological Site");
+ case AmenityEmbassy: return GeoDataPlacemarkPrivate::tr("Embassy");
+ case AmenityEmergencyPhone: return GeoDataPlacemarkPrivate::tr("Emergency Phone");
+ case AmenityWaterPark: return GeoDataPlacemarkPrivate::tr("Water Park");
+ case AmenityCommunityCentre: return GeoDataPlacemarkPrivate::tr("Community Centre");
+ case AmenityFountain: return GeoDataPlacemarkPrivate::tr("Fountain");
+ case AmenityNightClub: return GeoDataPlacemarkPrivate::tr("Night Club");
+ case AmenityBench: return GeoDataPlacemarkPrivate::tr("Bench");
+ case AmenityCourtHouse: return GeoDataPlacemarkPrivate::tr("Court House");
+ case AmenityFireStation: return GeoDataPlacemarkPrivate::tr("Fire Station");
+ case AmenityHuntingStand: return GeoDataPlacemarkPrivate::tr("Hunting Stand");
+ case AmenityPolice: return GeoDataPlacemarkPrivate::tr("Police");
+ case AmenityPostBox: return GeoDataPlacemarkPrivate::tr("Post Box");
+ case AmenityPostOffice: return GeoDataPlacemarkPrivate::tr("Post Office");
+ case AmenityPrison: return GeoDataPlacemarkPrivate::tr("Prison");
+ case AmenityRecycling: return GeoDataPlacemarkPrivate::tr("Recycling");
+ case AmenityShelter: return GeoDataPlacemarkPrivate::tr("Shelter");
+ case AmenityTelephone: return GeoDataPlacemarkPrivate::tr("Telephone");
+ case AmenityToilets: return GeoDataPlacemarkPrivate::tr("Toilets");
+ case AmenityTownHall: return GeoDataPlacemarkPrivate::tr("Town Hall");
+ case AmenityWasteBasket: return GeoDataPlacemarkPrivate::tr("Waste Basket");
+ case AmenityDrinkingWater: return GeoDataPlacemarkPrivate::tr("Drinking Water");
+ case AmenityGraveyard: return GeoDataPlacemarkPrivate::tr("Graveyard");
+ case BarrierCityWall: return GeoDataPlacemarkPrivate::tr("City Wall");
+ case BarrierGate: return GeoDataPlacemarkPrivate::tr("Gate");
+ case BarrierLiftGate: return GeoDataPlacemarkPrivate::tr("Lift Gate");
+ case BarrierWall: return GeoDataPlacemarkPrivate::tr("Wall");
+ case NaturalPeak: return GeoDataPlacemarkPrivate::tr("Peak");
+ case NaturalTree: return GeoDataPlacemarkPrivate::tr("Tree");
+ case ShopBeverages: return GeoDataPlacemarkPrivate::tr("Beverages");
+ case ShopHifi: return GeoDataPlacemarkPrivate::tr("Hifi");
+ case ShopSupermarket: return GeoDataPlacemarkPrivate::tr("Supermarket");
+ case ShopAlcohol: return GeoDataPlacemarkPrivate::tr("Alcohol");
+ case ShopBakery: return GeoDataPlacemarkPrivate::tr("Bakery");
+ case ShopButcher: return GeoDataPlacemarkPrivate::tr("Butcher");
+ case ShopConfectionery: return GeoDataPlacemarkPrivate::tr("Confectionery");
+ case ShopConvenience: return GeoDataPlacemarkPrivate::tr("Convenience Shop");
+ case ShopGreengrocer: return GeoDataPlacemarkPrivate::tr("Greengrocer");
+ case ShopSeafood: return GeoDataPlacemarkPrivate::tr("Seafood");
+ case ShopDepartmentStore: return GeoDataPlacemarkPrivate::tr("Department Store");
+ case ShopKiosk: return GeoDataPlacemarkPrivate::tr("Kiosk");
+ case ShopBag: return GeoDataPlacemarkPrivate::tr("Bag");
+ case ShopClothes: return GeoDataPlacemarkPrivate::tr("Clothes");
+ case ShopFashion: return GeoDataPlacemarkPrivate::tr("Fashion");
+ case ShopJewelry: return GeoDataPlacemarkPrivate::tr("Jewelry");
+ case ShopShoes: return GeoDataPlacemarkPrivate::tr("Shoes");
+ case ShopVarietyStore: return GeoDataPlacemarkPrivate::tr("Variety Store");
+ case ShopBeauty: return GeoDataPlacemarkPrivate::tr("Beauty");
+ case ShopChemist: return GeoDataPlacemarkPrivate::tr("Chemist");
+ case ShopCosmetics: return GeoDataPlacemarkPrivate::tr("Cosmetics");
+ case ShopHairdresser: return GeoDataPlacemarkPrivate::tr("Hairdresser");
+ case ShopOptician: return GeoDataPlacemarkPrivate::tr("Optician");
+ case ShopPerfumery: return GeoDataPlacemarkPrivate::tr("Perfumery");
+ case ShopDoitYourself: return GeoDataPlacemarkPrivate::tr("Doit Yourself");
+ case ShopFlorist: return GeoDataPlacemarkPrivate::tr("Florist");
+ case ShopHardware: return GeoDataPlacemarkPrivate::tr("Hardware");
+ case ShopFurniture: return GeoDataPlacemarkPrivate::tr("Furniture");
+ case ShopElectronics: return GeoDataPlacemarkPrivate::tr("Electronics");
+ case ShopMobilePhone: return GeoDataPlacemarkPrivate::tr("Mobile Phone");
+ case ShopBicycle: return GeoDataPlacemarkPrivate::tr("Bicycle");
+ case ShopCar: return GeoDataPlacemarkPrivate::tr("Car");
+ case ShopCarRepair: return GeoDataPlacemarkPrivate::tr("Car Repair");
+ case ShopCarParts: return GeoDataPlacemarkPrivate::tr("Car Parts");
+ case ShopMotorcycle: return GeoDataPlacemarkPrivate::tr("Motorcycle");
+ case ShopOutdoor: return GeoDataPlacemarkPrivate::tr("Outdoor");
+ case ShopMusicalInstrument: return GeoDataPlacemarkPrivate::tr("Musical Instrument");
+ case ShopPhoto: return GeoDataPlacemarkPrivate::tr("Photo");
+ case ShopBook: return GeoDataPlacemarkPrivate::tr("Book");
+ case ShopGift: return GeoDataPlacemarkPrivate::tr("Gift");
+ case ShopStationery: return GeoDataPlacemarkPrivate::tr("Stationery");
+ case ShopLaundry: return GeoDataPlacemarkPrivate::tr("Laundry");
+ case ShopPet: return GeoDataPlacemarkPrivate::tr("Pet");
+ case ShopToys: return GeoDataPlacemarkPrivate::tr("Toys");
+ case ShopTravelAgency: return GeoDataPlacemarkPrivate::tr("Travel Agency");
+ case Shop: return GeoDataPlacemarkPrivate::tr("Shop");
+ case ManmadeBridge: return GeoDataPlacemarkPrivate::tr("Bridge");
+ case ManmadeLighthouse: return GeoDataPlacemarkPrivate::tr("Lighthouse");
+ case ManmadePier: return GeoDataPlacemarkPrivate::tr("Pier");
+ case ManmadeWaterTower: return GeoDataPlacemarkPrivate::tr("Water Tower");
+ case ManmadeWindMill: return GeoDataPlacemarkPrivate::tr("Wind Mill");
+ case TouristAttraction: return GeoDataPlacemarkPrivate::tr("Tourist Attraction");
+ case TouristCastle: return GeoDataPlacemarkPrivate::tr("Castle");
+ case TouristCinema: return GeoDataPlacemarkPrivate::tr("Cinema");
+ case TouristInformation: return GeoDataPlacemarkPrivate::tr("Information");
+ case TouristMonument: return GeoDataPlacemarkPrivate::tr("Monument");
+ case TouristMuseum: return GeoDataPlacemarkPrivate::tr("Museum");
+ case TouristRuin: return GeoDataPlacemarkPrivate::tr("Ruin");
+ case TouristTheatre: return GeoDataPlacemarkPrivate::tr("Theatre");
+ case TouristThemePark: return GeoDataPlacemarkPrivate::tr("Theme Park");
+ case TouristViewPoint: return GeoDataPlacemarkPrivate::tr("View Point");
+ case TouristZoo: return GeoDataPlacemarkPrivate::tr("Zoo");
+ case TouristAlpineHut: return GeoDataPlacemarkPrivate::tr("Alpine Hut");
+ case TransportAerodrome: return GeoDataPlacemarkPrivate::tr("Aerodrome");
+ case TransportHelipad: return GeoDataPlacemarkPrivate::tr("Helipad");
+ case TransportAirportGate: return GeoDataPlacemarkPrivate::tr("Airport Gate");
+ case TransportAirportRunway: return GeoDataPlacemarkPrivate::tr("Airport Runway");
+ case TransportAirportApron: return GeoDataPlacemarkPrivate::tr("Airport Apron");
+ case TransportAirportTaxiway: return GeoDataPlacemarkPrivate::tr("Airport Taxiway");
+ case TransportAirportTerminal: return GeoDataPlacemarkPrivate::tr("Airport Terminal");
+ case TransportBusStation: return GeoDataPlacemarkPrivate::tr("Bus Station");
+ case TransportBusStop: return GeoDataPlacemarkPrivate::tr("Bus Stop");
+ case TransportCarShare: return GeoDataPlacemarkPrivate::tr("Car Sharing");
+ case TransportFuel: return GeoDataPlacemarkPrivate::tr("Gas Station");
+ case TransportParking: return GeoDataPlacemarkPrivate::tr("Parking");
+ case TransportParkingSpace: return GeoDataPlacemarkPrivate::tr("Parking Space");
+ case TransportPlatform: return GeoDataPlacemarkPrivate::tr("Platform");
+ case TransportRentalBicycle: return GeoDataPlacemarkPrivate::tr("Rental Bicycle");
+ case TransportRentalCar: return GeoDataPlacemarkPrivate::tr("Rental Car");
+ case TransportTaxiRank: return GeoDataPlacemarkPrivate::tr("Taxi Rank");
+ case TransportTrainStation: return GeoDataPlacemarkPrivate::tr("Train Station");
+ case TransportTramStop: return GeoDataPlacemarkPrivate::tr("Tram Stop");
+ case TransportBicycleParking: return GeoDataPlacemarkPrivate::tr("Bicycle Parking");
+ case TransportMotorcycleParking: return GeoDataPlacemarkPrivate::tr("Motorcycle Parking");
+ case TransportSubwayEntrance: return GeoDataPlacemarkPrivate::tr("Subway Entrance");
+ case ReligionPlaceOfWorship: return GeoDataPlacemarkPrivate::tr("Place Of Worship");
+ case ReligionBahai: return GeoDataPlacemarkPrivate::tr("Bahai");
+ case ReligionBuddhist: return GeoDataPlacemarkPrivate::tr("Buddhist");
+ case ReligionChristian: return GeoDataPlacemarkPrivate::tr("Christian");
+ case ReligionMuslim: return GeoDataPlacemarkPrivate::tr("Muslim");
+ case ReligionHindu: return GeoDataPlacemarkPrivate::tr("Hindu");
+ case ReligionJain: return GeoDataPlacemarkPrivate::tr("Jain");
+ case ReligionJewish: return GeoDataPlacemarkPrivate::tr("Jewish");
+ case ReligionShinto: return GeoDataPlacemarkPrivate::tr("Shinto");
+ case ReligionSikh: return GeoDataPlacemarkPrivate::tr("Sikh");
+ case LeisureGolfCourse: return GeoDataPlacemarkPrivate::tr("Golf Course");
+ case LeisureMarina: return GeoDataPlacemarkPrivate::tr("Marina");
+ case LeisurePark: return GeoDataPlacemarkPrivate::tr("Park");
+ case LeisurePlayground: return GeoDataPlacemarkPrivate::tr("Playground");
+ case LeisurePitch: return GeoDataPlacemarkPrivate::tr("Pitch");
+ case LeisureSportsCentre: return GeoDataPlacemarkPrivate::tr("Sports Centre");
+ case LeisureStadium: return GeoDataPlacemarkPrivate::tr("Stadium");
+ case LeisureTrack: return GeoDataPlacemarkPrivate::tr("Track");
+ case LeisureSwimmingPool: return GeoDataPlacemarkPrivate::tr("Swimming Pool");
+ case LanduseAllotments: return GeoDataPlacemarkPrivate::tr("Allotments");
+ case LanduseBasin: return GeoDataPlacemarkPrivate::tr("Basin");
+ case LanduseCemetery: return GeoDataPlacemarkPrivate::tr("Cemetery");
+ case LanduseCommercial: return GeoDataPlacemarkPrivate::tr("Commercial");
+ case LanduseConstruction: return GeoDataPlacemarkPrivate::tr("Construction");
+ case LanduseFarmland: return GeoDataPlacemarkPrivate::tr("Farmland");
+ case LanduseFarmyard: return GeoDataPlacemarkPrivate::tr("Farmyard");
+ case LanduseGarages: return GeoDataPlacemarkPrivate::tr("Garages");
+ case LanduseGrass: return GeoDataPlacemarkPrivate::tr("Grass");
+ case LanduseIndustrial: return GeoDataPlacemarkPrivate::tr("Industrial");
+ case LanduseLandfill: return GeoDataPlacemarkPrivate::tr("Landfill");
+ case LanduseMeadow: return GeoDataPlacemarkPrivate::tr("Meadow");
+ case LanduseMilitary: return GeoDataPlacemarkPrivate::tr("Military");
+ case LanduseQuarry: return GeoDataPlacemarkPrivate::tr("Quarry");
+ case LanduseRailway: return GeoDataPlacemarkPrivate::tr("Railway");
+ case LanduseReservoir: return GeoDataPlacemarkPrivate::tr("Reservoir");
+ case LanduseResidential: return GeoDataPlacemarkPrivate::tr("Residential");
+ case LanduseRetail: return GeoDataPlacemarkPrivate::tr("Retail");
+ case LanduseOrchard: return GeoDataPlacemarkPrivate::tr("Orchard");
+ case LanduseVineyard: return GeoDataPlacemarkPrivate::tr("Vineyard");
+ case RailwayRail: return GeoDataPlacemarkPrivate::tr("Rail");
+ case RailwayNarrowGauge: return GeoDataPlacemarkPrivate::tr("Narrow Gauge");
+ case RailwayTram: return GeoDataPlacemarkPrivate::tr("Tram");
+ case RailwayLightRail: return GeoDataPlacemarkPrivate::tr("Light Rail");
+ case RailwayAbandoned: return GeoDataPlacemarkPrivate::tr("Abandoned Railway");
+ case RailwaySubway: return GeoDataPlacemarkPrivate::tr("Subway");
+ case RailwayPreserved: return GeoDataPlacemarkPrivate::tr("Preserved Railway");
+ case RailwayMiniature: return GeoDataPlacemarkPrivate::tr("Miniature Railway");
+ case RailwayConstruction: return GeoDataPlacemarkPrivate::tr("Railway Construction");
+ case RailwayMonorail: return GeoDataPlacemarkPrivate::tr("Monorail");
+ case RailwayFunicular: return GeoDataPlacemarkPrivate::tr("Funicular Railway");
+ case PowerTower: return GeoDataPlacemarkPrivate::tr("Power Tower");
+ case AdminLevel1: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 1)");
+ case AdminLevel2: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 2)");
+ case AdminLevel3: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 3)");
+ case AdminLevel4: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 4)");
+ case AdminLevel5: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 5)");
+ case AdminLevel6: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 6)");
+ case AdminLevel7: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 7)");
+ case AdminLevel8: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 8)");
+ case AdminLevel9: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 9)");
+ case AdminLevel10: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 10)");
+ case AdminLevel11: return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 11)");
+ case BoundaryMaritime: return GeoDataPlacemarkPrivate::tr("Boundary (Maritime)");
+ case Landmass: return GeoDataPlacemarkPrivate::tr("Land Mass");
+ case UrbanArea: return GeoDataPlacemarkPrivate::tr("Urban Area");
+ case InternationalDateLine: return GeoDataPlacemarkPrivate::tr("International Date Line");
+ case Bathymetry: return GeoDataPlacemarkPrivate::tr("Bathymetry");
+
+ case Default:
+ case Unknown:
+ case None:
+ case LastIndex: return QString();
+ }
+ return QString();
+}
qreal GeoDataPlacemark::area() const
{
diff --git a/src/lib/marble/geodata/data/GeoDataPlacemark.h b/src/lib/marble/geodata/data/GeoDataPlacemark.h
index 541465b..9c9c72d 100644
--- a/src/lib/marble/geodata/data/GeoDataPlacemark.h
+++ b/src/lib/marble/geodata/data/GeoDataPlacemark.h
@@ -82,6 +82,17 @@ class GEODATA_EXPORT GeoDataPlacemark: public GeoDataFeature
bool operator!=( const GeoDataPlacemark& other ) const;
/**
+ * Return the symbol index of the placemark.
+ */
+ GeoDataVisualCategory visualCategory() const;
+
+ /**
+ * Sets the symbol @p index of the placemark.
+ * @param category the new category to be used.
+ */
+ void setVisualCategory(GeoDataVisualCategory category);
+
+ /**
* Return the coordinates of the placemark at time @p dateTime as a GeoDataCoordinates
*
* The @p dateTime parameter should be used if the placemark geometry() is a
@@ -105,9 +116,14 @@ class GEODATA_EXPORT GeoDataPlacemark: public GeoDataFeature
const GeoDataGeometry* geometry() const;
/**
- * @brief displays the name of a place in the locale language of the user
- */
- QString displayName() const;
+ * @brief displays the name of a place in the locale language of the user
+ */
+ QString displayName() const;
+
+ /**
+ * @since 0.26.0
+ */
+ QString categoryName() const;
/**
* Return the coordinates of the placemark as @p longitude,
diff --git a/src/lib/marble/geodata/data/GeoDataPlacemark_p.h b/src/lib/marble/geodata/data/GeoDataPlacemark_p.h
index 13b5cb7..8ac0189 100644
--- a/src/lib/marble/geodata/data/GeoDataPlacemark_p.h
+++ b/src/lib/marble/geodata/data/GeoDataPlacemark_p.h
@@ -58,11 +58,14 @@ public:
class GeoDataPlacemarkPrivate : public GeoDataFeaturePrivate
{
+ Q_DECLARE_TR_FUNCTIONS(GeoDataPlacemark)
+
public:
- GeoDataPlacemarkPrivate()
- : m_geometry( new GeoDataPoint ),
+ GeoDataPlacemarkPrivate() :
+ m_geometry(new GeoDataPoint),
m_population( -1 ),
- m_placemarkExtendedData(nullptr)
+ m_placemarkExtendedData(nullptr),
+ m_visualCategory(GeoDataFeature::Default)
{
}
@@ -80,6 +83,7 @@ class GeoDataPlacemarkPrivate : public GeoDataFeaturePrivate
GeoDataFeaturePrivate::operator=( other );
m_population = other.m_population;
+ m_visualCategory = other.m_visualCategory;
GeoDataGeometry * geometry = 0;
if ( other.m_geometry ) {
@@ -159,6 +163,7 @@ class GeoDataPlacemarkPrivate : public GeoDataFeaturePrivate
GeoDataGeometry *m_geometry; // any GeoDataGeometry entry like locations
qint64 m_population; // population in number of inhabitants
GeoDataPlacemarkExtendedData *m_placemarkExtendedData;
+ GeoDataFeature::GeoDataVisualCategory m_visualCategory; // the visual category
static const OsmPlacemarkData s_nullOsmPlacemarkData;
static const GeoDataPlacemarkExtendedData s_nullPlacemarkExtendedData;
diff --git a/src/lib/marble/graphicsview/GeoGraphicsItem.cpp b/src/lib/marble/graphicsview/GeoGraphicsItem.cpp
index 7c7c81c..bcc45b5 100644
--- a/src/lib/marble/graphicsview/GeoGraphicsItem.cpp
+++ b/src/lib/marble/graphicsview/GeoGraphicsItem.cpp
@@ -12,6 +12,7 @@
#include "GeoGraphicsItem.h"
#include "GeoGraphicsItem_p.h"
+#include "GeoDataTypes.h"
#include "GeoDataPlacemark.h"
// Qt
@@ -86,8 +87,13 @@ GeoDataStyle::ConstPtr GeoGraphicsItem::style() const
}
if (!d->m_style) {
- auto const styling = StyleParameters(d->m_feature, d->m_renderContext.tileLevel());
- d->m_style = d->m_styleBuilder->createStyle(styling);
+ if (d->m_feature->nodeType() == GeoDataTypes::GeoDataPlacemarkType) {
+ const GeoDataPlacemark *placemark = static_cast<const GeoDataPlacemark*>(d->m_feature);
+ auto const styling = StyleParameters(placemark, d->m_renderContext.tileLevel());
+ d->m_style = d->m_styleBuilder->createStyle(styling);
+ } else {
+ d->m_style = d->m_feature->style();
+ }
}
return d->m_style;
diff --git a/src/lib/marble/layers/GeometryLayer.cpp b/src/lib/marble/layers/GeometryLayer.cpp
index 4acf5f3..62d8b8f 100644
--- a/src/lib/marble/layers/GeometryLayer.cpp
+++ b/src/lib/marble/layers/GeometryLayer.cpp
@@ -441,8 +441,13 @@ QVector<const GeoDataFeature *> GeometryLayer::whichBuildingAt(const QPoint &cur
const int maxZoom = qMin<int>(qMax<int>(qLn(viewport->radius()*4/256)/qLn(2.0), 1), d->m_styleBuilder->maximumZoomLevel());
foreach ( GeoGraphicsItem * item, d->m_scene.items( viewport->viewLatLonAltBox(), maxZoom ) ) {
- if (item->feature()->visualCategory() == GeoDataFeature::Building && item->feature()->nodeType() == GeoDataTypes::GeoDataPlacemarkType ) {
+ if (item->feature()->nodeType() == GeoDataTypes::GeoDataPlacemarkType) {
const GeoDataPlacemark* placemark = static_cast<const GeoDataPlacemark*>(item->feature());
+
+ if (placemark->visualCategory() != GeoDataFeature::Building) {
+ continue;
+ }
+
if (placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPolygonType) {
const GeoDataPolygon *polygon = static_cast<const GeoDataPolygon*>(placemark->geometry());
if (polygon->contains(coordinates)) {