diff --git a/docs/examples/deckgl_layer/app_update_layer.py b/docs/examples/deckgl_layer/app_update_layer.py new file mode 100644 index 00000000..6acdad9d --- /dev/null +++ b/docs/examples/deckgl_layer/app_update_layer.py @@ -0,0 +1,77 @@ +# Shiny Express App + +import json + +from maplibre import Map, MapContext, MapOptions, render_maplibregl +from maplibre.basemaps import Carto +from maplibre.ui import use_deckgl +from shiny import reactive +from shiny.express import input, render, ui + +m = Map( + MapOptions( + style=Carto.POSITRON, + center=(-122.4, 37.74), + zoom=12, + hash=True, + pitch=40, + ) +) + +layer_id = "GridLayer" + +CELL_SIZES = [100, 200, 300] +DEFAULT_CELL_SIZE = CELL_SIZES[1] + + +def deck_grid_layer(cell_size: int = DEFAULT_CELL_SIZE): + return { + "@@type": layer_id, + "id": "GridLayer", + "data": "https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-bike-parking.json", + "extruded": True, + "getPosition": "@@=COORDINATES", + "getColorWeight": "@@=SPACES", + "getElevationWeight": "@@=SPACES", + "elevationScale": 4, + "cellSize": cell_size, + "pickable": True, + } + + +m.add_deck_layers([deck_grid_layer()], tooltip_template="Number of points: {{ count }}") + +# Shiny Express +use_deckgl() + +ui.input_select( + "cell_size", "Cell size", choices=CELL_SIZES, selected=DEFAULT_CELL_SIZE +) +ui.input_action_button("update_layer", "Update layer") + + +@render_maplibregl +def render_map(): + return m + + +@render.code +def picking_object(): + obj = input.render_map_layer_GridLayer() + print(obj) + # return json.dumps(obj, indent=2) if obj else "Pick a feature!" + # return f"{obj['count']}" if obj else "Pick a feature!" + return json.dumps(obj["points"], indent=2) if obj else "Pick a feature!" + + +@reactive.Effect +@reactive.event(input.update_layer) +async def update_layer(): + print(input.update_layer()) + async with MapContext("render_map") as m: + m.set_deck_layers([deck_grid_layer(input.cell_size())]) + + +if __name__ == "__main__": + with open("docs/examples/deckgl_layer/app.html", "w") as f: + f.write(m.to_html()) diff --git a/maplibre/map.py b/maplibre/map.py index b006dd07..75ff9dff 100644 --- a/maplibre/map.py +++ b/maplibre/map.py @@ -277,4 +277,8 @@ def to_html(self, title: str = "My Awesome Map", **kwargs) -> str: def add_deck_layers( self, layers: list[dict], tooltip_template: str | dict = None ) -> None: + """Add Deck.GL layers to the layer stack""" self.add_call("addDeckOverlay", layers, tooltip_template) + + def set_deck_layers(self, layers: list[dict]): + self.add_call("setDeckLayers", layers) diff --git a/maplibre/srcjs/index.js b/maplibre/srcjs/index.js index a4a8cda5..b93e2754 100644 --- a/maplibre/srcjs/index.js +++ b/maplibre/srcjs/index.js @@ -1,7 +1,7 @@ -(()=>{var $=Object.prototype.toString,C=Array.isArray||function(e){return $.call(e)==="[object Array]"};function R(r){return typeof r=="function"}function B(r){return C(r)?"array":typeof r}function P(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function j(r,e){return r!=null&&typeof r=="object"&&e in r}function A(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var J=RegExp.prototype.test;function F(r,e){return J.call(r,e)}var W=/\S/;function q(r){return!F(W,r)}var G={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function K(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return G[t]})}var V=/\s*/,z=/\s+/,D=/\s*=/,Q=/\s*\}/,X=/#|\^|\/|>|\{|&|=|!/;function Y(r,e){if(!r)return[];var t=!1,n=[],s=[],a=[],o=!1,u=!1,i="",l=0;function f(){if(o&&!u)for(;a.length;)delete s[a.pop()];else a=[];o=!1,u=!1}var v,m,N;function U(y){if(typeof y=="string"&&(y=y.split(z,2)),!C(y)||y.length!==2)throw new Error("Invalid tags: "+y);v=new RegExp(P(y[0])+"\\s*"),m=new RegExp("\\s*"+P(y[1])),N=new RegExp("\\s*"+P("}"+y[1]))}U(e||g.tags);for(var p=new T(r),w,d,h,_,L,b;!p.eos();){if(w=p.pos,h=p.scanUntil(v),h)for(var E=0,I=h.length;E"?L=[d,h,w,p.pos,i,l,t]:L=[d,h,w,p.pos],l++,s.push(L),d==="#"||d==="^")n.push(L);else if(d==="/"){if(b=n.pop(),!b)throw new Error('Unopened section "'+h+'" at '+w);if(b[1]!==h)throw new Error('Unclosed section "'+b[1]+'" at '+w)}else d==="name"||d==="{"||d==="&"?u=!0:d==="="&&U(h)}if(f(),b=n.pop(),b)throw new Error('Unclosed section "'+b[1]+'" at '+p.pos);return ee(Z(s))}function Z(r){for(var e=[],t,n,s=0,a=r.length;s0?n[n.length-1][4]:e;break;default:t.push(s)}return e}function T(r){this.string=r,this.tail=r,this.pos=0}T.prototype.eos=function(){return this.tail===""};T.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};T.prototype.scanUntil=function(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n};function k(r,e){this.view=r,this.cache={".":this.view},this.parent=e}k.prototype.push=function(e){return new k(e,this)};k.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var s=this,a,o,u,i=!1;s;){if(e.indexOf(".")>0)for(a=s.view,o=e.split("."),u=0;a!=null&&u"?l=this.renderPartial(u,t,n,a):i==="&"?l=this.unescapedValue(u,t):i==="name"?l=this.escapedValue(u,t,a):i==="text"&&(l=this.rawValue(u)),l!==void 0&&(o+=l);return o};c.prototype.renderSection=function(e,t,n,s,a){var o=this,u="",i=t.lookup(e[1]);function l(m){return o.render(m,t,n,a)}if(i){if(C(i))for(var f=0,v=i.length;f{var $=Object.prototype.toString,_=Array.isArray||function(e){return $.call(e)==="[object Array]"};function D(r){return typeof r=="function"}function B(r){return _(r)?"array":typeof r}function E(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function U(r,e){return r!=null&&typeof r=="object"&&e in r}function A(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var J=RegExp.prototype.test;function F(r,e){return J.call(r,e)}var W=/\S/;function q(r){return!F(W,r)}var G={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function K(r){return String(r).replace(/[&<>"'`=\/]/g,function(t){return G[t]})}var V=/\s*/,z=/\s+/,j=/\s*=/,Q=/\s*\}/,X=/#|\^|\/|>|\{|&|=|!/;function Y(r,e){if(!r)return[];var t=!1,n=[],s=[],a=[],o=!1,i=!1,c="",l=0;function f(){if(o&&!i)for(;a.length;)delete s[a.pop()];else a=[];o=!1,i=!1}var v,m,x;function N(y){if(typeof y=="string"&&(y=y.split(z,2)),!_(y)||y.length!==2)throw new Error("Invalid tags: "+y);v=new RegExp(E(y[0])+"\\s*"),m=new RegExp("\\s*"+E(y[1])),x=new RegExp("\\s*"+E("}"+y[1]))}N(e||g.tags);for(var u=new L(r),w,d,h,S,T,b;!u.eos();){if(w=u.pos,h=u.scanUntil(v),h)for(var P=0,I=h.length;P"?T=[d,h,w,u.pos,c,l,t]:T=[d,h,w,u.pos],l++,s.push(T),d==="#"||d==="^")n.push(T);else if(d==="/"){if(b=n.pop(),!b)throw new Error('Unopened section "'+h+'" at '+w);if(b[1]!==h)throw new Error('Unclosed section "'+b[1]+'" at '+w)}else d==="name"||d==="{"||d==="&"?i=!0:d==="="&&N(h)}if(f(),b=n.pop(),b)throw new Error('Unclosed section "'+b[1]+'" at '+u.pos);return ee(Z(s))}function Z(r){for(var e=[],t,n,s=0,a=r.length;s0?n[n.length-1][4]:e;break;default:t.push(s)}return e}function L(r){this.string=r,this.tail=r,this.pos=0}L.prototype.eos=function(){return this.tail===""};L.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};L.prototype.scanUntil=function(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n};function k(r,e){this.view=r,this.cache={".":this.view},this.parent=e}k.prototype.push=function(e){return new k(e,this)};k.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var s=this,a,o,i,c=!1;s;){if(e.indexOf(".")>0)for(a=s.view,o=e.split("."),i=0;a!=null&&i"?l=this.renderPartial(i,t,n,a):c==="&"?l=this.unescapedValue(i,t):c==="name"?l=this.escapedValue(i,t,a):c==="text"&&(l=this.rawValue(i)),l!==void 0&&(o+=l);return o};p.prototype.renderSection=function(e,t,n,s,a){var o=this,i="",c=t.lookup(e[1]);function l(m){return o.render(m,t,n,a)}if(c){if(_(c))for(var f=0,v=c.length;f0||!n)&&(a[o]=s+a[o]);return a.join(` -`)};c.prototype.renderPartial=function(e,t,n,s){if(n){var a=this.getConfigTags(s),o=R(n)?n(e[1]):n[e[1]];if(o!=null){var u=e[6],i=e[5],l=e[4],f=o;i==0&&l&&(f=this.indentPartial(o,l,u));var v=this.parse(f,a);return this.renderTokens(v,t,n,f,s)}}};c.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};c.prototype.escapedValue=function(e,t,n){var s=this.getConfigEscape(n)||g.escape,a=t.lookup(e[1]);if(a!=null)return typeof a=="number"&&s===g.escape?String(a):s(a)};c.prototype.rawValue=function(e){return e[1]};c.prototype.getConfigTags=function(e){return C(e)?e:e&&typeof e=="object"?e.tags:void 0};c.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!C(e))return e.escape};var g={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){O.templateCache=r},get templateCache(){return O.templateCache}},O=new c;g.clearCache=function(){return O.clearCache()};g.parse=function(e,t){return O.parse(e,t)};g.render=function(e,t,n,s){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+B(e)+'" was given as the first argument for mustache#render(template, view, partials)');return O.render(e,t,n,s)};g.escape=K;g.Scanner=T;g.Context=k;g.Writer=c;var M=g;function x(r,e,t){return t!==null?M.render(t,r.properties):e===null?Object.keys(r.properties).map(s=>`${s}: ${r.properties[s]}`).join("
"):r.properties[e]}function te(r,e,t){let n={background:"white",color:"black","border-radius":"5px"};return typeof r=="object"?r[t]&&{html:M.render(r[t],e),style:n}:{html:M.render(r,e),style:n}}function H(r){return({layer:e,object:t})=>t&&te(r,t,e.id)}function ne(){if(typeof deck>"u")return;let r=new deck.JSONConfiguration({classes:deck});return new deck.JSONConverter({configuration:r})}var S=class{constructor(e){this._id=e.container,this._map=new maplibregl.Map(e),this._map.on("mouseover",()=>{this._map.getCanvas().style.cursor="pointer"}),this._map.on("mouseout",()=>{this._map.getCanvas().style.cursor=""}),this._map.addControl(new maplibregl.NavigationControl),this._JSONConverter=ne()}getMap(){return this._map}applyMapMethod(e,t){this._map[e](...t)}addControl(e,t,n){this._map.addControl(new maplibregl[e](t),n)}addMarker({lngLat:e,popup:t,options:n}){let s=new maplibregl.Marker(n).setLngLat(e);if(t){let a=new maplibregl.Popup(t.options).setHTML(t.text);s.setPopup(a)}s.addTo(this._map)}addLayer(e,t){this._map.addLayer(e,t),typeof Shiny<"u"&&this._map.on("click",e.id,n=>{console.log(n,n.features[0]);let s=e.id.replaceAll("-","_"),a=`${this._id}_layer_${s}`,o={props:n.features[0].properties,layer_id:e.id};console.log(a,o),Shiny.onInputChange(a,o)})}addPopup(e,t=null,n=null){let s={closeButton:!1},a=new maplibregl.Popup(s);this._map.on("click",e,o=>{let u=o.features[0],i=x(u,t,n);a.setLngLat(o.lngLat).setHTML(i).addTo(this._map)})}addTooltip(e,t=null,n=null){let s={closeButton:!1,closeOnClick:!1},a=new maplibregl.Popup(s);this._map.on("mousemove",e,o=>{let u=o.features[0],i=x(u,t,n);a.setLngLat(o.lngLat).setHTML(i).addTo(this._map)}),this._map.on("mouseleave",e,()=>{a.remove()})}setSourceData(e,t){this._map.getSource(e).setData(t)}addDeckOverlay(e,t=null){if(typeof this._JSONConverter>"u"){console.log("deck or JSONConverter is undefined");return}let n=e.map(a=>this._JSONConverter.convert(Object.assign(a,{onHover:({layer:o,coordinate:u,object:i})=>{if(typeof Shiny<"u"){let l=`${this._id}_layer_${a.id}`;Shiny.onInputChange(l,i)}}}))),s=new deck.MapboxOverlay({interleaved:!0,layers:n,getTooltip:t?H(t):null});this._map.addControl(s)}render(e){e.forEach(([t,n])=>{if(["addLayer","addPopup","addTooltip","addMarker","addPopup","addControl","setSourceData","addDeckOverlay"].includes(t)){console.log("Custom method",t,n),this[t](...n);return}console.log("Map method",t),this.applyMapMethod(t,n)})}};var re="0.1.0";console.log("pymaplibregl",re);typeof Shiny>"u"&&(window.pymaplibregl=function({mapOptions:r,calls:e}){let t="pymaplibregl",n=document.getElementById(t),s=new S(Object.assign({container:n.id},r));s.getMap().on("load",()=>{s.render(e)})});if(typeof Shiny<"u"){class r extends Shiny.OutputBinding{find(t){return t.find(".shiny-maplibregl-output")}renderValue(t,n){console.log("id:",t.id,"payload:",n);let s=window._maplibreWidget=new S(Object.assign({container:t.id},n.mapData.mapOptions)),a=s.getMap();a.on("load",()=>{s.render(n.mapData.calls)}),a.on("click",u=>{console.log(u);let i=`${t.id}`,l={coords:u.lngLat,point:u.point};console.log(i,l),Shiny.onInputChange(i,l)});let o=`pymaplibregl-${t.id}`;console.log(o),Shiny.addCustomMessageHandler(o,({id:u,calls:i})=>{console.log(u,i),s.render(i)})}}Shiny.outputBindings.register(new r,"shiny-maplibregl-output")}})(); +`)};p.prototype.renderPartial=function(e,t,n,s){if(n){var a=this.getConfigTags(s),o=D(n)?n(e[1]):n[e[1]];if(o!=null){var i=e[6],c=e[5],l=e[4],f=o;c==0&&l&&(f=this.indentPartial(o,l,i));var v=this.parse(f,a);return this.renderTokens(v,t,n,f,s)}}};p.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n};p.prototype.escapedValue=function(e,t,n){var s=this.getConfigEscape(n)||g.escape,a=t.lookup(e[1]);if(a!=null)return typeof a=="number"&&s===g.escape?String(a):s(a)};p.prototype.rawValue=function(e){return e[1]};p.prototype.getConfigTags=function(e){return _(e)?e:e&&typeof e=="object"?e.tags:void 0};p.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!_(e))return e.escape};var g={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){O.templateCache=r},get templateCache(){return O.templateCache}},O=new p;g.clearCache=function(){return O.clearCache()};g.parse=function(e,t){return O.parse(e,t)};g.render=function(e,t,n,s){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+B(e)+'" was given as the first argument for mustache#render(template, view, partials)');return O.render(e,t,n,s)};g.escape=K;g.Scanner=L;g.Context=k;g.Writer=p;var M=g;function R(r,e,t){return t!==null?M.render(t,r.properties):e===null?Object.keys(r.properties).map(s=>`${s}: ${r.properties[s]}`).join("
"):r.properties[e]}function te(r,e,t){let n={background:"white",color:"black","border-radius":"5px"};return typeof r=="object"?r[t]&&{html:M.render(r[t],e),style:n}:{html:M.render(r,e),style:n}}function H(r){return({layer:e,object:t})=>t&&te(r,t,e.id)}function ne(){if(typeof deck>"u")return;let r=new deck.JSONConfiguration({classes:deck});return new deck.JSONConverter({configuration:r})}var C=class{constructor(e){this._id=e.container,this._map=new maplibregl.Map(e),this._map.on("mouseover",()=>{this._map.getCanvas().style.cursor="pointer"}),this._map.on("mouseout",()=>{this._map.getCanvas().style.cursor=""}),this._map.addControl(new maplibregl.NavigationControl),this._JSONConverter=ne()}getMap(){return this._map}applyMapMethod(e,t){this._map[e](...t)}addControl(e,t,n){this._map.addControl(new maplibregl[e](t),n)}addMarker({lngLat:e,popup:t,options:n}){let s=new maplibregl.Marker(n).setLngLat(e);if(t){let a=new maplibregl.Popup(t.options).setHTML(t.text);s.setPopup(a)}s.addTo(this._map)}addLayer(e,t){this._map.addLayer(e,t),typeof Shiny<"u"&&this._map.on("click",e.id,n=>{console.log(n,n.features[0]);let s=e.id.replaceAll("-","_"),a=`${this._id}_layer_${s}`,o={props:n.features[0].properties,layer_id:e.id};console.log(a,o),Shiny.onInputChange(a,o)})}addPopup(e,t=null,n=null){let s={closeButton:!1},a=new maplibregl.Popup(s);this._map.on("click",e,o=>{let i=o.features[0],c=R(i,t,n);a.setLngLat(o.lngLat).setHTML(c).addTo(this._map)})}addTooltip(e,t=null,n=null){let s={closeButton:!1,closeOnClick:!1},a=new maplibregl.Popup(s);this._map.on("mousemove",e,o=>{let i=o.features[0],c=R(i,t,n);a.setLngLat(o.lngLat).setHTML(c).addTo(this._map)}),this._map.on("mouseleave",e,()=>{a.remove()})}setSourceData(e,t){this._map.getSource(e).setData(t)}addDeckOverlay(e,t=null){if(typeof this._JSONConverter>"u"){console.log("deck or JSONConverter is undefined");return}let n=this._convertDeckLayers(e,t);this._deckOverlay=new deck.MapboxOverlay({interleaved:!0,layers:n,getTooltip:t?H(t):null}),this._map.addControl(this._deckOverlay)}_convertDeckLayers(e,t=null){return e.map(n=>this._JSONConverter.convert(Object.assign(n,{onHover:({layer:s,coordinate:a,object:o})=>{if(typeof Shiny<"u"){let i=`${this._id}_layer_${n.id}`;Shiny.onInputChange(i,o)}}})))}setDeckLayers(e){console.log("Updating Deck.GL layers");let t=this._convertDeckLayers(e);this._deckOverlay.setProps({layers:t})}render(e){e.forEach(([t,n])=>{if(["addLayer","addPopup","addTooltip","addMarker","addPopup","addControl","setSourceData","addDeckOverlay","setDeckLayers"].includes(t)){console.log("Custom method",t,n),this[t](...n);return}console.log("Map method",t),this.applyMapMethod(t,n)})}};var re="0.1.0";console.log("pymaplibregl",re);typeof Shiny>"u"&&(window.pymaplibregl=function({mapOptions:r,calls:e}){let t="pymaplibregl",n=document.getElementById(t),s=new C(Object.assign({container:n.id},r));s.getMap().on("load",()=>{s.render(e)})});if(typeof Shiny<"u"){class r extends Shiny.OutputBinding{find(t){return t.find(".shiny-maplibregl-output")}renderValue(t,n){console.log("id:",t.id,"payload:",n);let s=window._maplibreWidget=new C(Object.assign({container:t.id},n.mapData.mapOptions)),a=s.getMap();a.on("load",()=>{s.render(n.mapData.calls)}),a.on("click",i=>{console.log(i);let c=`${t.id}`,l={coords:i.lngLat,point:i.point};console.log(c,l),Shiny.onInputChange(c,l)});let o=`pymaplibregl-${t.id}`;console.log(o),Shiny.addCustomMessageHandler(o,({id:i,calls:c})=>{console.log(i,c),s.render(c)})}}Shiny.outputBindings.register(new r,"shiny-maplibregl-output")}})(); /*! Bundled license information: mustache/mustache.mjs: diff --git a/srcjs/pymaplibregl.js b/srcjs/pymaplibregl.js index cfbec66f..53449c54 100644 --- a/srcjs/pymaplibregl.js +++ b/srcjs/pymaplibregl.js @@ -108,7 +108,20 @@ export default class PyMapLibreGL { return; } - const layers = deckLayers.map((deckLayer) => + const layers = this._convertDeckLayers(deckLayers, tooltip_template); + // console.log("deckLayers", layers); + + // Use 'this._deckOverlay', so that we can update the overlay via 'setProps' + this._deckOverlay = new deck.MapboxOverlay({ + interleaved: true, + layers: layers, + getTooltip: tooltip_template ? getDeckTooltip(tooltip_template) : null, + }); + this._map.addControl(this._deckOverlay); + } + + _convertDeckLayers(deckLayers, tooltip_template = null) { + return deckLayers.map((deckLayer) => this._JSONConverter.convert( Object.assign(deckLayer, { /* Use tooltip from maplibre.gl @@ -129,15 +142,12 @@ export default class PyMapLibreGL { }), ), ); - // console.log("deckLayers", layers); + } - // Use 'this._deckOverlay', so that we can update the overlay via 'setProps' - const deckOverlay = new deck.MapboxOverlay({ - interleaved: true, - layers: layers, - getTooltip: tooltip_template ? getDeckTooltip(tooltip_template) : null, - }); - this._map.addControl(deckOverlay); + setDeckLayers(deckLayers) { + console.log("Updating Deck.GL layers"); + const layers = this._convertDeckLayers(deckLayers); + this._deckOverlay.setProps({ layers }); } render(calls) { @@ -153,6 +163,7 @@ export default class PyMapLibreGL { "addControl", "setSourceData", "addDeckOverlay", + "setDeckLayers", ].includes(name) ) { console.log("Custom method", name, params); diff --git a/srcjs/utils.js b/srcjs/utils.js index f3942fef..4557e130 100644 --- a/srcjs/utils.js +++ b/srcjs/utils.js @@ -51,7 +51,7 @@ function deckLayerOnHover(map, tooltip_template) { closeButton: false, }); map.on("mouseout", (e) => popup.remove()); - return ({ layer, coordinate, object }) => { + return ({ coordinate, object }) => { if (object) { console.log(tooltip_template); popup