Commit fa5de027 authored by Akshat Tandon's avatar Akshat Tandon

Add marine indicators/boundaries

Summary:
**Rendering**
{F157962}

Fix for the following issue
1) Rendering issue: Maritime boundaries
Difficulty: EASY

Check e.g. the boundaries on the baltic sea between the islands of Germany and Denmark. They don't get rendered yet. They should be using #88b3bf

Reviewers: rahn, nienhueser

Reviewed By: nienhueser

Subscribers: #marble

Tags: #marble

Differential Revision: https://phabricator.kde.org/D1997
parent 97e6652b
......@@ -605,6 +605,8 @@ void StyleBuilder::Private::initializeDefaultStyles()
s_defaultStyle[GeoDataFeature::AdminLevel10] = StyleBuilder::Private::createStyle(1.5, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 );
s_defaultStyle[GeoDataFeature::AdminLevel11] = StyleBuilder::Private::createStyle(1.5, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 );
s_defaultStyle[GeoDataFeature::BoundaryMaritime] = StyleBuilder::Private::createStyle(2.0, 0.0, "#88b3bf", "#88b3bf", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false );
s_defaultStyle[GeoDataFeature::Satellite]
= GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/satellite.png" ),
QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor ));
......@@ -757,7 +759,16 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
GeoDataLineStyle lineStyle = style->lineStyle();
lineStyle.setCosmeticOutline(true);
if (visualCategory >= GeoDataFeature::HighwayService &&
if(visualCategory == GeoDataFeature::AdminLevel2){
if (osmData.containsTag("maritime", "yes") ) {
lineStyle.setColor("#88b3bf");
polyStyle.setColor("#88b3bf");
if( osmData.containsTag("marble:disputed", "yes") ){
lineStyle.setPenStyle( Qt::DashLine );
}
}
}
else if (visualCategory >= GeoDataFeature::HighwayService &&
visualCategory <= GeoDataFeature::HighwayMotorway) {
if (parameters.tileLevel >= 0 && parameters.tileLevel <= 7) {
......@@ -807,7 +818,6 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
lineStyle.setPhysicalWidth(ok ? qBound(0.1f, width, 200.0f) : 0.0f);
}
}
GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
newStyle->setPolyStyle(polyStyle);
newStyle->setLineStyle(lineStyle);
......
......@@ -451,6 +451,7 @@ QString GeoDataFeature::visualCategoryName(GeoDataFeature::GeoDataVisualCategory
s_visualCategoryNames[AdminLevel9] = "AdminLevel9";
s_visualCategoryNames[AdminLevel10] = "AdminLevel10";
s_visualCategoryNames[AdminLevel11] = "AdminLevel11";
s_visualCategoryNames[BoundaryMaritime] = "BoundaryMaritime";
s_visualCategoryNames[LastIndex] = "LastIndex";
}
......
......@@ -413,6 +413,8 @@ class GEODATA_EXPORT GeoDataFeature : public GeoDataObject
AdminLevel10,
AdminLevel11,
BoundaryMaritime,
//Custom OSM Tags
Landmass,
UrbanArea,
......
......@@ -360,7 +360,7 @@ void GeometryLayerPrivate::initializeDefaultValues()
s_defaultMinZoomLevels[GeoDataFeature::AdminLevel10] = 8;
s_defaultMinZoomLevels[GeoDataFeature::AdminLevel11] = 8;
s_defaultMinZoomLevels[GeoDataFeature::BoundaryMaritime] = 1;
for ( int i = 0; i < GeoDataFeature::LastIndex; ++i ) {
s_maximumZoomLevel = qMax( s_maximumZoomLevel, s_defaultMinZoomLevels[i] );
}
......
......@@ -44,6 +44,8 @@ void OsmPresetLibrary::initializeOsmVisualCategories()
s_visualCategories[ OsmTag( "admin_level", "10" ) ] = GeoDataFeature::AdminLevel10;
s_visualCategories[ OsmTag( "admin_level", "11" ) ] = GeoDataFeature::AdminLevel11;
s_visualCategories[ OsmTag( "boundary", "maritime" ) ] = GeoDataFeature::BoundaryMaritime;
s_visualCategories[ OsmTag( "amenity", "restaurant" ) ] = GeoDataFeature::FoodRestaurant;
s_visualCategories[ OsmTag( "amenity", "fast_food" ) ] = GeoDataFeature::FoodFastFood;
s_visualCategories[ OsmTag( "amenity", "pub" ) ] = GeoDataFeature::FoodPub;
......
......@@ -258,11 +258,11 @@ def feature_class(data):
'Pacific Groupings': [],
'Admin-1 boundary': [('boundary', 'administrative'), ('admin_level', '4')],
'Map unit boundary':[],
'Marine Indicator Treaty':[],
'Marine Indicator Median':[],
'Boundary Treaty':[],
'Marine Indicator 200 mi nl':[],
'Marine Indicator Disputed':[],
'Marine Indicator Treaty':[('boundary', 'administrative'), ('admin_level', '2'), ('maritime', 'yes'), ('border_type', 'territorial')],
'Marine Indicator Median':[('boundary', 'administrative'), ('admin_level', '2'), ('maritime', 'yes'), ('border_type', 'territorial')],
'Boundary Treaty':[('boundary', 'administrative'), ('admin_level', '2'), ('maritime', 'yes'), ('border_type', 'territorial')],
'Marine Indicator 200 mi nl':[('boundary', 'maritime'), ('border_type', 'eez')],
'Marine Indicator Disputed':[('boundary', 'administrative'), ('admin_level', '2'), ('maritime', 'yes'), ('border_type', 'territorial'), ('marble:disputed', 'yes')],
'Claim boundary': [('boundary', 'administrative'), ('admin_level', '2')],
'Reference line': [('boundary', 'administrative'), ('admin_level', '2')],
'Breakaway': [('boundary', 'administrative'), ('admin_level', '2')],
......
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