Skip to content

Commit 9d1a22a

Browse files
committed
improved(editor): use cross layer styling to ensure routing-point is always rendered below display-point
Signed-off-by: Tim Deubler <[email protected]>
1 parent b102b59 commit 9d1a22a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/editor/src/features/location/RoutingPoint.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,22 @@ function NvtRoutingPoint(location, locTools, lnkTools) {
156156
if (cLink && !car) {
157157
const editorType = location.class;
158158

159+
let zLayer = EDITOR.display.getLayers().indexOf(EDITOR.getLayer(this.getLink()));
160+
161+
zLayer = zLayer == -1 ? UNDEF : zLayer + 1;
162+
159163
streetLine = EDITOR.objects.overlay.addPath([
160164
location.coord().slice(),
161165
routingPoint.slice()
162166
],
163167
UNDEF, {
164-
type: editorType + '_LINE'
168+
type: editorType + '_LINE',
169+
zLayer: zLayer
165170
});
166171

167-
168172
car = EDITOR.objects.overlay.addPoint(routingPoint.slice(), {
169-
type: editorType + '_ROUTING_POINT'
173+
type: editorType + '_ROUTING_POINT',
174+
zLayer: zLayer
170175
});
171176

172177
car.pointerdown = clickCar;

packages/editor/src/styles/OverlayStyles.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const getValue = (val, feature, zoomlevel: number) => {
4646

4747

4848
const createHighlightLineStyle = () => [{
49+
// zLayer: 2,
4950
zIndex: 0,
5051
type: 'Line',
5152
strokeWidth: 2,
@@ -61,13 +62,15 @@ const createSelectorStyle = () => [{
6162
}];
6263

6364
const createRoutingPointStyle = () => [{
64-
zIndex: 0,
65+
zLayer: (feature) => feature.properties.zLayer,
66+
zIndex: 999990,
6567
type: 'Circle',
6668
radius: 8,
6769
fill: '#FF0000',
6870
stroke: '#FF0000'
6971
}, {
70-
zIndex: 1,
72+
zLayer: (feature) => feature.properties.zLayer,
73+
zIndex: 999991,
7174
type: 'Circle',
7275
radius: 5,
7376
fill: '#FF0000',

0 commit comments

Comments
 (0)