Skip to content

Commit

Permalink
Merge pull request #70 from Woosmap/dev/main_route_name
Browse files Browse the repository at this point in the history
  • Loading branch information
lpernelle-woosmap authored Oct 29, 2024
2 parents bf8d7a3 + ba14baa commit 1c9a55a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@11ty/eleventy": "^2.0.1",
"@11ty/eleventy-img": "^1.1.0",
"@playwright/test": "^1.40.1",
"@types/woosmap.map": "^1.4.14",
"@types/woosmap.map": "^1.4.15",
"@types/supercluster": "^7.1.3",
"@types/geojson": "^7946.0.14",
"@typescript-eslint/eslint-plugin": "^5.62.0",
Expand Down
4 changes: 2 additions & 2 deletions samples/directions-advanced/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ function createRoutesTable(response: woosmap.map.DirectionResult) {
travelModeIcons["DRIVING"];

directionTrip.innerHTML = `
<img class="directionTrip__travelModeIcon" src="${travelModeIconSrc}">
<img alt="travel mode" class="directionTrip__travelModeIcon" src="${travelModeIconSrc}">
<div class="directionTrip__description">
<div class="directionTrip__numbers">
<div class="directionTrip__duration">${formatTime(durationTotal)}</div>
<div class="directionTrip__distance">${formatDistance(distanceTotal)}</div>
</div>
<div class="directionTrip__title">through ${leg.start_address ? leg.start_address : JSON.stringify(leg.start_location)}</div>
<div class="directionTrip__title">through ${route.main_route_name ? route.main_route_name : JSON.stringify(leg.start_location)}</div>
<div class="directionTrip__summary">${formatTime(durationTotal)} ${directionsRequest.departure_time || directionsRequest.arrival_time ? "with" : "without"} traffic</div>
<div class="directionTrip__detailsMsg"></div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions samples/marker-html-css/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ function initMap(): void {
}

private appendDivToOverlay(): void {
// @ts-ignore
const panes = this.getPanes();
if (panes && this.div) {
panes.overlayImage.appendChild(this.div);
panes.floatPane.appendChild(this.div);
}
}

private positionDiv(): void {
// @ts-ignore
const point = this.getProjection()?.fromLatLngToDivPixel(this.latlng);
if (point && this.div) {
// Offset should depend on the style of your popover
const offsetWidth = this.div.offsetWidth / 2; // 50% of div width
const offsetHeight = this.div.offsetHeight + 6; // Full height of div plus the arrow height
// @ts-ignore
this.div.style.left = `${point.x - offsetWidth}px`;
// @ts-ignore
this.div.style.top = `${point.y - offsetHeight}px`;
}
}
Expand Down

0 comments on commit 1c9a55a

Please sign in to comment.