Hi,
Hopefully I’m missing something silly, but I can’t seem to find why I’m getting the following error:
The XML descriptor:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://jmix.io/schema/ui/window"
caption="msg://defaultMap.caption">
<layout>
<jsComponent id="map"
initFunctionName="com_company_mapbox_javascript_MapBox">
<dependencies>
<dependency path="vaadin://mapbox/mapbox-connector.js"/>
<dependency path="https://api.tiles.mapbox.com/mapbox-gl-js/v2.14.1/mapbox-gl.js"/>
<dependency path="https://api.tiles.mapbox.com/mapbox-gl-js/v2.14.1/mapbox-gl.css"/>
</dependencies>
</jsComponent>
</layout>
</window>
The JavaScript connector:
com_company_mapbox_javascript_MapBox = function () {
connector = this;
let element = connector.getElement();
let mapboxgl.accessToken = 'myAccessToken';
const map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/my-account/my-style',
center: [-87.661557, 41.893748],
zoom: 10.7
});
}
This is in testing an implementation of a MapBox API. I’m currently pretty awful at getting the jsComponent
to work in any capacity, but from the tutorial, it’s supposed to be pretty simple to add.
What am I doing wrong?
Thanks,
Adam