Comments (6)
I am missing routeWay->SetFeatures(features);
in your snippet
from libosmscout.
Strange:
In the standard configuration (standard.oss) in include/route.oss you can find:
OSS
CONST
COLOR routeColor = #ff000088;
STYLE
[MAG world-] {
[TYPE _route] WAY {color: @routeColor; displayWidth: 1.5mm; width: 6m; priority: 100; }
}
END
Important in context is the priority: 100
. This sets WayData.priority. See also OSS.atg/WAYGROUP where WayData.wayPriority is set.
See also MapPainter::WayData::operator<
which orders the way. Ways are rendered in the resulting order.
Which should result in the route being the last entry in the way render list, thus rendering on top of everything else. Looking at the code however, it seems like the way needs to have a "high" layer value for this, too, to be rendered after "lower" layers like bridges (which should have low positive values).
In the Qt code, the initialization for the route is done in OverlayObject.cpp/OverlayWay::toWay (and functions called from there).
In the header, you see that Overlay objects have
int8_t layer{std::numeric_limits<int8_t>::max()};
:-)
I assume some of these internal "tricks" are missing in your code?
from libosmscout.
@Karry : Right?
We also have zIndex. I do not remember the purpose of this one. Karry, can you help? We should also document it ;-)
from libosmscout.
Just see "Section ORDER WAYS" in our documentation
This section defines in which order ways are rendered. It defines a number groups which contains ways types. Ways types in the same group have the same rendering priority. Groups further down the style sheet are rendered below ways further up in the GROUP list. Rendering order is only relevant if ways of different types cross each other. Note that ways are first ordered by layer, then within a layer by rendering priority. So a bridge will always be rendered on top a “bridged” way, a tunnel always below a “tunneled” ways.
And yes, in Qt, I just setup layer to maximum for "overlay" objects.
Regarding zIndex, it is really missing in documentation. Looking to stylesheets, it seems to me that it is used just for way decorations - to render outlines first. With that, I would guess that zIndex is used as last property for sorting (just order individual lines for the same way), but looking to the code, sorting order is: layer, zIndex, style priority, style sheet priority (ORDER WAYS). Should we change it?
from libosmscout.
Thank you @Framstag and @Karry for the hints, I checked all this in my code, tried to use the standard.oss stylesheet from the distribution but the rendering is still the same...
Maybe the issue is in the code I use to inject the _route
path ?
std::vector<RenderSteps> renderSteps {
FirstStep, DrawAreas, DrawWays, DrawHillShading, DrawLabels, LastStep
};
unsigned long lastMapIndex = ctx->mapServices.size() - 1;
for (int step = 0; step < renderSteps.size()/2; step++) {
RenderSteps startRenderStep = renderSteps[step*2];
RenderSteps endRenderStep = renderSteps[step*2 + 1];
// render the active maps
for(int i = 0; i <= lastMapIndex; i++){
...
// Append the routeWay data in the last rendered database to paint it on top
if (i == lastMapIndex && step == 0 && routeWay) {
TypeInfoRef type=ctx->databases[i]->GetTypeConfig()->GetTypeInfo("_route");
osmscout::FeatureValueBuffer features;
size_t featureIndex;
features.SetType(type);
if (type->GetFeature(osmscout::LayerFeature::NAME,
featureIndex)) {
auto* value=dynamic_cast<osmscout::LayerFeatureValue*>(features.AllocateValue(featureIndex));
assert(value);
value->SetLayer(std::numeric_limits<int8_t>::max());
}
if (type){
if(routeWay){
if (!routeWay->GetType()) {
routeWay->SetType(type);
}
ctx->datas[i].ways.push_back(routeWay);
}
}
...
from libosmscout.
Thank you @Karry, this is the solution !
from libosmscout.
Related Issues (20)
- Why so many build techs? HOT 2
- BoundingBox of imported database too big HOT 6
- What about make Qt 6 the default in CMakelists.txt? HOT 6
- Importing data into an existing database / merging databases HOT 8
- Bounding box and Speed HOT 2
- PlaneMapRenderer redraws map only on center change, not on zoom change HOT 1
- Rendering Maldives lags libosmscout and gives a lot font errors HOT 8
- Implementing a tile server via libosmcout HOT 7
- Layer rendering issues with tile rendering HOT 1
- Lots of "Warning: Unknown type" HOT 18
- Question regarding RoutingDatabase::GetRouteNodes() HOT 2
- Way missing in MapService query HOT 5
- `MapService::LoadMissingTileData()` produces more data than expected HOT 7
- Missing forest near Swedish national park Muddus HOT 1
- Compilation issues for iOS and XCode 15 HOT 5
- Add libosmscout to Taginfo Projects HOT 2
- Searching for "Zbraslavice 255" in Czechia give no results, but "Zbraslavice Zbraslavice 255" yes
- Compilation error for libosmscout-client on MacOS HOT 3
- Build fails because Config.h isn't installed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libosmscout.