Interaction with third party JS (i.e. leafletjs)


#1

I am new to electron and have a problem how electron interact with java script libraries.

Let’s assume I want to extend electron’s hello world application with a leafletjs canvas. Concrete show a map in the index.html.

Leaflet say just add the following to index.html:

<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
[...]
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
[...]
 <div id="map"></div>

Finally set/activate the map via

var map = L.map('map').setView([51.505, -0.09], 13);

I don’t get it how this is called in electron. Furthermore, I want to change coordinates every second. What electron component implement the timer component and how to call the update procedure? I looked in the existing electron projects but I only found really trivial examples or b) to complex examples.


#2

Ok, I found a solution! If you are interested you can take a look at the following code:

https://github.com/hgn/tranetta

This is electron hello world with a integrated leaflet map.