решение задания 5 + 6
This commit is contained in:
@@ -4,6 +4,7 @@ import sys
|
||||
from PyQt5 import uic
|
||||
from PyQt5 import QtCore
|
||||
from functions.get_img_map import get_img_map
|
||||
from functions.search_organization_pos import search_organization_pos
|
||||
|
||||
|
||||
class Window(QMainWindow):
|
||||
@@ -17,12 +18,14 @@ class Window(QMainWindow):
|
||||
self.lon = 37.530887
|
||||
self.lat = 55.703118
|
||||
self.variant_map = "map"
|
||||
self.org_point = "0.0,0.0"
|
||||
self.update()
|
||||
self.button_group = QButtonGroup()
|
||||
self.button_group = QButtonGroup(None)
|
||||
self.button_group.addButton(self.map)
|
||||
self.button_group.addButton(self.sat)
|
||||
self.button_group.addButton(self.skl)
|
||||
self.button_group.buttonClicked.connect(self.push_button)
|
||||
self.find.clicked.connect(self.search_organization)
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
try:
|
||||
@@ -49,7 +52,7 @@ class Window(QMainWindow):
|
||||
print(e)
|
||||
|
||||
def update(self):
|
||||
get_img_map(self.delta, (self.lon, self.lat), self.variant_map)
|
||||
get_img_map(self.delta, (self.lon, self.lat), self.variant_map, self.org_point)
|
||||
self.pixmap = QPixmap('image.png')
|
||||
self.label.setPixmap(self.pixmap)
|
||||
self.label.resize(self.pixmap.width(), self.pixmap.height())
|
||||
@@ -62,6 +65,11 @@ class Window(QMainWindow):
|
||||
self.variant_map = button.text()
|
||||
self.update()
|
||||
|
||||
def search_organization(self):
|
||||
# Москва, ул. Ак. Королева, 12
|
||||
self.org_point, self.lon, self.lat = search_organization_pos(self.plainTextEdit.toPlainText())
|
||||
self.update()
|
||||
|
||||
|
||||
App = QApplication(sys.argv)
|
||||
window = Window()
|
||||
|
||||
Reference in New Issue
Block a user