@@ -17,8 +17,8 @@ import {
1717import { LineString } from 'geojson'
1818import { getTranslation , tr } from '@/translation/Translation'
1919import * as config from 'config'
20- import { Coordinate } from '@/stores/QueryStore'
2120import { POIQuery } from '@/pois/AddressParseResult'
21+ import { Coordinate } from '@/utils'
2222
2323interface ApiProfile {
2424 name : string
@@ -456,25 +456,4 @@ export class ApiImpl implements Api {
456456 public static isTruck ( profile : string ) {
457457 return profile . includes ( 'truck' )
458458 }
459-
460- public static getBBoxPoints ( points : Coordinate [ ] ) : Bbox | null {
461- const bbox : Bbox = points . reduce (
462- ( res : Bbox , c ) => [
463- Math . min ( res [ 0 ] , c . lng ) ,
464- Math . min ( res [ 1 ] , c . lat ) ,
465- Math . max ( res [ 2 ] , c . lng ) ,
466- Math . max ( res [ 3 ] , c . lat ) ,
467- ] ,
468- [ 180 , 90 , - 180 , - 90 ] as Bbox
469- )
470- if ( points . length == 1 ) {
471- bbox [ 0 ] = bbox [ 0 ] - 0.001
472- bbox [ 1 ] = bbox [ 1 ] - 0.001
473- bbox [ 2 ] = bbox [ 2 ] + 0.001
474- bbox [ 3 ] = bbox [ 3 ] + 0.001
475- }
476-
477- // return null if the bbox is not valid, e.g. if no url points were given at all
478- return bbox [ 0 ] < bbox [ 2 ] && bbox [ 1 ] < bbox [ 3 ] ? bbox : null
479- }
480459}
0 commit comments