Web-Map-Custom-Element icon indicating copy to clipboard operation
Web-Map-Custom-Element copied to clipboard

layercontrol duplication bug when projection attributeChangeCallback happens too quickly

Open AliyanH opened this issue 2 years ago • 0 comments

Steps to reproduce -

  • go to https://maps4html.org/web-map-doc/demo/sandbox/
  • and paste the following markup
  • Expected behavior - there should only be one layercontrol entry for map-extent not 2.
  • It appears the map-extent disconnectedcallback (this happens because the map changes projection to match the projection of one layer) happens before even the layercontrol is added.
<mapml-viewer projection="OSMTILE" zoom="14" lat="45.406314" lon="-75.6883335" controls controlslist="geolocation">
      <layer- data-testid="osm-layer" label="OpenStreetMap" checked >
        <map-extent units="CBMTILE" checked="checked">
          <map-input name="z" type="zoom" min="18" max="24"></map-input>
          <map-input name="xmin" type="location" units="pcrs" position="top-left" axis="easting" ></map-input>
          <map-input name="ymin" type="location" units="pcrs" position="bottom-left" axis="northing" ></map-input>
          <map-input name="xmax" type="location" units="pcrs" position="top-right" axis="easting" ></map-input>
          <map-input name="ymax" type="location" units="pcrs" position="top-left" axis="northing" ></map-input>
          <map-input name="w" type="width"></map-input>
          <map-input name="h" type="height"></map-input>
          <map-link rel="image" tref="https://geogratis.gc.ca/maps/CBMT?SERVICE=WMS&amp;VERSION=1.1.1&amp;SRS=EPSG:3978&amp;LAYERS=CBMT&amp;BBOX={xmin},{ymin},{xmax},{ymax}&amp;REQUEST=GetMap&amp;FORMAT=image/png&amp;TRANSPARENT=TRUE&amp;WIDTH={w}&amp;HEIGHT={h}&amp;STYLES=&amp;m4h=t"></map-link>
        </map-extent>
      </layer->
    </mapml-viewer>

AliyanH avatar Nov 21 '23 15:11 AliyanH