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

Support multiple origins #171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maRci002
Copy link

@maRci002 maRci002 commented Feb 14, 2020

Some goeserver changes origin based on zoom level.

      <TileMatrix>
        <ows:Identifier>EOV_teszt:0</ows:Identifier>
        <ScaleDenominator>7314285.714285715</ScaleDenominator>
        <TopLeftCorner>420000.0 564288.0</TopLeftCorner> <---- **0. zoom layer** ---->
        <TileWidth>256</TileWidth>
        <TileHeight>256</TileHeight>
        <MatrixWidth>1</MatrixWidth>
        <MatrixHeight>1</MatrixHeight>
      </TileMatrix>
...
      <TileMatrix>
        <ows:Identifier>EOV_teszt:2</ows:Identifier>
        <ScaleDenominator>1828571.4285714286</ScaleDenominator>
        <TopLeftCorner>420000.0 433216.0</TopLeftCorner> <---- **2. zoom layer** ---->
        <TileWidth>256</TileWidth>
        <TileHeight>256</TileHeight>
        <MatrixWidth>4</MatrixWidth>
        <MatrixHeight>3</MatrixHeight>
      </TileMatrix>
...

This happens when we reuse same origin(420000.0 564288.0) at each zoom level:
origin: [ 420000.0, 564288.0 ]
origin_wrong

This happens when we apply to support multiple origins:

        origin: [ [ 420000.0, 564288.0 ], [ 420000.0, 564288.0 ],
				[ 420000.0, 433216.0 ], [ 420000.0, 433216.0 ],
				[ 420000.0, 400448.0 ], [ 420000.0, 384064.0 ],
				[ 420000.0, 375872.0 ], [ 420000.0, 375872.0 ],
				[ 420000.0, 375872.0 ], [ 420000.0, 375872.0 ],
				[ 420000.0, 375872.0 ], [ 420000.0, 375872.0 ],
				[ 420000.0, 375872.0 ] ]

origin_good


return new Bounds(min, max);
},

scale: function(zoom) {
var iZoom = Math.floor(zoom),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At start of scale / zoom function maybe we could write something like this to avoid Leaflet function overrides:
this.transformation = this._getTransformationByZoom(zoom);

@maRci002
Copy link
Author

The map bounces a bit but the marker stays at the right place.

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

Successfully merging this pull request may close these issues.

1 participant