Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/map-feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ export class MapFeature extends HTMLElement {
if (!this.querySelector('map-geometry')) return;
let fallbackCS = this._getFallbackCS();
let content = parentLayer.src ? parentLayer.shadowRoot : parentLayer;
this._geometry = layerToAddTo.createGeometry(this, fallbackCS); // side effect: extends `this` with this._groupEl, points to svg g element that renders to map SD
this._geometry = layerToAddTo.createGeometry(this, fallbackCS); // side effect: extends `this` with this._groupEl if successful, points to svg g element that renders to map SD
if (!this._geometry) return;
layerToAddTo.addLayer(this._geometry);
this._setUpEvents();
}
Expand Down
2 changes: 1 addition & 1 deletion src/mapml/layers/FeatureLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export var FeatureLayer = L.FeatureGroup.extend({
options.zoomBounds = feature.extent.zoom;
}
let geometry = this._geometryToLayer(feature, options, cs, +zoom, title);
if (geometry) {
if (geometry && Object.keys(geometry._layers).length !== 0) {
// if the layer is being used as a query handler output, it will have
// a color option set. Otherwise, copy classes from the feature
if (!geometry.options.color && feature.hasAttribute('class')) {
Expand Down
12 changes: 6 additions & 6 deletions test/e2e/core/popupTabNavigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</head>

<body>
<mapml-viewer style="width: 500px;height: 500px;" is="web-map" projection="CBMTILE" zoom="2" lat="45.5052040"
<mapml-viewer data-testid="viewer" style="width: 500px;height: 500px;" is="web-map" projection="CBMTILE" zoom="2" lat="45.5052040"
lon="-75.2202344" controls>
<layer- id="query" label="Fire" checked>
<layer- data-testid="query" id="query" label="Fire" checked>
<map-extent units="CBMTILE" checked hidden>
<map-input name="z" type="zoom" value="18" min="0" max="18" ></map-input>
<map-input name="txmin" type="location" units="tilematrix" position="top-left" axis="easting" min="-2.003750834E7"
Expand Down Expand Up @@ -46,10 +46,10 @@
<map-meta name="zoom" content="min=1,max=5,value=0"></map-meta>
<map-meta name="cs" content="gcrs"></map-meta>
<map-meta name="extent" content="zoom=0,top-left-column=0,top-left-row=0,bottom-right-column=5,bottom-right-row=5"></map-meta>
<map-feature zoom="2" class="refDiff">
<map-feature data-testid="big-square" zoom="2" class="refDiff">
<map-properties>
<h1>Test</h1>
<a href="www.example.com">test</a>
<a data-testid="anchor" href="www.example.com">test</a>
</map-properties>
<map-geometry cs="tilematrix">
<map-polygon>
Expand All @@ -69,7 +69,7 @@ <h1>Test</h1>
</map-geometry>
</map-feature>

<map-feature zoom="2" class="refDiff">
<map-feature data-testid="small-trapezoid" zoom="2" class="refDiff">
<map-properties>
<h1>Test</h1>
</map-properties>
Expand All @@ -80,7 +80,7 @@ <h1>Test</h1>
</map-geometry>
</map-feature>
</layer->
<layer- id="vector" label="vector states" src="data/us_pop_density.mapml"></layer->
<layer- data-testid="vector" id="vector" label="vector states" src="data/us_pop_density.mapml"></layer->
</mapml-viewer>
</body>

Expand Down
Loading