{"id":25077394,"url":"https://github.com/jaweilbaum/pyqtlet2","last_synced_at":"2025-04-15T02:52:17.569Z","repository":{"id":43349193,"uuid":"337849998","full_name":"JaWeilBaum/pyqtlet2","owner":"JaWeilBaum","description":"pyqtlet2 extends pyqtlet which initially brought Leaflet maps to PyQt5 and PySide6.","archived":false,"fork":false,"pushed_at":"2024-01-19T19:58:41.000Z","size":2571,"stargazers_count":41,"open_issues_count":16,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T02:52:11.427Z","etag":null,"topics":["map","pyqt5","pyqt5-map","python","python-maps"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaWeilBaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-10T20:49:10.000Z","updated_at":"2025-04-04T04:43:34.000Z","dependencies_parsed_at":"2024-06-21T04:29:32.676Z","dependency_job_id":null,"html_url":"https://github.com/JaWeilBaum/pyqtlet2","commit_stats":{"total_commits":118,"total_committers":12,"mean_commits":9.833333333333334,"dds":0.5593220338983051,"last_synced_commit":"0e9fdd819abd24dfecfd3449dbf5002e7b626410"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaWeilBaum%2Fpyqtlet2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaWeilBaum%2Fpyqtlet2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaWeilBaum%2Fpyqtlet2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaWeilBaum%2Fpyqtlet2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaWeilBaum","download_url":"https://codeload.github.com/JaWeilBaum/pyqtlet2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997087,"owners_count":21195797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["map","pyqt5","pyqt5-map","python","python-maps"],"created_at":"2025-02-07T02:24:58.502Z","updated_at":"2025-04-15T02:52:17.551Z","avatar_url":"https://github.com/JaWeilBaum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyqtlet2\n\npyqtlet is a Leaflet map wrapper for Qt bindings. In construction and design, it mimics the [official leaflet api](http://leafletjs.com/reference-1.3.0.html) as much as possible.\n\n## About\n\nThis is a fork of the repository pyqtlet from @skylarkdrones. Since the original repository is not further maintained. Since I find this package very useful for a map implementation in the QT environment, I want to further develop this package. If you want to extend this package feel free to get in contact with me or create an Issue/Pull Request with a change! \n\n## Installation\n\nYou as a user need to specify the Qt package you want to use. Please check [qtpy](https://github.com/spyder-ide/qtpy) to find out which Qt bindings can be used. \n\n\n\n``` bash\npip3 install \"pyqtlet2[PyQt5]\"\n# or\npip3 install \"pyqtlet2[PySide6]\"\n```\n\nIf you have multiple Qt bindings installed in your environment, please specify the necessary environment variable inside your code.\n\n``` python \nimport os\nos.environ['QT_API'] = 'pyqt5'\nfrom qtpy import QtGui\n```\n\nCheck if the installation was successful:\n\n``` bash\n# To test whether it is successfully working\npython3 \n\u003e\u003e\u003e from pyqtlet import L, MapWidget\n\u003e\u003e\u003e # No errors\n```\n\n## Usage\n\n``` python\nimport os\nimport sys\nos.environ['QT_API'] = 'pyqt5'\nfrom qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget\nfrom pyqtlet2 import L, MapWidget\n\n\nclass MapWindow(QWidget):\n    def __init__(self):\n        # Setting up the widgets and layout\n        super().__init__()\n        self.mapWidget = MapWidget()\n        self.layout = QVBoxLayout()\n        self.layout.addWidget(self.mapWidget)\n        self.setLayout(self.layout)\n\n        # Working with the maps with pyqtlet\n        self.map = L.map(self.mapWidget)\n        self.map.setView([12.97, 77.59], 10)\n        L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(self.map)\n        self.marker = L.marker([12.934056, 77.610029])\n        self.marker.bindPopup('Maps are a treasure.')\n        self.map.addLayer(self.marker)\n        self.show()\n\nif __name__ == '__main__':\n    app = QApplication(sys.argv)\n    widget = MapWindow()\n    sys.exit(app.exec_())\n```\n\n## Additional Leaflet Packages\n- Leaflet.draw (Version 0.4.14) - https://github.com/Leaflet/Leaflet.draw\n- Leaflet.RotatedMarker (Version 0.2.0) - https://github.com/bbecquet/Leaflet.RotatedMarker\n\n## Using Unimplemented Leaflet Features\nAt this time, there is none actively adding features to pyqtlet. This means that there\nare a lot of Leaflet features that are not implemented in pyqtlet. However, there is still\na way to access these features via the `runJavaScript` api. This allows arbitrary code to\nbe run within the map window.\n\nFor example, if we want to change the marker icon in the above example, add the following\n2 lines of code after the `self.map.addLayer(self.marker)` statement.\n\n``` python\n        # Create a icon called markerIcon in the js runtime.\n        self.map.runJavaScript('var markerIcon = L.icon({iconUrl: \"https://leafletjs.com/examples/custom-icons/leaf-red.png\"});')\n        # Edit the existing python object by accessing it's jsName property\n        self.map.runJavaScript(f'{self.marker.jsName}.setIcon(markerIcon);')\n```\n\nThis technique will allow users to use all the features available in leaflet.\n\n## Contributors\n\nA big thank you, goes to all the contributors of this project!\n\n\u003ca href=\"https://github.com/JaWeilBaum/pyqtlet2/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=JaWeilBaum/pyqtlet2\" /\u003e\n\u003c/a\u003e\n\n## Contributing\nIn terms of contributing, there is a lot of work that still needs to be done. \nSpecifically, there are a lot of leaflet features that need to be ported into pyqtlet. All contributions welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaweilbaum%2Fpyqtlet2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaweilbaum%2Fpyqtlet2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaweilbaum%2Fpyqtlet2/lists"}