mirror of
https://github.com/openglobus/openglobus.git
synced 2025-12-08 19:25:27 +00:00
30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
"use strict";
|
|
|
|
import * as mercator from "../mercator";
|
|
import { Extent } from "../Extent";
|
|
import { Node } from "../quadTree/Node.js";
|
|
import * as quadTree from "../quadTree/quadTree.js";
|
|
import { Segment } from "../segment/Segment.js";
|
|
import { SegmentLonLat } from "../segment/SegmentLonLat.js";
|
|
import { QuadTreeStrategy } from "./QuadTreeStrategy.js";
|
|
|
|
export class EarthQuadTreeStrategy extends QuadTreeStrategy {
|
|
constructor(options = {}) {
|
|
super(options);
|
|
this.name = "earth";
|
|
}
|
|
|
|
init() {
|
|
this._quadTreeList = [
|
|
new Node(Segment, this.planet, quadTree.NW, null, 0, 0,
|
|
Extent.createFromArray([-20037508.34, -20037508.34, 20037508.34, 20037508.34])
|
|
),
|
|
new Node(SegmentLonLat, this.planet, quadTree.NW, null, 0, 0,
|
|
Extent.createFromArray([-180, mercator.MAX_LAT, 180, 90])
|
|
),
|
|
new Node(SegmentLonLat, this.planet, quadTree.NW, null, 0, 0,
|
|
Extent.createFromArray([-180, -90, 180, mercator.MIN_LAT])
|
|
)
|
|
];
|
|
}
|
|
} |