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

Error in calculating extent of layer with no specified projection #899

Open
prushforth opened this issue Nov 3, 2023 · 4 comments
Open
Labels
Milestone

Comments

@prushforth
Copy link
Member

prushforth commented Nov 3, 2023

The extent of layers with no specified projection fails to take into account the projecton of the map viewer, resulting in incorrect extent/bounds calculations.

In the screen shot below, the extent/bounds are the tiny dot in tile col=2,row=3, and the place mark is supposed to be within that extent.

image

Steps to recreate

Use this map:

<mapml-viewer projection="CBMTILE" controls lat="0" lon="0" zoom="0" >
    <layer- src="test.mapml" checked></layer->
</mapml-viewer>

where test.mapml is the following:

<mapml- xmlns="http://www.w3.org/1999/xhtml">
  <map-head>
    <map-title>Extent bug</map-title>
    <map-meta charset="utf-8" ></map-meta>

    <map-meta name="extent" content="top-left-latitude=45.5, top-left-longitude=-75.8, bottom-right-latitude=45.3, bottom-right-longitude=-75.6"></map-meta> 
  </map-head>
  <map-body>
    <map-feature id="thing1">
      <map-featurecaption>a11y caption goes here</map-featurecaption>
        <map-geometry cs="gcrs">
          <map-point>
            <map-coordinates>-75.691084 45.4079051</map-coordinates>
          </map-point>
        </map-geometry>
        <map-properties>
          <h1>Feature properties html</h1>
        </map-properties>
    </map-feature>
  </map-body>
</mapml->

Here's a <map-feature> that has a geometry that matches the <map-meta name="extent" ...> above:

    <map-feature id="thing2">
      <map-featurecaption>extent as a feature</map-featurecaption>
        <map-geometry cs="gcrs">
          <map-polygon>
            <map-coordinates> -75.8 45.5 -75.6 45.5 -75.6 45.3 -75.8 45.3 -75.8 45.5</map-coordinates>
          </map-polygon>
        </map-geometry>
        <map-properties>
          <h1>Feature properties html</h1>
        </map-properties>
    </map-feature>
@AliyanH
Copy link
Member

AliyanH commented Nov 6, 2023

Implemented in #854

@prushforth
Copy link
Member Author

Implemented in #854

I think the bug is present in our map-extent branch though, so probably still a bug?

@yhy0217
Copy link
Contributor

yhy0217 commented Nov 8, 2023

Relates to #677

@prushforth
Copy link
Member Author

The symptoms of this problem are now different, but there's still a problem. If you zoom to the <layer- src="test.mapml"> above, you won't zoom into the small polygon that does surround the point, but to a much larger extent that doesn't seem related to the layer content:

image

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

No branches or pull requests

3 participants