stickers: drawing arrow + text

This commit is contained in:
muerwre 2018-12-06 09:20:55 +07:00
parent f183c8593d
commit 9729a9e117
11 changed files with 120 additions and 25 deletions

View file

@ -14,3 +14,5 @@ const database = mongoose.connection;
database.on('error', (err) => { console.error(`Database Connection Error: ${err}`); process.exit(2); });
database.on('connected', () => { console.info('Succesfully connected to MongoDB Database'); });
console.log(`DB: mongodb://${USER}:${PASSWORD}@${HOSTNAME}:${PORT}/${DATABASE}`);

View file

@ -8,8 +8,8 @@ const RouteSchema = new Schema(
title: { type: String, default: '' },
// address: { type: String, required: true },
version: { type: Number, default: 2 },
route: { type: Array },
stickers: { type: Array },
route: { type: Array, default: [] },
stickers: { type: Array, default: [] },
owner: { type: Schema.Types.ObjectId, ref: 'User' },
logo: { type: String, default: 'DEFAULT' },
distance: { type: Number, default: 0 },

View file

@ -8,7 +8,7 @@ module.exports = async (req, res) => {
path: 'routes',
options: {
limit: 100,
sort: { updated: 1 },
sort: { updated_at: -1 },
}
});
const random_url = await generateRandomUrl();

View file

@ -9,7 +9,7 @@ module.exports.parseRoute = route => route.filter(el => (
));
module.exports.parseStickers = stickers => stickers.filter(el => (
Object.keys(el).length === 4
Object.keys(el).length === 5
&& el.latlng
&& Object.keys(el.latlng).length === 2
&& el.latlng.lat