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

Automatic map updation at user's brower #345

Open
ViditChitkara opened this issue Jul 14, 2019 · 10 comments
Open

Automatic map updation at user's brower #345

ViditChitkara opened this issue Jul 14, 2019 · 10 comments

Comments

@ViditChitkara
Copy link
Member

Connecting with publiclab/mapknitter#805. The basic setup of action cable is complete over here. Along with this, a json(currently empty for testing) is broadcasted to every browser on which editing is being taken place. This broadcasting will only happen when a single user edits an image on the map. The json will be of type:-

"id": 101,
    "parent_id": null,
    "image_content_type": "image/png",
    "image_file_name": "apply-form-image.png",
    "thumbnail": null,
    "image_file_size": 627035,
    "width": 1758,
    "height": 2877,
    "created_at": "2019-07-14T08:50:46.393Z",
    "updated_at": "2019-07-14T09:09:44.781Z",
    "map_id": 2,
    "nodes": [
      {
        "id": 105,
        "color": "black",
        "author": "vidit",
        "lat": "28.941683305",
        "lon": "78.7811565399",
        "way_id": 0,
        "order": 0,
        "created_at": "2019-07-14T09:09:44.711Z",
        "updated_at": "2019-07-14T09:09:44.711Z",
        "name": "",
        "description": "",
        "map_id": 0,
        "way_order": 0,
        "body": null
      },

However, we'll require that the map gets updated once this json is received by the client. We need to build a function which will take this json and update the map with the warpables and their respective nodes. Any ideas on this would be really appreciated.

@ViditChitkara
Copy link
Member Author

@jywarren @divyabaid16 @sashadev-sky any ideas?

@sashadev-sky
Copy link
Member

@ViditChitkara I would love to help out with this, sorry for the delayed reply. We should schedule a time to discuss so we can get on the same page quickly. Are you available Wednesday?

@themacboy
Copy link
Contributor

themacboy commented Jul 30, 2019

In my free time Im coding a sketch tool to draw car accidents. And I will need a way to save sketch configs and reload it for future modifications.

Then I have planed to build my own code, but Im not skilled to work as a profesdsional coder like you do.

Example:
sketch

@ViditChitkara
Copy link
Member Author

@sashadev-sky sure we may schedule a call on Wednesday. I think the updation part is working quite smoothly in publiclab/mapknitter#805 , however, we need to discuss how to proceed on it further.
Thanks for helping out on this!

@sashadev-sky
Copy link
Member

@ViditChitkara np! You're in india?

@sashadev-sky
Copy link
Member

@themacboy thats awesome. We save everything server side in a rails database in Mapknitter https://github.com/publiclab/mapknitter. You seem pretty skilled to me!

@ViditChitkara
Copy link
Member Author

ViditChitkara commented Jul 30, 2019

@ViditChitkara np! You're in india?

Yes

@sashadev-sky
Copy link
Member

@ViditChitkara maybe we can just resolve this here and we won't be that complicated.. so what I am wondering is all of this can be done in MK right? Why upstream it? We can make a new route in MK that makes an ajax call and updates the map?

@ViditChitkara
Copy link
Member Author

Sure, I think we did when images are being updated when the browser gets a broadcasted event (from actioncable) and currently not via an ajax request. Additionally we'll require that a similar sort of event is called when an image is added or deleted onto the map and maybe some type associated with each image like "added", "deleted" or "updated" so that while refreshing the map we get to know which images have to be deleted or added or simply updated.

@ViditChitkara
Copy link
Member Author

So, I think a more solid and generic implementation of the synchronizeData (in #805 pr you reviewed)method could be done. Does that make sense?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants