Skip to content

Commit

Permalink
smaller waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
vcoppe committed Jun 20, 2024
1 parent 6003d8b commit b0ac352
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
32 changes: 31 additions & 1 deletion website/src/lib/components/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,38 @@
@apply shadow-none;
}
div :global(.mapboxgl-popup-tip) {
div :global(.mapboxgl-popup-anchor-top .mapboxgl-popup-tip) {
@apply border-b-background;
}
div :global(.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip) {
@apply border-b-background;
}
div :global(.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip) {
@apply border-b-background;
}
div :global(.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip) {
@apply border-t-background;
@apply drop-shadow-md;
}
div :global(.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip) {
@apply border-t-background;
@apply drop-shadow-md;
}
div :global(.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip) {
@apply border-t-background;
@apply drop-shadow-md;
}
div :global(.mapboxgl-popup-anchor-left .mapboxgl-popup-tip) {
@apply border-r-background;
}
div :global(.mapboxgl-popup-anchor-right .mapboxgl-popup-tip) {
@apply border-l-background;
}
</style>
3 changes: 2 additions & 1 deletion website/src/lib/components/gpx-layer/GPXLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ export class GPXLayer {
Object.defineProperty(this.markers[markerIndex], '_waypoint', { value: waypoint, writable: true });
} else {
let marker = new mapboxgl.Marker({
draggable: this.draggable
draggable: this.draggable,
scale: 0.8
}).setLngLat(waypoint.getCoordinates());
Object.defineProperty(marker, '_waypoint', { value: waypoint, writable: true });
let dragEndTimestamp = 0;
Expand Down
12 changes: 11 additions & 1 deletion website/src/lib/components/gpx-layer/WaypointPopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ export const currentPopupWaypoint = writable<[Waypoint, string] | null>(null);

export const waypointPopup = new mapboxgl.Popup({
closeButton: false,
maxWidth: undefined
maxWidth: undefined,
offset: {
'top': [0, 0],
'top-left': [0, 0],
'top-right': [0, 0],
'bottom': [0, -30],
'bottom-left': [0, -30],
'bottom-right': [0, -30],
'left': [0, 0],
'right': [0, 0]
},
});

export function deleteWaypoint(fileId: string, waypointIndex: number) {
Expand Down

0 comments on commit b0ac352

Please sign in to comment.