mapbox-gl-inspect icon indicating copy to clipboard operation
mapbox-gl-inspect copied to clipboard

Plugin recognizes DOM node type only as 'undefined.'

Open DaveThePianoDude opened this issue 3 years ago • 0 comments

While using the plugin after adding it to a layer of point geometry type, we observed that the user would click on a point, but the hover would not appear. The plugin checks the type of the object it attempts to add to as a parent. If it's of type 'string', then it adds the hover as HTML. Otherwise as a DOM content (near line 216 of MaboxInspect.js).

Only after allowing for a type of 'undefined' could the popup actually be added to the data structure by invoking this._popup.setHTML(). So the new proposed code would be

if (type === 'string' || type === 'undefined') { this._popup.setHTML(this.options.renderPopup(features)); } else { this._popup.setDOMContent(this.options.renderPopup(features)); }

DaveThePianoDude avatar Sep 18 '20 23:09 DaveThePianoDude