1
{{for layer in gpx_layers:}}
2
{{name = re.sub('\W', '_', layer)}}
3
iconURL = "{{=URL(r=request, c='default', f='download', args=gpx_layers[layer].marker)}}";
4
icon_img.src = iconURL;
5
width = icon_img.width;
6
height = icon_img.height;
8
height = ((max_w / width) * height);
12
width = ((max_h / height) * width);
15
style_marker.graphicWidth = width;
16
style_marker.graphicHeight = height;
17
style_marker.graphicXOffset = -(width / 2);
18
style_marker.graphicYOffset = -height;
19
style_marker.externalGraphic = iconURL;
20
var gpxLayer{{=name}} = new OpenLayers.Layer.GML( "{{=layer}}", "{{=URL(r=request, c='default', f='download', args=gpx_layers[layer].url)}}", {
21
format: OpenLayers.Format.GPX, style: style_marker, projection: proj4326});
22
{{if gpx_layers[layer].visibility:}}
23
gpxLayer{{=name}}.setVisibility(true);
25
gpxLayer{{=name}}.setVisibility(false);
27
map.addLayer(gpxLayer{{=name}});