Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Map API, need suggestions for how to execute ideas
-
@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....
-
@cvp won’t be anything for a couple days. Got some data to collect. Hope you find some other fun codes to do in the meantime! Thanks as always
-
@cvp sorry been busy so testing has been an issue. Finally got around to it. My iPad doesn’t have an automatic connection (needs WiFi) but it is still able to give locations on the map. I brought a WiFi hotspot with me and it didn’t seem to help. The locations are mostly accurate, but the updating is extremely inconsistent.
I had the update_interval set to values like 0.2, 0.5, 2, 5, and 10. None of them updated on their set intervals. Do you know if this is due to the lack of connection on my iPad or maybe something else is causing the error?
Thanks! -
@RocketBlaster05 don't forget that an iPad without cellular does not have any gps, thus the only location you can get is approximately this one of the router, based on known (by Apple) wifi networks. If you have an iPhone, try with it.
-
@cvp alright. I transferred my files to my iPhone and the tracking works much better. Not sure if this is because of the code or the map API but the app cannot track the person while moving at a speed beyond walking.
The Map only updated when coming to stops, and often times the map would not update after coming to a stop. I would have to reopen the map for it to begin trying to update again.
If you have any ideas I’ll be glad to hear them!Thanks as always!
-
@RocketBlaster05 no idea. Perhaps too much updates asked. Increase interval?
-
@cvp welp. Looks like I need some more improvements because the other information didn't count as data.
This might be the roughest task I've asked of you, but here it is:
I need to be able to triangulate the center of various pins. For example, if there is like 4 pins in a 10 meter area, I need to be able to drop a new pin in the center of all of those pins (to get a more centered marker). Of course, that new pin would need a new picture and its location would need to be saved... If you can use a custom image that would be great, as I've been looking through emoji's and none of them really are like a crosshair or a center "mark" if that makes sense. If a custom image is not possible, there is a recycle emoji that I would prefer as the next best choice.
I'm sorry for dumping all this on you but I have no clue how to do this... if you need any clarification just ask.
Thanks as always!
-
-
how do you choose the pin's group for which you need to compute the center?
-
Or do you want the center of all green pin's?
And if you add a supplementary green pin, do you want the center to move automatically ? -
what is customized image? A photo or something I would have to draw?
-
-
@RocketBlaster05 said:
I need to be able to triangulate the center of various pins.
I have found a fairly simple looking code to address this, which can be found here: https://www.101computing.net/cell-phone-trilateration-algorithm/
The issue I have now is implementing the stored coordinates into this algorithm. I basically want to make it so that if there are three pins specifically in a close location, then it would combine them into one point using the algorithm above.- Only three pins at once should be combined, and only those in a close proximity.
- New pins should not affect the location, as once the new center pin is made, I wish that the three trash pins are removed.
- Maybe not drawn, but just an image off the internet of like a crosshair or center mark.
-
@RocketBlaster05 sorry, I'm not sure to understand correctly.
Suppose we have 20 green pin's. Which pin's have to be, let us say, centered?
What is "close"? Which is the distance?The triangulation you gave does not work here, you don't have radious of antennas.
-
@cvp I'd prefer a distance of 10 meters
-
@RocketBlaster05 Thus, I begin with pin 1, if I find some pin's at less of 10 meters, I search their center and I replace them by a cross-hair, which I save in the file and I remove the original pin's.
Then, I continue with a pin which was at more than 10 meters... correct?