I’ve been working with Open Street Map (OSM) via Leaflet, one of its major API libraries. It’s been good experience with basic web page coding practices (HTML/CSS/JavaScript), and provides an alternate to Google maps (open source, no API keys).
I’d like to start accessing OSM/Leaflet APIs from Codeless/UI Builder. I believe the JavaScript can go into custom code blocks, but not sure how to connect them to Codeless and UI builder, which I assume replaces (Some of? All of?) the HTML and the CSS styling.
let point = [51.958, 9.14];
let mapOptions = {center: point, zoom: 10};
let map = new L.map('map', mapOptions);
let layer = new L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png');
map.addLayer(layer);
let marker = new L.Marker(point);
marker.addTo(map);
Is it possible to access OSM from Codeless? Is the ‘translation’ something a HTML/JavaScript newbie might attempt? This could be a useful custom component for OpenStreetMap, similar to the ‘Google Map’ component.
I believe the JavaScript can go into custom code blocks, but not sure how to connect them to Codeless and UI builder, which I assume replaces (Some of? All of?) the HTML and the CSS styling.
The Custom Code block is not suitable because it can only be used to write code in Codeless in JS only.
Did I download the correct version of this custom component? Do I need to do something else?
Yes. Try to open this custom component, make any change at index.js (for example add empty line) and click Save that will trigger a build and issue must gone.
This problem mustn’t happen when these components are installed from the marketplace(in a common way).
When you download it from GitHub - it’s like beta testing.