git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1253
7aebc617-e5e2-0310-91dc-
80fb5f6d2477
var layer_sledruns = new OpenLayers.Layer.Vector("Rodelbahnen", {
styleMap: new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
var layer_sledruns = new OpenLayers.Layer.Vector("Rodelbahnen", {
styleMap: new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
- externalGraphic: "/vorlagen/gmap_rodelbahn_c.png",
+ externalGraphic: "/vorlagen/bahnzustand${condition}_0.png",
graphicWidth: 17,
graphicHeight: 17,
graphicXOffset: -8,
graphicWidth: 17,
graphicHeight: 17,
graphicXOffset: -8,
layer_sledruns.addFeatures([new OpenLayers.Feature.Vector(point, {
label: jq_sledrun.attr('data-title'),
url: jq_sledrun.attr('data-url'),
layer_sledruns.addFeatures([new OpenLayers.Feature.Vector(point, {
label: jq_sledrun.attr('data-title'),
url: jq_sledrun.attr('data-url'),
- date_report: jq_sledrun.attr('data-date_report'),
- condition: jq_sledrun.attr('data-condition')
+ has_report: jq_sledrun.attr('data-date_report') !== undefined,
+ date_report: jq_sledrun.attr('data-date_report') === undefined ? null : jq_sledrun.attr('data-date_report'),
+ condition: jq_sledrun.attr('data-condition') === undefined ? '0' : jq_sledrun.attr('data-condition')
'<ul>\n' +
'<li><a href="' + feature.attributes['url'] + '">Details zur Rodelbahn</a></li>\n' +
'<li>Rodelbahnzustand<br/>';
'<ul>\n' +
'<li><a href="' + feature.attributes['url'] + '">Details zur Rodelbahn</a></li>\n' +
'<li>Rodelbahnzustand<br/>';
- if ('date_report' in feature.attributes && 'condition' in feature.attributes) {
+ if (feature.attributes['has_report']) {
var condition_text = {1: 'Sehr gut', 2: 'Gut', 3: 'Mittelmäßig', 4: 'Schlecht', 5: 'Geht nicht'};
var year_month_day = feature.attributes['date_report'].split('-');
popup_text += '<a href="' + feature.attributes['url'] + '#Eintr.C3.A4ge">' + condition_text[feature.attributes['condition']] + '</a> ' +
var condition_text = {1: 'Sehr gut', 2: 'Gut', 3: 'Mittelmäßig', 4: 'Schlecht', 5: 'Geht nicht'};
var year_month_day = feature.attributes['date_report'].split('-');
popup_text += '<a href="' + feature.attributes['url'] + '#Eintr.C3.A4ge">' + condition_text[feature.attributes['condition']] + '</a> ' +