maptalks / maptalks/maptalks.markercluster

请问_initGridSystem是不是有问题?

Open
#24 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
49
Forks
19
PR merge metrics
No merged PRs in 30d

Description

_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}

不是原来的坐标了

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at _class.prototype._initGridSystem and trace _combine plus projection.project/unproject using the reported coordinates. Reproduce the mismatch and determine whether extent and extent_1 are combined in consistent coordinate systems. Done means the coordinate discrepancy is explained and the behavior is verified with a documented resolution or regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.