Skip to content

Add routing graph layer - #210

Merged
easbar merged 5 commits into
masterfrom
routing_graph_layer
Sep 5, 2022
Merged

easbar merged 5 commits into
masterfrom
routing_graph_layer

Conversation

@easbar

@easbar easbar commented Sep 4, 2022 •

Copy link
Copy Markdown
Member

Fixes #24.

Should be quite similar to what we had in GH maps 1. Maybe the biggest difference is that I put the road details into popup shown on top of the map. To enable the feature we need to set routingGraphLayerAllowed: true in config-local.js.

The popup looks like this currently:

image

@easbar easbar changed the title Routing graph layer Add routing graph layer Sep 4, 2022
Comment thread src/index.tsx
import { getApi, setApi } from '@/api/Api'
import MapActionReceiver from '@/stores/MapActionReceiver'
import { createMap, getMap, setMap } from '@/map/map'
import MapFeatureStore from '@/stores/MapFeatureStore'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know where else to put the coordinate and contents of the hover popup, so I added a new store that we can maybe use for other similar things as well...

@easbar

easbar commented Sep 4, 2022 •

Copy link
Copy Markdown
Member Author

Currently the graph layer is (partly) hidden when a vector layer is used as background layer, but maybe we can ignore this for now as our focus lies on raster backgrounds.

Update: I now set a z-index > 0 for the routing graph layer (b9549f4) so it always stays on top of the background layer, because the same problem occurred also for raster tile background layers when we toggled the routing graph layer. The text labels are still below the routing graph though.

Btw: In a previous version I tried showing the graph layer above the vector background, but below the map labels. I was able to identify the label layers by checking layer.type === 'symbol'.

@karussell

karussell commented Sep 5, 2022 •

Copy link
Copy Markdown
Member

Cool, this is really great! (I like the popup version more as it is closer to the cursor)

Btw: In a previous version I tried showing the graph layer above the vector background, but below the map labels. I was able to identify the label layers by checking layer.type === 'symbol'.

It reads as you did not do this but in my case the labels are already above the routing graph :) (!?)

minor thing: it would be nice to enable the layer also when clicking on the label but I couldn't fix it quickly as the e.target.checked is not available in the parent.

@easbar

easbar commented Sep 5, 2022

Copy link
Copy Markdown
Member Author

It reads as you did not do this but in my case the labels are already above the routing graph :) (!?)

Yes, apparently they are. But why? Oh, well :)

minor thing: it would be nice to enable the layer also when clicking on the label but I couldn't fix it quickly as the e.target.checked is not available in the parent.

Good idea. I fixed this, see last commit.

@karussell

Copy link
Copy Markdown
Member

Yes, apparently they are. But why? Oh, well :)

(Maybe this z layer change?)

Good idea. I fixed this, see last commit.

Oh, nice. So simple :)

LGTM!

@easbar
easbar merged commit d772571 into master Sep 5, 2022
@easbar
easbar deleted the routing_graph_layer branch September 5, 2022 07:22
@easbar

easbar commented Sep 5, 2022

Copy link
Copy Markdown
Member Author

(Maybe this z layer change?)

Yes, maybe. The path layer is shown on top of the labels, but it has a higher z-level, too.

@karussell karussell added this to the 0.4 milestone Sep 5, 2022
ZeroGxMax pushed a commit to minhhpkp/graphhopper-maps that referenced this pull request Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

routing graph as vector tiles (only for development)

2 participants