Map API, need suggestions for how to execute ideas
-
Hello! I figured I should make this a new post so more eyes can see it. I am attempting to modify the code of the default python 3 map API example from omz so that I can do the following:
I have a simple ui.load_view() I plan to make later which will ask the user if they want to mark their current location on the map. However I would need a button to be pressed for the user to get the view to work. Also, the user would need to be able to do so as many times as they like, so that multiple marks can appear on the map. The positions of the markers would need to be saved so that the next time the map is activated, the markers will reappear.
I understand this is likely a fair amount of code, but any help would be greatly appreciated. If you could suggest any ideas for me to test later I would be very thankful.
-
@RocketBlaster05 said:
The zoom should just be within maybe just a couple blocks, nothing too large. I want the user to be able to see a couple of nearby roads like if they were in a neighborhood.
GitHub updated
-
@cvp said:
This bug will be for tomorrow...
No worries. I'm sure it's pretty late near you now. I have a couple weeks to make sure everything is nice and smooth, so believe me there's no rush for anything here. I still can't say how much I appreciate what you're doing here... saving me so much time... thank you.
-
@RocketBlaster05 my pleasure
-
last edited by
-
@RocketBlaster05 I've to add that I don't like the look of the .loc file, I want to change it so it could contain all what we need but in a better way. I hope that I'll find the time to do it.
-
@cvp just a note: since the current location is replaced with a trash, It is causing there to be "too many values to unpack" on line 281. I assume this is due to the nature of the other pins.
I'll check in again tomorrow. Thanks.
Edit: In regards to the message below: Yes in your github script. It occurs after you mark the person's location as trash and then attempt to place a second red pin on the map.
-
last edited by
-
@cvp to clarify what I said above:
Here is the order that causes the issue:
- Place a red pin
- Mark user location as trash
- Attempt to place another red pin
-
@RocketBlaster05 thanks to identify "how to generate the bug", I'll check it tomorrow in my afternoon, not before, sorry
-
@cvp all good. see you tomorrow.
-
@RocketBlaster05 the problem occurs even if the pin to trash is a green, not only the user pin.
Red/trash/red
Identified, correction tomorrow
-
@RocketBlaster05 GitHub corrected for crash "red, set trash user or green, red"
-
@RocketBlaster05 Github corrected for bug "the trash pin on the face removes the face... Is it meant to do so?"
-
@cvp Code works great! For the time being I need to test the accuracy of the pins dropped on the person’s location, so I commented all of the long press function and just had it pass. No errors so that’s good.
Whenever you get the time, could you show me how to make it so that the map type button only allows you to use “hybrid” or “standard”? Thanks
-
@RocketBlaster05 GitHub updated, or
def maptype_button_action(self,sender): x = self.x + sender.x + sender.width/2 y = 70 + self.y + sender.y + sender.height sub_menu_dict = {'standard':0, 'hybrid':2} #sub_menu_dict = {'standard':0, 'satellite':1, 'hybrid':2, 'satelliteFlyover':3, 'hybridFlyover':4, 'mutedStandard':5} sub_menu = [] for k in [*sub_menu_dict]: sub_menu.append(k) tv = ui.TableView() tv.frame = (0,0,180,85) #tv.frame = (0,0,180,280)
-
@cvp hm.... got the new github code and it’s causing the iPad to crash... only happened after the map type change.
I've done some poking around... I have an old version of the map saved which runs with no issues. If I run the github version, it causes the iPad to crash. However, if I run the old version of the map first, then run the github version, the github version runs fine. This doesn't make any sense to me but I'm looking for any reason as to why this is happening.
-
@cvp Also, when the code is shortened to just 'standard':0 and 'hybrid':2, when the user selects hybrid it actually shows the 'satellite' view...
-
@RocketBlaster05 sorry for these bugs, GitHub corrected
-
@cvp works great!
-
@RocketBlaster05 😅 ready for next request....