Exemplo n.º 1
0
def create_styles(path):
    styles = {}

    for subtype in node_subtypes:
        point_style = Style()
        point_style.labelstyle.color = Color.blue
        path_icon = join(path, 'static', 'images', 'default', subtype + '.gif')
        point_style.iconstyle.icon.href = path_icon
        styles[subtype] = point_style

    for subtype, cls in link_class.items():
        line_style = Style()
        # we convert the RGB color to a KML color,
        # i.e #RRGGBB to #AABBGGRR
        kml_color = "#ff" + cls.color[-2:] + cls.color[3:5] + cls.color[1:3]
        line_style.linestyle.color = kml_color
        styles[subtype] = line_style

    return styles
Exemplo n.º 2
0
                      __name__,
                      url_prefix='/views',
                      template_folder='templates',
                      static_folder='static')

styles = {}

for subtype in node_subtypes:
    point_style = Style()
    point_style.labelstyle.color = Color.blue
    path_icon = join(blueprint.root_path, 'static', 'images', 'default',
                     '{}.gif'.format(subtype))
    point_style.iconstyle.icon.href = path_icon
    styles[subtype] = point_style

for subtype, cls in link_class.items():
    line_style = Style()
    # we convert the RGB color to a KML color,
    # i.e #RRGGBB to #AABBGGRR
    kml_color = "#ff" + cls.color[-2:] + cls.color[3:5] + cls.color[1:3]
    line_style.linestyle.color = kml_color
    styles[subtype] = line_style


@blueprint.route('/<view_type>_view', methods=['GET', 'POST'])
@login_required
def view(view_type):
    view_options_form = ViewOptionsForm(request.form)
    google_earth_form = GoogleEarthForm(request.form)
    scheduling_form = SchedulingForm(request.form)
    scheduling_form.scripts.choices = Script.choices()