File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import PointAnchor from './point_anchor' ;
22import { boxIntersectsList } from './intersect' ;
3- import Utils from '../utils/utils' ;
43import OBB from '../utils/obb' ;
54import Geo from '../utils/geo' ;
65// import log from '../utils/log';
@@ -79,13 +78,10 @@ export default class Label {
7978
8079 // checks whether the label is within the tile boundaries
8180 inTileBounds ( ) {
82- let min = [ this . aabb [ 0 ] , this . aabb [ 1 ] ] ;
83- let max = [ this . aabb [ 2 ] , this . aabb [ 3 ] ] ;
84-
85- if ( ! Utils . pointInTile ( min ) || ! Utils . pointInTile ( max ) ) {
81+ if ( ( this . aabb [ 0 ] >= 0 && this . aabb [ 1 ] > - Geo . tile_scale && this . aabb [ 0 ] < Geo . tile_scale && this . aabb [ 1 ] <= 0 ) ||
82+ ( this . aabb [ 2 ] >= 0 && this . aabb [ 3 ] > - Geo . tile_scale && this . aabb [ 2 ] < Geo . tile_scale && this . aabb [ 3 ] <= 0 ) ) {
8683 return false ;
8784 }
88-
8985 return true ;
9086 }
9187
Original file line number Diff line number Diff line change 44import log from './log' ;
55import Thread from './thread' ;
66import WorkerBroker from './worker_broker' ;
7- import Geo from './geo' ;
87
98export default Utils ;
109
@@ -237,7 +236,3 @@ Utils.toCSSColor = function (color) {
237236 // RGB is between [0, 255] opacity is between [0, 1]
238237 return `rgba(${ color . map ( ( c , i ) => ( i < 3 && Math . round ( c * 255 ) ) || c ) . join ( ', ' ) } )` ;
239238} ;
240-
241- Utils . pointInTile = function ( point ) {
242- return point [ 0 ] >= 0 && point [ 1 ] > - Geo . tile_scale && point [ 0 ] < Geo . tile_scale && point [ 1 ] <= 0 ;
243- } ;
You can’t perform that action at this time.
0 commit comments