Hi,
See issue #4859 for more details. this issue still exists in latest version, so I opened this one because that issue is closed.
<script src='https://api.mapbox.com/mapbox.js/v3.2.1/mapbox.js'></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.6.0/mapbox-gl.js'></script>
// then
mapboxgl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js');
Hey @dehghani-mehdi ,
We've added a getRTLTextPluginStatus (https://github.com/mapbox/mapbox-gl-js/blob/c82a0b8c89bb964824996e25f54c31cfaf419e61/src/index.js#L173), so you can query the state of the plugin and prevent calling the plugin twice in your app.
The plugin itself should not be downloaded multiple times since one global instance is used for all maps on the page.
I'm reopening the original issue #4859, since it describes the problem better.
Most helpful comment
Hey @dehghani-mehdi ,
We've added a
getRTLTextPluginStatus(https://github.com/mapbox/mapbox-gl-js/blob/c82a0b8c89bb964824996e25f54c31cfaf419e61/src/index.js#L173), so you can query the state of the plugin and prevent calling the plugin twice in your app.The plugin itself should not be downloaded multiple times since one global instance is used for all maps on the page.
I'm reopening the original issue #4859, since it describes the problem better.