Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker outside the map #28

Open
gabboraron opened this issue Apr 15, 2020 · 0 comments
Open

Marker outside the map #28

gabboraron opened this issue Apr 15, 2020 · 0 comments

Comments

@gabboraron
Copy link

I want to place markers dynamically from a JSON file, but some of them appear outside the map as this screenshot shows: https://pasteboard.co/J3WZVcR.png

My code:

	def add_map_markers(self):
		for line in range(0,len(data['positions'])):	
			print(str(line)+" - ")
			for idx in range(0,len(data['positions'][line]['poslist'])):
				print("\tX:"+str(data['positions'][line]['poslist'][idx]['X']))
				print("\tY:"+str(data['positions'][line]['poslist'][idx]['Y']))
				
				marker = MapMarkerPopup(lat= data['positions'][line]['poslist'][idx]['X'], lon=data['positions'][line]['poslist'][idx]['Y'] )
				marker.add_widget(Button(text="Description: "+data['positions'][line]['description']))
				self.add_widget(marker)

with this JSON:

{
"last modification date": timestamp, 
"positions": [
	
		{"poslist": [{"X": 1, "Y": 2}], "photos": [], "description": "", "name": ""},
		{"poslist": [{"X": 3, "Y": 4}, {"X": 5, "Y": 6}], "photos": [], "description": "", "name": ""}
	
]}

How can I block this bad behaviour of the map?

@AndreMiras AndreMiras transferred this issue from kivy-garden/garden.mapview Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant