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

Adding maps to db #32

Open
endalchemist opened this issue Mar 31, 2022 · 2 comments
Open

Adding maps to db #32

endalchemist opened this issue Mar 31, 2022 · 2 comments

Comments

@endalchemist
Copy link

Hey there, I recently got this project working for my own personal use following the steps listed in selfhost.md, but now I'm wondering how to upload maps permanently to the firestore db. Any help would be great, thank you.

@RuurdBijlsma
Copy link
Owner

RuurdBijlsma commented Mar 31, 2022

I stopped writing the self host documentation because adding maps was a pain :( for me it's been a long time so I don't remember, but you'll have to create a collection with the right name and the right fields, with a KML <polygon> string which determines where the map is. The required fields and names can be found in the source code

Some of the collection/table and field names are here: https://github.com/RuurdBijlsma/locationestimatr2/blob/master/firestore.rules

and here:
https://github.com/RuurdBijlsma/locationestimatr2/blob/master/src/store/index.js#L79

For example this 2nd file get a map with db.collection('maps').doc(mapId)
meaning there is a table/collection named 'maps' that you'll have to make

The fields used on this mapData that it returns should also be created, they are 'kml', 'user', 'realUser', 'image', 'maps', etc.

A lot of info on the maps db here also:
https://github.com/RuurdBijlsma/locationestimatr2/blob/0a69a10c34ea34318a93d20c100fd71473ef4851/src/assets/initialCache.json

that file looks like a json cache version of the db to me so probably very useful for reverse engineering the db tables/fields

sorry for not being able to help more, I don't have the original database anymore and I don't remember the structure

@endalchemist
Copy link
Author

Thanks for the reply. I was already doing some digging around in the source code, but I hadn't yet looked at the files you listed, also the initialCache file should be a big help.

In addition, I hadn't looked at the json files in the "data" folder which just look like direct dumps of the "maps" and "home-maps" collections. With the help of some json importing scripts from google, it should be easy to add those in.

If I get it working, I'll leave another reply here.

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

No branches or pull requests

2 participants