CitadelOnTheMove / agt

Citadel Application Generation Tool
Other
8 stars 5 forks source link

List of categories in Citadel apps #65

Open rozsch91 opened 9 years ago

rozsch91 commented 9 years ago

I can't figure out in which order the categories in Citadel applications list. It is not alphabetical. I have tried to reorder the dataset in numerous ways with little or no effect on the order of categories in the app. This causes issues when, for example, an app is made on schools as it makes more logical sense to list the categories of schools by age order (primary, secondary, college...) than a random order. Any ideas?

Facyla commented 9 years ago

I do not have the answer, but had the same issues with ordonate ranges for which i'd like to have gradient colors and this sort of thing, so i'll dive into this some day.

My idea would be to set the markers from a "marker" column, or from the category, if it exists, and rely on random marker only for undefined markers : this way we would simply have to add the properly-name marker into the images folder, and set the appropriate marker in the input data...

Facyla commented 9 years ago

Ok, the pin color + marker is determined by setting colors + markers using a list of 17 colors (from 0 to 16).

Related code is in https://github.com/CitadelOnTheMove/Citadel-Pois-Template/blob/3e4f01af0dd3b5a459d6f5dd328d334454a35ea3/js/pois-lib.js (search for "image/pin")

The filters (categories) are defined by checking the database (or in our case the data file), and builds them by checking each POI and adding the categories if not already set, so the order should be the one of the first appearance of the categories inside your data file... Related code is at https://github.com/CitadelOnTheMove/Citadel-Pois-Template/blob/a571d4bab2e9d78fbbeb14f54e99fffaa60ee427/php/filters.php

That's not a solution yet, but hope it helps getting to it :)

A quick and dirty hack without code change could be to set a single record (before the first POI) that does not display (no title or no coordinate should do the trick without breaking the app), but that contains all the dataset categories in the desired order - cannot guarantee sure it'll work, but you may want to check it. Or edit the file that produces the categories list, or/and the one that produces the markers. And also edit the markers to better fit in your app ;-)

rozsch91 commented 9 years ago

Thanks Facyla - I will look into this and let you know