Skip to content

Commit 1f3be3c

Browse files
committed
[AUTO] Sync MapML Build
1 parent e8dad99 commit 1f3be3c

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

dist/mapml.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -521,11 +521,11 @@
521521
let zoom = mapml.getAttribute("zoom") || nativeZoom, title = mapml.querySelector("featurecaption");
522522
title = title ? title.innerHTML : "Feature";
523523

524-
let propertyContainer = document.createElement('div');
525-
propertyContainer.classList.add("mapml-popup-content");
526-
propertyContainer.insertAdjacentHTML('afterbegin', mapml.querySelector("properties").innerHTML);
527-
528-
options.properties = propertyContainer;
524+
if(mapml.querySelector("properties")) {
525+
options.properties = document.createElement('div');
526+
options.properties.classList.add("mapml-popup-content");
527+
options.properties.insertAdjacentHTML('afterbegin', mapml.querySelector("properties").innerHTML);
528+
}
529529

530530
let layer = this.geometryToLayer(mapml, options, nativeCS, +zoom, title);
531531
if (layer) {
@@ -4826,6 +4826,7 @@
48264826
L.setOptions(this, options);
48274827

48284828
this.group = this.options.group;
4829+
this.options.interactive = this.options.link || (this.options.properties && this.options.onEachFeature);
48294830

48304831
this._parts = [];
48314832
this._markup = markup;
@@ -5151,7 +5152,7 @@
51515152
//creates the main parts and sub parts paths
51525153
for (let p of layer._parts) {
51535154
if (p.rings){
5154-
this._createPath(p, layer.options.className, layer.featureAttributes['aria-label'], true, layer.featureAttributes);
5155+
this._createPath(p, layer.options.className, layer.featureAttributes['aria-label'], layer.options.interactive, layer.featureAttributes);
51555156
if(layer.outlinePath) p.path.style.stroke = "none";
51565157
}
51575158
if (p.subrings) {
@@ -5411,7 +5412,7 @@
54115412

54125413
L.LayerGroup.prototype.initialize.call(this, layers, options);
54135414

5414-
if(this.options.onEachFeature || this.options.link) {
5415+
if((this.options.onEachFeature && this.options.properties) || this.options.link) {
54155416
this.options.group.setAttribute('tabindex', '0');
54165417
L.DomUtil.addClass(this.options.group, "leaflet-interactive");
54175418
L.DomEvent.on(this.options.group, "keyup keydown mousedown", this._handleFocus, this);
@@ -5455,7 +5456,7 @@
54555456
* @param layer
54565457
*/
54575458
addLayer: function (layer) {
5458-
if(!layer.options.link && this.options.onEachFeature) {
5459+
if(!layer.options.link && layer.options.interactive) {
54595460
this.options.onEachFeature(this.options.properties, layer);
54605461
}
54615462
L.FeatureGroup.prototype.addLayer.call(this, layer);

0 commit comments

Comments
 (0)