From 9a6160bbc5c113139f9021757dae23bbc9507271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horv=C3=A1th=20L=C3=A1szl=C3=B3=20G=C3=A1bor?= Date: Wed, 10 Jan 2024 16:16:24 +0100 Subject: [PATCH] setRTLTextPlugin moved to the end of addMap function to stop blocking updates --- src/visual.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/visual.ts b/src/visual.ts index 954198bb..13f99157 100644 --- a/src/visual.ts +++ b/src/visual.ts @@ -235,6 +235,12 @@ export class MapboxMap implements IVisual { this.drawControl.updateDrawTools(this.settings.api.lasso, this.settings.api.polygon); this.drawControl.manageHandlers(this); this.handleContextMenu(); + + mapboxgl.setRTLTextPlugin( + 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js', + null, + true // Lazy load the plugin + ); } private removeMap() { @@ -440,12 +446,6 @@ export class MapboxMap implements IVisual { mapboxgl.accessToken = this.settings.api.accessToken; } - mapboxgl.setRTLTextPlugin( - 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js', - null, - true // Lazy load the plugin - ); - let style = this.settings.api.style == 'custom' ? this.settings.api.styleUrl : this.settings.api.style; if (this.mapStyle == '' || this.mapStyle != style) {