|
94 | 94 | # - 5c90ffc: smooth color gradients for continuous colors (linear interpolation) |
95 | 95 | # - ab686b7: add collapsible layer groups to layer panel |
96 | 96 | # - ea497b4: move group border to bottom of group content |
97 | | -FUSEDMAPS_CDN_REF_DEFAULT = "ea497b4" |
| 97 | +FUSEDMAPS_CDN_REF_DEFAULT = "2f5aab9" |
98 | 98 | FUSEDMAPS_CDN_JS = f"https://cdn.jsdelivr.net/gh/milind-soni/fusedmaps@{FUSEDMAPS_CDN_REF_DEFAULT}/dist/fusedmaps.umd.js" |
99 | 99 | FUSEDMAPS_CDN_CSS = f"https://cdn.jsdelivr.net/gh/milind-soni/fusedmaps@{FUSEDMAPS_CDN_REF_DEFAULT}/dist/fusedmaps.css" |
100 | 100 | FUSEDMAPS_SCHEMA_URL = f"https://cdn.jsdelivr.net/gh/milind-soni/fusedmaps@{FUSEDMAPS_CDN_REF_DEFAULT}/fusedmaps.schema.json" |
@@ -137,9 +137,6 @@ def _fusedmaps_cdn_urls(ref: typing.Optional[str] = None) -> tuple[str, str, str |
137 | 137 | <div id="map"></div> |
138 | 138 | {custom_body} |
139 | 139 | <script> |
140 | | - // User-provided pre_init script (runs BEFORE FusedMaps init - good for BroadcastChannel listeners) |
141 | | - {pre_init} |
142 | | -
|
143 | 140 | // Initialize even if cartocolor fails to load (network/csp issues). |
144 | 141 | // If cartocolor loads later, palettes will start working for subsequent style updates. |
145 | 142 | function waitForCartocolor(callback, tries) {{ |
@@ -256,9 +253,7 @@ def deckgl_layers( |
256 | 253 | custom_head: str = "", # HTML to inject in <head> (scripts, stylesheets) |
257 | 254 | custom_css: str = "", # CSS rules to inject in <style> |
258 | 255 | custom_body: str = "", # HTML to inject in <body> (custom UI elements) |
259 | | - pre_init: str = "", # JavaScript to run BEFORE FusedMaps.init() - good for BroadcastChannel listeners |
260 | 256 | on_init: str = "", # JavaScript to run after FusedMaps.init() - has access to `map` and `instance` |
261 | | - return_raw_html: bool = False, # Return raw HTML string instead of html_to_obj (enables BroadcastChannel messaging) |
262 | 257 | ): |
263 | 258 | """ |
264 | 259 | Render mixed hex and vector layers on a single interactive map. |
@@ -287,12 +282,9 @@ def deckgl_layers( |
287 | 282 | custom_head: HTML to inject in <head> (e.g., external scripts, stylesheets). |
288 | 283 | custom_css: CSS rules to inject (without <style> tags). |
289 | 284 | custom_body: HTML to inject in <body> (e.g., custom UI containers). |
290 | | - pre_init: JavaScript code to run BEFORE FusedMaps.init(). Use this for: |
291 | | - - BroadcastChannel listeners (must be set up before async init) |
292 | | - - postMessage listeners for JSON UI integration |
293 | 285 | on_init: JavaScript code to run after FusedMaps.init(). Has access to: |
294 | | - - `__fm_instance`: The FusedMaps instance (with .getLayers, .updateLayer, etc.) |
295 | | - - `__fm_map`: The Mapbox GL map instance |
| 286 | + - `map`: The Mapbox GL map instance |
| 287 | + - `instance`: The FusedMaps instance (with .store, .addLayer, etc.) |
296 | 288 | - `config`: The FusedMaps config object |
297 | 289 | |
298 | 290 | Returns: |
@@ -635,12 +627,12 @@ def deckgl_layers( |
635 | 627 | custom_head=custom_head or "", |
636 | 628 | custom_css=custom_css or "", |
637 | 629 | custom_body=custom_body or "", |
638 | | - pre_init=pre_init or "", |
639 | 630 | on_init=on_init or "", |
640 | 631 | ) |
641 | 632 |
|
642 | | - # Return raw HTML string (enables BroadcastChannel messaging for JSON UI components) |
643 | | - return html |
| 633 | + # Return as HTML object |
| 634 | + common = fused.load("https://github.com/fusedio/udfs/tree/bb3aa1b/public/common/") |
| 635 | + return common.html_to_obj(html) |
644 | 636 |
|
645 | 637 |
|
646 | 638 | def deckgl_hex( |
|
0 commit comments