You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the two points (start and end) are chosen and consequently the path between them, this path if these are not visible within the map component the line goes off the map component and into the rest of the screen. ex:
The map was created in the home.kv:
Map:
id: main_map
And the points and line are created in:
def points_line(self, *args):
if self.my_pin and self.dest_pin:
#print(self.my_pin.lat)
#print(self.my_pin.lon)
self.start_lon = self.my_pin.lon
self.start_lat = self.my_pin.lat
self.end_lon = self.dest_pin.lon
self.end_lat = self.dest_pin.lat
self.body = {"coordinates":[[self.start_lon, self.start_lat],[self.end_lon, self.end_lat]]}
self.res1 = self.openrouteservice_request(self.body)
for i in range(0, len(self.res1)-1, 2):
# print('lat= ' + self.res1[i])
# print('lon= ' + self.res1[i+1])
self.points_lat = self.res1[i]
self.points_lon = self.res1[i+1]
self.points_pop = MapMarkerPopup(lat=self.points_lat, lon=self.points_lon, source='assets/imgs/waypoints.png')
self.route_points.append(self.points_pop)
#print(type(self.points_pop))
self.ids.main_map.add_widget(self.points_pop)
with self.canvas:
Color(0.5, 0, 0 ,1)
for j in range(0, len(self.route_points)-1, 1):
self.lines = Line(points=(self.route_points[j].pos[0],self.route_points[j].pos[1], self.route_points[j+1].pos[0],self.route_points[j+1].pos[1] ), width=3)
self.list_of_lines.append(self.lines)
Clock.schedule_interval(self.update_route_lines, 1/50)
def update_route_lines(self, *args):
for j in range(1, len(self.route_points), 1):
self.list_of_lines[j-1].points = [self.route_points[j-1].pos[0],self.route_points[j-1].pos[1], self.route_points[j].pos[0], self.route_points[j].pos[1]]
The text was updated successfully, but these errors were encountered:
After the two points (start and end) are chosen and consequently the path between them, this path if these are not visible within the map component the line goes off the map component and into the rest of the screen. ex:
The map was created in the home.kv:
And the points and line are created in:
The text was updated successfully, but these errors were encountered: