Closed CyBobber closed 6 months ago
Hi all, After looking a little deeper in the source code of pyqtlet2, I found out, that the variable PapWidgetIndex is set to 0.
Therefore here two working examples: self.map.runJavaScript('var markerIcon = L.icon({iconUrl: "http://localhost:8080/images/marker-icon-red.png"})', 0) self.map.runJavaScript("L.control.zoomBox(options={addToZoomControl: 'true', modal: 'false', title: 'Zoom'}).addTo(self.map)", 0)
Hope that helps one or the other.
I'm sorry, should be mapWidgetIndex.
Hi all, Since I upgraded my program from pyqtlet to pyqtlet2 I am getting a runJavaScript error like this:
TypeError: Evented.runJavaScript() missing 1 required positional argument: 'mapWidgetIndex'
As soon as I'm commenting the runJavaScript program lines, my program works fine. Could anyone please help to find out what I'm doing wrong. My QWidget class is embedded in a PyQt6 framework and is running without any others errors.
Here is my program:
import sys from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget from PyQt6.QtCore import from PyQt6.QtCore import Qt from .mapwidget import MapWidget from .leaflet import L from PyQt6 import QtCore, QtWidgets, QtWebEngineWidgets, QtWebChannel from PyQt6.QtWebEngineWidgets import from PyQt6.QtWebEngineWidgets import QWebEngineView from PyQt6.QtWebEngineCore import QWebEnginePage, QWebEngineProfile, QWebEngineScript, QWebEngineSettings
class gpsMap(QWidget):
Thank you yery much for your help and efforts in advance.