Commit 0f6c059a authored by Volker Krause's avatar Volker Krause
Browse files

Separate dock-based and floating rental vehicles

This avoids the pointless display of the number of available vehicles
for floating vehicles, and it will enable showing more details about
available vehicle types at docks going forward.
parent 87c21f4e
Pipeline #79477 passed with stage
in 17 seconds
......@@ -45,6 +45,7 @@ void LocationQueryOverlayProxyModel::setMapData(const MapData &data)
m_tagKeys.network = m_data.dataSet().makeTagKey("network");
m_tagKeys.mxoid = m_data.dataSet().makeTagKey("mx:oid");
m_tagKeys.remainingRange = m_data.dataSet().makeTagKey("mx:remaining_range");
m_tagKeys.vehicle = m_data.dataSet().makeTagKey("mx:vehicle");
}
initialize();
......@@ -195,20 +196,19 @@ LocationQueryOverlayProxyModel::Info LocationQueryOverlayProxyModel::nodeForRow(
case RentalVehicle::Unknown:
case RentalVehicle::Bicycle:
case RentalVehicle::Pedelec:
OSM::setTagValue(info.overlayNode, m_tagKeys.amenity, "bicycle_rental");
OSM::setTagValue(info.overlayNode, m_tagKeys.vehicle, "bicycle_rental");
break;
case RentalVehicle::ElectricKickScooter:
OSM::setTagValue(info.overlayNode, m_tagKeys.amenity, "scooter_rental");
OSM::setTagValue(info.overlayNode, m_tagKeys.vehicle, "scooter_rental");
break;
case RentalVehicle::ElectricMoped:
OSM::setTagValue(info.overlayNode, m_tagKeys.amenity, "motorcycle_rental");
OSM::setTagValue(info.overlayNode, m_tagKeys.vehicle, "motorcycle_rental");
break;
case RentalVehicle::Car:
OSM::setTagValue(info.overlayNode, m_tagKeys.amenity, "car_rental");
OSM::setTagValue(info.overlayNode, m_tagKeys.vehicle, "car_rental");
break;
}
OSM::setTagValue(info.overlayNode, m_tagKeys.name, loc.name().toUtf8());
OSM::setTagValue(info.overlayNode, m_tagKeys.realtimeAvailable, "1");
if (OSM::tagValue(info.overlayNode, m_tagKeys.network).isEmpty() && !loc.rentalVehicle().network().name().isEmpty()) {
OSM::setTagValue(info.overlayNode, m_tagKeys.network, loc.rentalVehicle().network().name().toUtf8());
}
......
......@@ -68,6 +68,7 @@ private:
OSM::TagKey network;
OSM::TagKey mxoid;
OSM::TagKey remainingRange;
OSM::TagKey vehicle;
} m_tagKeys;
std::vector<Info> m_nodes;
......
......@@ -195,6 +195,7 @@ struct {
M("fee", Fee, UnresolvedCategory),
M("maxstay", MaxStay, Parking),
M("mx:remaining_range", RemainingRange, Main),
M("mx:vehicle", Category, Header),
M("network", Network, Operator),
M("office", Category, Header),
M("old_name", OldName, UnresolvedCategory),
......@@ -468,6 +469,7 @@ QVariant OSMElementInformationModel::valueForKey(Info info) const
l += m_element.tagValue("tourism").split(';');
l += m_element.tagValue("vending").split(';');
l += m_element.tagValue("office").split(';');
l += m_element.tagValue("mx:vehicle");
if (l.isEmpty()) {
l += m_element.tagValue("room").split(';');
}
......
......@@ -460,10 +460,10 @@ node|z20-[vending=public_transport_tickets] {
icon-opacity: 0.0;
}
// bicycle rental
// vehicle rental stations
*|z18-[amenity=bicycle_rental] {
icon-color: #3daee9;
icon-image: "bicycle_rental";
icon-image: amenity;
text: ""; // suppress generic names messing up the layouting when we have realtime data (see below)
}
*|z18-[amenity=bicycle_rental][mx:realtime_available=0] {
......@@ -477,15 +477,20 @@ node|z20-[vending=public_transport_tickets] {
text-color: #27ae60;
}
*|z18-[amenity=car_rental][mx:realtime_available>0],
*|z18-[amenity=motorcycle_rental][mx:realtime_available>0],
*|z18-[amenity=scooter_rental][mx:realtime_available>0]
// free floating rental vehicles
*|z18-[mx:vehicle=bicycle_rental],
*|z18-[mx:vehicle=car_rental],
*|z18-[mx:vehicle=motorcycle_rental],
*|z18-[mx:vehicle=scooter_rental]
{
icon-image: amenity;
icon-image: mx:vehicle;
icon-color: #27ae60;
text: "";
}
*|z18-[amenity=scooter_rental][mx:realtime_available>0][mx:remaining_range<5000]
*|z18-[mx:vehicle=bicycle_rental][mx:remaining_range<5000],
*|z18-[mx:vehicle=car_rental][mx:remaining_range<30000],
*|z18-[mx:vehicle=motorcycle_rental][mx:remaining_range<5000],
*|z18-[mx:vehicle=scooter_rental][mx:remaining_range<5000]
{
icon-color: #fdbc4b;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment