Web-Map-Custom-Element
Web-Map-Custom-Element copied to clipboard
layercontrol duplication bug when projection attributeChangeCallback happens too quickly
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&VERSION=1.1.1&SRS=EPSG:3978&LAYERS=CBMT&BBOX={xmin},{ymin},{xmax},{ymax}&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=TRUE&WIDTH={w}&HEIGHT={h}&STYLES=&m4h=t"></map-link>
</map-extent>
</layer->
</mapml-viewer>