-
Notifications
You must be signed in to change notification settings - Fork 171
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
[geo] JS logic crashes if geometry of a location is None #35
Comments
Start working on it |
Does that error occurred when EDIT: |
I'm not sure, have you found any interesting info about this problem? |
@nemesisdesign Not really, but @atb00ker found something openwisp/django-rest-framework-gis#168 (comment) |
Please, i wish to know if it is normal to create a location without a geometry. I thought every location should have a geometry. because it is the geometry which makes the location an actual location 🤔 |
@NoumbissiValere OpenWISP gives the possibility of flagging a location as "mobile", which means an object moves, think about a car, a bus, a train, a boat, a plane. In this case, the location can be created with an empty geometry. Alternatively, what we could do, which may simplify things (I only thought about this now) is to change the API which receives location data from devices to automatically create the location when the data is received, not sure if we already do that.. I'm checking, maybe I will send a PR for this myself |
I checked. Changing the model would require to change django-loci too, which is a bit tricky right now because django-loci has been migrated to channels 2, while openwisp-controller has not. Better continue with the initial idea, I think it's safer to assume a location can be created without a geometry set only when flagged as |
@nemesisdesign i found that this problem is caused by this function in
When location has right now am thinking two possibilities:
Please which of the above solutions is best to implement so that i can implement it and send a PR? or should i look for another better solution? Thanks |
@NoumbissiValere I'd fix django-loci. |
Ok @nemesisdesign let me move to another issue then 😄 |
@NoumbissiValere what about fixing it in django-loci? |
Yes @nemesisdesign that's the best option i see and wanted to fix it but you said you will fix na. |
I meant that I suggest to fix it in django-loci. I'm busy on other fronts right now. |
How to replicate: create a Location with no geometry set (don't place a point on the map).
Then create a device and select the location just created and check the javascript console.
The text was updated successfully, but these errors were encountered: