kartena / Proj4Leaflet

Smooth Proj4js integration with Leaflet.
http://kartena.github.io/Proj4Leaflet/
BSD 2-Clause "Simplified" License
587 stars 172 forks source link

Support multiple origins #171

Open maRci002 opened 4 years ago

maRci002 commented 4 years ago

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

maRci002 commented 4 years ago

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