Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问_initGridSystem是不是有问题? #24

Open
pengchen617 opened this issue Feb 15, 2020 · 0 comments
Open

请问_initGridSystem是不是有问题? #24

pengchen617 opened this issue Feb 15, 2020 · 0 comments

Comments

@pengchen617
Copy link

pengchen617 commented Feb 15, 2020

_class.prototype._initGridSystem = function _initGridSystem() {
var points = [];
var extent = void 0,
extent_1 = void 0,
c = void 0;

    this.layer.forEach(function (g) {
        if (!g.isVisible()) {
            return;
        }
        c = g._getPrjCoordinates();
        if (!extent) {
            extent = g._getPrjExtent();
            extent_1=g.getExtent();
        } else {
            //这里用投影的Extent做合并,并不是想要的结果,我理解extent是不是应该和extent_1是对应的extent 是投影坐标,extent_1是经纬度,但我这里测试了,并不对应
            extent = extent._combine(g._getPrjExtent());       
            extent_1=extent_1._combine(g.getExtent());        
        }
          
        points.push({
            x: c.x,
            y: c.y,
            id: g._getInternalId(),
            geometry: g
        });
    });
    this._markerExtent = extent;
    this._markerPoints = points;

}

在_combine方法中
this.projection.project({x:-13720.015920780175,y:6715329.280305414})={x:-1527305185.9768558,y:20037508.34278074}

this.projection.unproject({x:-1527305185.9768558,y:20037508.34278074})={x:-40.01592078017529,y:85.0511287798}

不是原来的坐标了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant