I am trying to use some functions of the leaflet.js library in my Python code. And to execute JS commands in code, I use PyV8. But I can not load the leaflet.js library into the PyV8 context. When i do this
ctxt.eval(open("leaflet.js").read())
I get an error message:
ReferenceError: window is not defined ( @ 9 : 68 ) -> of t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,doc
I even tried downloading the jquery library before I thought that leaflets depend on it. But then I get an error,
TypeError: Cannot read property 'defaultView' of undefined ( @ 2 : 68 ) -> :!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultVi
Can I load the JS library successfully?
source
share