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
Visualize geofences on front-end #2171
base: develop
Are you sure you want to change the base?
Visualize geofences on front-end #2171
Conversation
pogom/models.py
Outdated
Geofence.remove_duplicates(geofences) | ||
|
||
db_geofences = [] | ||
id = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id is not needed, isn't it?
|
||
@staticmethod | ||
def get_geofences(): | ||
query = Geofence.select().dicts() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Control the situation when there are no geofences.
I know that this should be called in that situation but you never know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is controlled by just returning an empty query which doesn't get looped due to for gf in query
and returns am empty array geofences
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SiteEffect Peewee raises an exception if there are not data, not an empty iterable, not sure why
Not sure if I would delete all and insert every fence on load instead of replacing, the difference in timing should be neglible and you avoid problems when changing the fence and leaving the same name. Also not sure if this handles properly fences without name (not sure if it is allowed by RM but think so). |
99f1eb9
to
073eb7b
Compare
Also it came to my mind recently that this does not handle different instances, not sure if we want to show all geofences from all instances in all maps, but if 2 instances have different fences with the same name, it will show the last one that was imported. |
@friscoMad intended behaviour. Either you use the same name for two geofences or the same geofence on two instances, which then should contain the same content as well or you should alter the name of one when two geofences contain different content. |
Is there a way to show geofences that are not active in Rocketmap? For example, I am not using geofences in Rocketmap but would love to be able to load (even via database manipulation) my PokeAlarm geofences so the users can see them. |
Can you fix the conflicts @IcognitoUnown 😉 |
Rebase?? |
PRing the visualization of the geofences after the initial functionality merge.
Description
This PR adds a DB table
geofence
to retrieve data inapp.py
for the front-end. No additional flags have to be set. When one regular geofence flag is set, this option becomes automatically available as switch button in the front-end.Make sure your geofences do not have duplicate names. The same geofence with the same name is fine, when used in multiple instances.
Motivation and Context
Geofences are a great tool for RocketMap to outline areas of interest or restricted ones. To make this transparent, we want to show it to the users as well as "debug" our geofences itself if they are drawn correctly.
How Has This Been Tested?
This was tested on my local machine.
Types of changes
Checklist: