MapLibreJsSource class
Where the web implementation loads MapLibre GL JS from.
The library has to be on the page before the first map is built. By default
the plugin imports the exact build it is tested against, so web/index.html
needs no <script> or <link> tag. Apps with other constraints pick a
named constructor and assign it to MapLibreMap.webLibrarySource before the
first map is built.
Lives in the platform interface so apps can configure it without importing the web package. Ignored on Android and iOS, where the engine is linked into the app binary.
- Annotations
Constructors
- MapLibreJsSource.cdn({Duration timeout = _defaultTimeout})
-
The build this plugin is tested against, fetched from the unpkg CDN.
const
- MapLibreJsSource.preloaded({Duration timeout = _defaultTimeout})
-
The page loads MapLibre GL JS itself; the plugin loads nothing and only
waits for the
maplibreglglobal to appear.const - MapLibreJsSource.urls({required String scriptUrl, String? styleUrl, Duration timeout = _defaultTimeout})
-
A self-hosted copy of MapLibre GL JS, or files shipped as web assets.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- preloaded → bool
-
Whether the page loads the library itself (MapLibreJsSource.preloaded).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scriptUrl → String?
-
URL of the maplibre-gl-js ES module to import, or null when the plugin's
pinned build is used (MapLibreJsSource.cdn) or nothing is loaded at all
(MapLibreJsSource.preloaded).
final
- styleUrl → String?
-
URL of the
maplibre-gl.cssstylesheet to inject alongside scriptUrl.final - timeout → Duration
-
How long the web implementation waits for the library before failing.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- configured ↔ MapLibreJsSource?
-
The app's choice, assigned through
MapLibreMap.webLibrarySource.getter/setter pair