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

Refactor label globals to generic more, some, none sdk options #236

Open
nvkelso opened this issue Jan 17, 2017 · 0 comments
Open

Refactor label globals to generic more, some, none sdk options #236

nvkelso opened this issue Jan 17, 2017 · 0 comments

Comments

@nvkelso
Copy link
Member

nvkelso commented Jan 17, 2017

Right now we have dozens of internal global properties that control label visibility:

  • #label visibility
    text_visible_continent: true
    text_visible_admin: true
    text_visible_populated_places: true
    icon_visible_populated_places: true
    text_visible_neighbourhoods: true
    text_visible_neighbourhoods_e: true
    text_visible_building: true
    text_visible_address: true
    text_visible_water_labels: true
    text_visible_island: true
    label_visible_landuse_green: true
    icon_visible_landuse_green: true # needs work
    text_visible_landuse_green: true
    icon_size_green: [[0, '0px']] # 0px for no, default, more [[13, 14px], [16, 18px], [18, 19px]]
    icon_size_green_l: [[0, '0px']] # 0px for no, default, more [[14,24px],[16,32px]]
    label_visible_poi_landuse: true
    icon_visible_poi_landuse: false # false for default
    text_visible_poi_landuse: false # false for default
    label_visible_poi_landuse_e: true
    icon_visible_poi_landuse_e: false # false for default
    text_visible_poi_landuse_e: true
    text_visible_landuse_generic: false # false for default
    label_visible_station: false # false for default
    icon_visible_station: false # false for default
    text_visible_station: false # false for default
    text_visible_highway: true
    text_visible_highway_e: false # false for default, false for more
    text_visible_trunk_primary: true
    text_visible_trunk_primary_route: true # true by default
    text_visible_trunk_primary_e2: false # false for default, false for more
    text_visible_trunk_primary_e: false # false for default, false for more
    text_visible_secondary: true
    text_visible_secondary_e: false # false for default, false for more
    text_visible_tertiary: true
    text_visible_tertiary_e: false # false for default, false for more
    text_visible_minor_road: true
    text_visible_minor_road_e: true
    text_visible_service_road: true
    text_visible_path: true
    text_visible_piste: true
    text_visible_steps: true
    text_visible_aerialway: true
    text_visible_airport_gate: true
    sdk_road_shields: true
    text_visible_exits: true
    text_visible_exits_e: false # false for default, false for more

We added some exposure for that in the HTML rig to toggle them more, (default), and no:

  • bubble-wrap/index.html

    Lines 403 to 500 in e6b962c

    // Labels selector
    var labels = {
    '(default)': 'more',
    'More': 'more',
    'Some': 'some',
    'Some (no shields)': 'some_no_shields',
    'None': 'none'
    };
    gui.labels = query.labels || 'more';
    gui.add(gui, 'labels', labels).onChange(function(value) {
    var _default = true;
    var _more = false;
    var _road_shields = true;
    if(value === 'more') {
    _more = true;
    _default = true;
    _road_shields = true;
    } else if(value === 'some') {
    _more = false;
    _default = true;
    _road_shields = true;
    } else if(value === 'some_no_shields') {
    _more = false;
    _default = true;
    _road_shields = false;
    } else {
    _more = false;
    _default = false;
    _road_shields = false;
    }
    scene.config.global.text_visible_continent = _default;
    scene.config.global.text_visible_admin = _default;
    scene.config.global.text_visible_populated_places = _default;
    scene.config.global.icon_visible_populated_places = _default;
    scene.config.global.text_visible_neighbourhoods = _default;
    scene.config.global.text_visible_neighbourhoods_e = _default;
    scene.config.global.text_visible_water = _default;
    scene.config.global.text_visible_water_labels = _default;
    scene.config.global.text_visible_island = _default;
    scene.config.global.sdk_road_shields = _road_shields;
    scene.config.global.text_visible_roads = _default;
    scene.config.global.text_visible_highway = _default;
    scene.config.global.text_visible_highway_e = _default;
    scene.config.global.text_visible_trunk_primary_route = _default;
    scene.config.global.text_visible_trunk_primary = _default;
    scene.config.global.text_visible_secondary = _default;
    scene.config.global.text_visible_tertiary = _default;
    scene.config.global.text_visible_minor_road = _default;
    scene.config.global.text_visible_minor_road_e = _default;
    scene.config.global.text_visible_service_road = _default;
    scene.config.global.text_visible_path = _default;
    scene.config.global.text_visible_piste = _default;
    scene.config.global.text_visible_steps = _default;
    scene.config.global.text_visible_highway_e = _default;
    scene.config.global.text_visible_trunk_primary_e2 = _default;
    scene.config.global.text_visible_trunk_primary_e = _default;
    scene.config.global.text_visible_secondary_e = _default;
    scene.config.global.text_visible_tertiary_e = _default;
    scene.config.global.text_visible_minor_road_e = _default;
    scene.config.global.text_visible_exits_e = _default;
    scene.config.global.text_visible_aerialway = _default;
    scene.config.global.text_visible_airport_gate = _default;
    scene.config.global.text_visible_exits = _default;
    scene.config.global.text_visible_building = _more;
    scene.config.global.text_visible_address = _more;
    scene.config.global.label_visible_poi_landuse = _more;
    scene.config.global.text_visible_poi_landuse = _more;
    scene.config.global.label_visible_poi_landuse_e = _more;
    scene.config.global.icon_visible_poi_landuse = _more;
    scene.config.global.icon_visible_poi_landuse_e = _more;
    scene.config.global.text_visible_poi_landuse_e = _more;
    scene.config.global.icon_visible_station = _more;
    scene.config.global.icon_visible_landuse_green = _default;
    scene.config.global.text_visible_landuse_green = _default;
    scene.config.global.text_visible_landuse_generic = _more;
    if( _more ) {
    scene.config.global.icon_size_green = [[13, '14px'], [16, '18px'], [18, '19px']];
    scene.config.global.icon_size_green_nationl_park = [[10,'18px'],[12,'28px'],[13,'36px']];
    scene.config.global.icon_size_green_airport = [[13,'12px'],[14,'12px'],[17,'18px'],[19,'36px']];
    scene.config.global.icon_size_green_l = [[14,'24px'],[16,'32px']];
    } else {
    scene.config.global.icon_size_green = [[0, '0px']];
    scene.config.global.icon_size_green_nationl_park = [[0, '0px']];
    scene.config.global.icon_size_green_airport = [[0, '0px']];
    scene.config.global.icon_size_green_l = [[0, '0px']];
    }
    scene.updateConfig();
    //window.location.search = 'language=' + value;
    });

Which formalizes the manual config changes we make during release process on the YAML for each of the "flat" YAML files (versus include and override).

It would be nice to allow SDK access to change the labels on a generic house style scene file instead of needing to load a complete new file. But we'll need to cleanup this logic and property names.

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

1 participant