+ // path layer
+ // ----------
+ var layer_path = new OpenLayers.Layer.Vector("Path", {
+ styleMap: new OpenLayers.StyleMap(new OpenLayers.Style({
+ strokeColor: '${getStrokeColor}',
+ strokeWidth: '${getStrokeWidth}'
+ }, {
+ context: {
+ getStrokeColor: function(feature) {
+ if (feature.attributes.strokeColor !== undefined) return feature.attributes.strokeColor;
+ if (feature.attributes.type == 'sledrun') return '#014e9a';
+ if (feature.attributes.type == 'walk') return '#e98401';
+ if (feature.attributes.type == 'alternative') return '#7f7fff';
+ if (feature.attributes.type == 'lift') return '#000000';
+ return '#ee9900';
+ },
+ getStrokeWidth: function(feature) {
+ if (feature.attributes.strokeWidth !== undefined) return feature.attributes.strokeWidth;
+ if (feature.attributes.type == 'lift') return 3;
+ return 6;
+ }
+ }
+ }))
+ });
+
+
+ // point layer
+ // -----------
+ var layer_point = new OpenLayers.Layer.Vector("Point", {
+ rendererOptions: {yOrdering: true}