Maps4HTML / Web-Map-Custom-Element

A custom <mapml-viewer> and <layer-> element suite
https://maps4html.org/Web-Map-Custom-Element/
Other
54 stars 15 forks source link

map-input is not respected for a map-extent and the tiles are still fetched at a lower zoom level #897

Open AliyanH opened 9 months ago

AliyanH commented 9 months ago

Discovered in #887 Steps to reproduce:

  1. visit the sandbox and paste in the following code
    <mapml-viewer projection="CBMTILE" zoom="8" lat="48.840422" lon="-101.219978" controls>
      <layer- label="CBMT" checked>
        <map-extent units="CBMTILE"  checked="checked" hidden="hidden">
          <map-input name="z" type="zoom" min="6" max="8"></map-input>
          <map-input name="y" type="location" units="tilematrix" axis="row"></map-input>
          <map-input name="x" type="location" units="tilematrix" axis="column"></map-input>
          <map-link rel="tile" tref="https://geoappext.nrcan.gc.ca/arcgis/rest/services/BaseMaps/CBMT3978/MapServer/tile/{z}/{y}/{x}?m4h=t" ></map-link>
        </map-extent>
      </layer->
    </mapml-viewer>
  2. Expected behavior - we think the layers should not be fetched outside of zoom level 6-8 (due to the map-input on the map-extent), but they still do when we zoom to the layer through the context menu

Related to #896

prushforth commented 9 months ago

I had the idea that we might implement "min/maxNativeZoom" by using the min/max attributes of <map-input type=zoom min=3 max=7> for example. Those min/max attributes are as close to the template that loads the tiles as we will get, and can be set up by the map author. The <map-meta name="zoom" content="min=7,max=12"></map-meta> values can control the display of the layer. To be discussed.

prushforth commented 9 months ago

Possibly related to #666