mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-05-01 14:06:40 +07:00
touchHinter wider on mobile;
This commit is contained in:
parent
9b0e2bc3e1
commit
f7e2831d3b
4 changed files with 35 additions and 27 deletions
src/utils
|
@ -50,11 +50,11 @@ export const getPolyLength = (latlngs: LatLngLiteral[]): number => {
|
|||
};
|
||||
|
||||
// if C between A and B
|
||||
export const pointInArea = (A: LatLng, B: LatLng, C: LatLng): boolean => (
|
||||
C.lat >= Math.min(A.lat, B.lat) &&
|
||||
C.lat <= Math.max(A.lat, B.lat) &&
|
||||
C.lng >= Math.min(A.lng, B.lng) &&
|
||||
C.lng <= Math.max(A.lng, B.lng)
|
||||
export const pointInArea = (A: LatLng, B: LatLng, C: LatLng, radius: number = 0.001): boolean => (
|
||||
C.lng <= Math.max(A.lng + radius, B.lng + radius) &&
|
||||
C.lat <= Math.max(A.lat + radius, B.lat + radius) &&
|
||||
C.lat >= Math.min(A.lat - radius, B.lat - radius) &&
|
||||
C.lng >= Math.min(A.lng - radius, B.lng - radius)
|
||||
);
|
||||
|
||||
|
||||
|
@ -80,6 +80,6 @@ const distToSegmentSquared = (A: LatLng, B: LatLng, C: LatLng): number => {
|
|||
});
|
||||
};
|
||||
|
||||
const distToSegment = (A: LatLng, B: LatLng, C: LatLng): number => Math.sqrt(distToSegmentSquared(A, B, C));
|
||||
export const distToSegment = (A: LatLng, B: LatLng, C: LatLng): number => Math.sqrt(distToSegmentSquared(A, B, C));
|
||||
// if C between A and B
|
||||
export const pointBetweenPoints = (A: LatLng, B: LatLng, C: LatLng): boolean => (distToSegment(A, B, C) < 0.01);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue