pyqt5 and 3D map HTML rendering -
i try display 3d map html pyqt5 version 5.8.2 in python on windows 7. use following code. can see 3d earth rendering incorrect (discontinuity - see picture attached). what's wrong code?
i have tried version 5.9 of pyqt5 have got error ([10552:11880:0820/203012.737:error:gl_context_wgl.cc(78)] not share gl contexts). suggestion why have got error?
from pyqt5.qtcore import * pyqt5.qtgui import * pyqt5.qtwebenginewidgets import * pyqt5.qtwidgets import qwidget,qvboxlayout, qapplication import bs4 maphtml = ''' <!doctype html> <html> <head> <script src="http://www.webglearth.com/v2/api.js"></script> <script> function initialize() { var earth = new we.map('earth_div'); we.tilelayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{ attribution: '© openstreetmap contributors' }).addto(earth); } </script> <style> html, body{padding: 0; margin: 0;} #earth_div{top: 0; right: 0; bottom: 0; left: 0; position: absolute !important;} </style> <title>webgl earth api: hello world</title> </head> <body onload="initialize()"> <div id="earth_div"></div> </body> </html> ''' class browser(qapplication): def __init__(self): qapplication.__init__(self, []) self.window = qwidget() self.web = qwebengineview(self.window) self.web.sethtml(maphtml) self.layout = qvboxlayout(self.window) self.layout.addwidget(self.web) self.window.show() self.exec_() browser()
Comments
Post a Comment