var communes = []; communes[91] = { lon: 6.020860, lat: 50.044559, zoom: 4, layer: '00100' }; communes[11] = { lon: 5.800000, lat: 49.894001, zoom: 5, layer: '00311' }; communes[1] = { lon: 6.048730, lat: 50.065990, zoom: 5, layer: '00301' }; communes[12] = { lon: 5.950000, lat: 49.888000, zoom: 5, layer: '00312' }; communes[2] = { lon: 5.946230, lat: 50.001202, zoom: 6, layer: '00302' }; communes[13] = { lon: 5.853000, lat: 49.933998, zoom: 5, layer: '00313' }; communes[3] = { lon: 5.993300, lat: 49.982311, zoom: 5, layer: '00303' }; communes[14] = { lon: 5.865000, lat: 49.969002, zoom: 5, layer: '00314' }; communes[4] = { lon: 6.089900, lat: 49.995991, zoom: 5, layer: '00304' }; communes[15] = { lon: 5.927000, lat: 49.980999, zoom: 5, layer: '00315' }; communes[5] = { lon: 6.129690, lat: 49.952309, zoom: 5, layer: '00305' }; communes[92] = { lon: 5.880000, lat: 49.950001, zoom: 4, layer: '00201' }; communes[6] = { lon: 6.165080, lat: 49.908451, zoom: 5, layer: '00306' }; communes[7] = { lon: 5.998320, lat: 50.142971, zoom: 5, layer: '00307' }; communes[8] = { lon: 6.189600, lat: 49.938648, zoom: 6, layer: '00308' }; communes[9] = { lon: 6.061170, lat: 50.124981, zoom: 5, layer: '00309' }; communes[10] = { lon: 5.926570, lat: 50.056808, zoom: 5, layer: '00310' }; communes[90] = { lon: 6.027000, lat: 50.001450, zoom: 4, layer: '00200' }; var layerData = []; layerData[10101] = { type: 'point', projection: '4326', icon: '10101' }; layerData[10102] = { type: 'point', projection: '4326', icon: '10102' }; layerData[10103] = { type: 'point', projection: '4326', icon: '10102' }; layerData[10201] = { type: 'point', projection: '4326', icon: '10202' }; layerData[10202] = { type: 'point', projection: '4326', icon: '10202' }; layerData[10203] = { type: 'point', projection: '4326', icon: '10202' }; layerData[10301] = { type: 'point', projection: '4326', icon: '10301' }; layerData[10302] = { type: 'point', projection: '4326', icon: '10302' }; layerData[10303] = { type: 'point', projection: '4326', icon: '10302' }; layerData[10304] = { type: 'point', projection: '4326', icon: '10601' }; layerData[10401] = { type: 'point', projection: '4326', icon: '10401' }; layerData[10402] = { type: 'point', projection: '4326', icon: '10403' }; layerData[10403] = { type: 'point', projection: '4326', icon: '10404' }; layerData[10404] = { type: 'point', projection: '4326', icon: '10404' }; layerData[10501] = { type: 'point', projection: '4326', icon: '10501' }; layerData[10502] = { type: 'point', projection: '4326', icon: '10501' }; layerData[10503] = { type: 'point', projection: '4326', icon: '10503' }; layerData[10504] = { type: 'point', projection: '4326', icon: '10502' }; layerData[10701] = { type: 'point', projection: '4326', icon: '10701' }; layerData[10703] = { type: 'point', projection: '4326', icon: '10703' }; layerData[10704] = { type: 'point', projection: '4326', icon: '10704' }; layerData[10705] = { type: 'point', projection: '4326', icon: '10705' }; layerData[10706] = { type: 'point', projection: '4326', icon: '10706' }; layerData[10707] = { type: 'point', projection: '4326', icon: '10707' }; layerData[10708] = { type: 'point', projection: '4326', icon: '10708' }; layerData[10709] = { type: 'point', projection: '4326', icon: '10709' }; layerData[10710] = { type: 'point', projection: '4326', icon: '10710' }; layerData[20101] = { type: 'point', projection: '4326', icon: '20101' }; layerData[20102] = { type: 'point', projection: '4326', icon: '20102' }; layerData[20103] = { type: 'point', projection: '4326', icon: '20103' }; layerData[20201] = { type: 'area', projection: '2169', icon: '20201', styleMap: { 'default': new OpenLayers.Style( { 'fillColor': '#e29612', 'fillOpacity': 0.5, 'strokeColor': '#000', 'strokeWidth': 1.0, 'strokeOpacity': 0.8 } ), 'select': new OpenLayers.Style( { 'fillColor': '#e29612', 'fillOpacity': 0.3, 'strokeColor': '#000', 'strokeWidth': 1.0, 'strokeOpacity': 0.8 } ) }, legend: '' }; layerData[20202] = { type: 'area', projection: '2169', icon: '20201', styleMap: { 'default': new OpenLayers.Style( { 'fillColor': '#db81ab', 'fillOpacity': 0.5, 'strokeColor': '#000', 'strokeWidth': 1.0, 'strokeOpacity': 0.8 } ), 'select': new OpenLayers.Style( { 'fillColor': '#db81ab', 'fillOpacity': 0.3, 'strokeColor': '#000', 'strokeWidth': 1.0, 'strokeOpacity': 0.8 } ) }, legend: '' }; layerData[20203] = { type: 'area', projection: '2169', icon: '20201', styleMap: { 'default': new OpenLayers.Style( { 'fillColor': '#7f83e8', 'fillOpacity': 0.5, 'strokeColor': '#000', 'strokeWidth': 1.0, 'strokeOpacity': 0.8 } ), 'select': new OpenLayers.Style( { 'fillColor': '#7f83e8', 'fillOpacity': 0.3, 'strokeColor': '#000', 'strokeWidth': 1.0, 'strokeOpacity': 0.8 } ) }, legend: '' }; layerData[20204] = { type: 'area', projection: '2169', icon: '20201', styleMap: { }, legend: '' }; layerData[20205] = { type: 'area', projection: '2169', icon: '20201', styleMap: { }, legend: '' }; layerData[20301] = { type: 'point', projection: '4326', icon: '20301' }; layerData[30101] = { type: 'stats', projection: '4326', icon: '30101', styleMap: { 'default': new OpenLayers.Style( { 'fontColor': '#000000', 'fontOpacity': 0.7, 'fontFamily': 'arial, sans-serif', 'fontSize': '12px', 'fontWeight': 'bold', 'label': '${title_value}', 'fillColor': '${fill_color}', 'fillOpacity': 1.0, 'fontColor': '${font_color}', 'strokeColor': '${stroke_color}', 'strokeWidth': 1.0, 'strokeOpacity': 1.0 }, { context: { fill_color: function( feature ){ var population = feature.attributes.data; var fillColor; if( population <= 30 ) { fillColor = '#d3e5e9'; } else { if( population <= 35) { fillColor = '#b6ceda'; } else { if( population <= 40 ) { fillColor = '#97b4c6'; } else { if( population <= 50 ) { fillColor = '#7d9fb8'; } else { if( population <= 60 ) { fillColor = '#6289a8'; } else { if( population <= 100 ) { fillColor = '#49769d'; } else { fillColor = '#2e638b'; }; }; }; }; }; }; return fillColor }, stroke_color: function( feature ){ var population = feature.attributes.data; var strokeColor; if( population <= 30 ) { strokeColor = '#7d9fb8'; } else { if( population <= 35 ) { strokeColor = '#6289a8'; } else { if( population <= 40 ) { strokeColor = '#49769d'; } else { if( population <= 50 ) { strokeColor = '#2e638b'; } else { if( population <= 60 ) { strokeColor = '#b6ceda'; } else { if( population <= 100 ) { strokeColor = '#97b4c6'; } else { strokeColor = '#d3e5e9'; }; }; }; }; }; }; return strokeColor; }, font_color: function( feature ){ var population = feature.attributes.data; var fontColor; if( population <= 50 ) { fontColor = '#2e638b'; } else { fontColor = '#d3e5e9'; }; return fontColor; }, title_value: function( feature ){ if( map.getZoom() <= 3 ) { return ''; } else { return feature.attributes.title_de + "\n" + parseInt( feature.attributes.data ); }; } } } ) }, legend: '
< 30 Einw. / km2
31 - 35 Einw. / km2
36 - 40 Einw. / km2
41 - 50 Einw. / km2
51 - 60 Einw. / km2
61 - 100 Einw. / km2
> 100 Einw. / km2
' }; layerData[30102] = { type: 'stats', projection: '4326', icon: '30101', styleMap: { 'default': new OpenLayers.Style( { 'fontColor': '#000000', 'fontOpacity': 0.7, 'fontFamily': 'arial, sans-serif', 'fontSize': '12px', 'fontWeight': 'bold', 'label': '${title_value}', 'fillColor': '${fill_color}', 'fillOpacity': 1.0, 'fontColor': '${font_color}', 'strokeColor': '${stroke_color}', 'strokeWidth': 1.0, 'strokeOpacity': 1.0 }, { context: { fill_color: function( feature ){ var population = feature.attributes.data; var fillColor; if( population <= 5 ) { fillColor = '#d3e5e9'; } else { if( population <= 5.5) { fillColor = '#b6ceda'; } else { if( population <= 6 ) { fillColor = '#97b4c6'; } else { if( population <= 6.5 ) { fillColor = '#7d9fb8'; } else { if( population <= 7 ) { fillColor = '#6289a8'; } else { if( population <= 8 ) { fillColor = '#49769d'; } else { fillColor = '#2e638b'; }; }; }; }; }; }; return fillColor }, stroke_color: function( feature ){ var population = feature.attributes.data; var strokeColor; if( population <= 5 ) { strokeColor = '#7d9fb8'; } else { if( population <= 5.5 ) { strokeColor = '#6289a8'; } else { if( population <= 6 ) { strokeColor = '#49769d'; } else { if( population <= 6.5 ) { strokeColor = '#2e638b'; } else { if( population <= 7 ) { strokeColor = '#b6ceda'; } else { if( population <= 8 ) { strokeColor = '#97b4c6'; } else { strokeColor = '#d3e5e9'; }; }; }; }; }; }; return strokeColor; }, font_color: function( feature ){ var population = feature.attributes.data; var fontColor; if( population <= 6.5 ) { fontColor = '#2e638b'; } else { fontColor = '#d3e5e9'; }; return fontColor; }, title_value: function( feature ){ if( map.getZoom() <= 3 ) { return ''; } else { return feature.attributes.title_de + "\n" + feature.attributes.data.replace(".", ",") + "%"; }; } } } ) }, legend: '
< 5 %
5 - 5,5 %
5,5 - 6 %
6 - 6,5 %
6,5 - 7 %
7 - 8 %
> 8 %
' }; layerData[30103] = { type: 'stats', projection: '4326', icon: '30101', styleMap: { 'default': new OpenLayers.Style( { 'fontColor': '#000000', 'fontOpacity': 0.7, 'fontFamily': 'arial, sans-serif', 'fontSize': '12px', 'fontWeight': 'bold', 'label': '${title_value}', 'fillColor': '${fill_color}', 'fillOpacity': 1.0, 'fontColor': '${font_color}', 'strokeColor': '${stroke_color}', 'strokeWidth': 1.0, 'strokeOpacity': 1.0 }, { context: { fill_color: function( feature ){ var population = feature.attributes.data; var fillColor; if( population <= 1500 ) { fillColor = '#d3e5e9'; } else { if( population <= 2000 ) { fillColor = '#b6ceda'; } else { if( population <= 2500 ) { fillColor = '#97b4c6'; } else { if( population <= 3000 ) { fillColor = '#7d9fb8'; } else { if( population <= 3500 ) { fillColor = '#6289a8'; } else { if( population <= 4000 ) { fillColor = '#49769d'; } else { fillColor = '#2e638b'; }; }; }; }; }; }; return fillColor }, stroke_color: function( feature ){ var population = feature.attributes.data; var strokeColor; if( population <= 1500 ) { strokeColor = '#7d9fb8'; } else { if( population <= 2000 ) { strokeColor = '#6289a8'; } else { if( population <= 2500 ) { strokeColor = '#49769d'; } else { if( population <= 3000 ) { strokeColor = '#2e638b'; } else { if( population <= 3500 ) { strokeColor = '#b6ceda'; } else { if( population <= 4000 ) { strokeColor = '#97b4c6'; } else { strokeColor = '#d3e5e9'; }; }; }; }; }; }; return strokeColor; }, font_color: function( feature ){ var population = feature.attributes.data; var fontColor; if( population <= 3000 ) { fontColor = '#2e638b'; } else { fontColor = '#d3e5e9'; }; return fontColor; }, title_value: function( feature ){ if( map.getZoom() <= 3 ) { return ''; } else { return feature.attributes.title_de + "\n" + parseInt( feature.attributes.data ); }; } } } ) }, legend: '
< 1500
1501 - 2000
2001 - 2500
2501 - 3000
3001 - 3500
3501 - 4000
> 4000
' }; layerData[30201] = { type: 'point', projection: '4326', icon: '30201' }; layerData[30202] = { type: 'point', projection: '4326', icon: '30202' }; layerData[30203] = { type: 'point', projection: '4326', icon: '30201' }; layerData[30204] = { type: 'point', projection: '4326', icon: '30215' }; layerData[30205] = { type: 'point', projection: '4326', icon: '30205' }; layerData[30206] = { type: 'point', projection: '4326', icon: '30205' }; layerData[30207] = { type: 'point', projection: '4326', icon: '30210' }; layerData[30208] = { type: 'point', projection: '4326', icon: '30210' }; layerData[30209] = { type: 'point', projection: '4326', icon: '30206' }; layerData[30210] = { type: 'point', projection: '4326', icon: '30207' }; layerData[30211] = { type: 'point', projection: '4326', icon: '30207' }; layerData[30301] = { type: 'point', projection: '4326', icon: '30208' }; layerData[30302] = { type: 'point', projection: '4326', icon: '30206' }; layerData[30303] = { type: 'point', projection: '4326', icon: '30206' }; layerData[30304] = { type: 'point', projection: '4326', icon: '30201' }; layerData[30305] = { type: 'point', projection: '4326', icon: '30208' }; layerData[30401] = { type: 'point', projection: '4326', icon: '30213' }; layerData[30402] = { type: 'point', projection: '4326', icon: '30212' }; layerData[30403] = { type: 'point', projection: '4326', icon: '30403' }; layerData[30404] = { type: 'point', projection: '4326', icon: '30212' }; layerData[30405] = { type: 'point', projection: '4326', icon: '30404' }; layerData[30406] = { type: 'point', projection: '4326', icon: '30405' }; layerData[30407] = { type: 'point', projection: '4326', icon: '30214' }; layerData[30408] = { type: 'point', projection: '4326', icon: '30211' }; layerData[30409] = { type: 'point', projection: '4326', icon: '30406' }; layerData[30410] = { type: 'point', projection: '4326', icon: '30410' }; layerData[40101] = { type: 'point', projection: '4326', icon: '40101' }; layerData[40102] = { type: 'point', projection: '4326', icon: '40102' }; layerData[40103] = { type: 'point', projection: '4326', icon: '40103' }; layerData[40104] = { type: 'point', projection: '4326', icon: '40104' }; layerData[40201] = { type: 'point', projection: '4326', icon: '40201' }; layerData[40202] = { type: 'point', projection: '4326', icon: '40202' }; layerData[40203] = { type: 'point', projection: '4326', icon: '40203' }; layerData[40204] = { type: 'point', projection: '4326', icon: '40204' }; layerData[40301] = { type: 'point', projection: '4326', icon: '40301' }; layerData[40302] = { type: 'point', projection: '4326', icon: '40304' }; layerData[40303] = { type: 'point', projection: '4326', icon: '40303' }; layerData[40304] = { type: 'point', projection: '4326', icon: '40302' }; layerData[40305] = { type: 'point', projection: '4326', icon: '40305' }; layerData[40306] = { type: 'point', projection: '4326', icon: '40306' }; layerData[40401] = { type: 'tour', projection: '4326', icon: '40401' }; layerData[40402] = { type: 'tour', projection: '4326', icon: '40402' }; layerData[40403] = { type: 'point', projection: '4326', icon: '40403' }; layerData[40404] = { type: 'tour', projection: '4326', icon: '40404' }; layerData[40405] = { type: 'tour', projection: '4326', icon: '40405' }; layerData[40406] = { type: 'tour', projection: '4326', icon: '40406' }; layerData[40407] = { type: 'tour', projection: '4326', icon: '40401' }; layerData[40501] = { type: 'point', projection: '4326', icon: '40501' }; layerData[40502] = { type: 'point', projection: '4326', icon: '40502' }; layerData[40503] = { type: 'point', projection: '4326', icon: '40503' }; layerData[40601] = { type: 'point', projection: '4326', icon: '40601' }; layerData[40602] = { type: 'point', projection: '4326', icon: '40602' }; layerData[40603] = { type: 'point', projection: '4326', icon: '40603' }; layerData[40605] = { type: 'point', projection: '4326', icon: '40605' }; layerData[40606] = { type: 'point', projection: '4326', icon: '40609' }; layerData[40608] = { type: 'point', projection: '4326', icon: '40608' }; layerData[40609] = { type: 'point', projection: '4326', icon: '40606' }; layerData[40610] = { type: 'point', projection: '4326', icon: '40610' }; layerData[40611] = { type: 'point', projection: '4326', icon: '40611' }; layerData[40612] = { type: 'point', projection: '4326', icon: '40612' }; layerData[40613] = { type: 'point', projection: '4326', icon: '40613' }; layerData[40614] = { type: 'point', projection: '4326', icon: '40614' }; layerData[40615] = { type: 'point', projection: '4326', icon: '40615' }; layerData[40701] = { type: 'point', projection: '4326', icon: '40701' }; layerData[40702] = { type: 'point', projection: '4326', icon: '40702' }; layerData[40703] = { type: 'point', projection: '4326', icon: '40703' }; layerData[40704] = { type: 'point', projection: '4326', icon: '40704' }; layerData[50201] = { type: 'point', projection: '4326', icon: '50201' }; layerData[50202] = { type: 'point', projection: '4326', icon: '50202' }; layerData[50203] = { type: 'point', projection: '4326', icon: '50203' }; layerData[50204] = { type: 'point', projection: '4326', icon: '50204' }; layerData[50205] = { type: 'point', projection: '4326', icon: '50205' }; layerData[50206] = { type: 'point', projection: '4326', icon: '50206' }; layerData[50301] = { type: 'area', projection: '2169', icon: '50301', styleMap: { 'default': new OpenLayers.Style( { 'fillColor': '${fill_color}', 'fillOpacity': 0.5, 'strokeColor': '${stroke_color}', 'strokeWidth': 1.0, 'strokeOpacity': 0.8 }, { context: { fill_color: function( feature ){ var status = feature.attributes.attr_1; var fillColor; switch( status ) { case 'belegt': fillColor = '#e29612'; break; case 'in Planung': fillColor = '#e22d82'; break; case 'frei': fillColor = '#2d34e5'; break; }; return fillColor }, stroke_color: function( feature ){ var status = feature.attributes.attr_1; var strokeColor; switch( status ) { case 'belegt': strokeColor = '#000'; break; case 'in Planung': strokeColor = '#000'; break; case 'frei': strokeColor = '#000'; break; }; return strokeColor; } } } ), 'select': new OpenLayers.Style( { 'fillColor': '${fill_color}', 'fillOpacity': 0.3, 'strokeColor': '${stroke_color}', 'strokeWidth': 1.0, 'strokeOpacity': 0.8 }, { context: { fill_color: function( feature ){ var status = feature.attributes.attr_1; var fillColor; switch( status ) { case 'belegt': fillColor = '#ddb56e'; break; case 'in Planung': fillColor = '#db81ab'; break; case 'frei': fillColor = '#7f83e8'; break; }; return fillColor }, stroke_color: function( feature ){ var status = feature.attributes.attr_1; var strokeColor; switch( status ) { case 'belegt': strokeColor = '#000'; break; case 'in Planung': strokeColor = '#000'; break; case 'frei': strokeColor = '#000'; break; }; return strokeColor; } } } ) }, legend: '
frei
belegt
in Planung
' }; layerData[60001] = { type: 'point', projection: '4326', icon: '60001' }; layerData[60011] = { type: 'point', projection: '4326', icon: '00000' }; var dict = {}; dict.de = { summary: 'Steckbrief', profile: 'Höhenprofil', length: 'Länge', duration: 'Dauer', start: 'Startpunkt', difficulty: 'Schwierigkeitsgrad', meters_altitude: 'Höhenmeter', levels: [ '', 'leicht', 'mittel', 'schwer' ], searchResults: 'Suchergebnisse', noResults: 'keine Suchergebnisse gefunden', searchCat: 'Kategorie', selectLayer: 'Ebene auswählen', allLayers: 'alle Ebenen', noLayerSelected: 'keine Ebene angewählt', deleteLayer: 'löschen', moreResults: 'weitere Suchergebnisse anzeigen', resultsFound: 'Suchergebnisse gefunden', distance: 'Entfernung', for: 'für' }; dict.fr = { summary: 'Fiche signalétique', profile: 'Profil d\'altitude', length: 'Longeur', duration: 'Durée', start: 'Point de départ', difficulty: 'Degré de difficulté', meters_altitude: 'Mètres en altitude', levels: [ '', 'facile', 'moyen', 'difficile' ], searchResults: 'Résultats de la recherche', noResults: 'pas de résultats trouvés', searchCat: 'Catégorie', selectLayer: 'selectionner une couche', allLayers: 'toutes les couches', noLayerSelected: 'aucune couche sélectionnée', deleteLayer: 'supprimer', moreResults: 'afficher davantage de résultats', resultsFound: 'résultats trouvés', distance: 'Distance', for: 'pour' }; dict.en = { summary: 'Summary', profile: 'Height profile', length: 'Length', duration: 'Duration', start: 'Start point', difficulty: 'Level', meters_altitude: 'Altitude meters', levels: [ '', 'easy', 'medium', 'advanced' ], searchResults: 'Search results', noResults: 'keine Suchergebnisse gefunden', searchCat: 'Kategorie', selectLayer: 'select layer', allLayers: 'all layers', noLayerSelected: 'no layer selected', deleteLayer: 'delete', moreResults: 'more results', resultsFound: 'results found', distance: 'Distance' }; dict.nl = { summary: 'Kenmerken', profile: 'Hoogteprofiel', length: 'Lengte', duration: 'Duur', start: 'Vertrek', difficulty: 'Moeilijkheidsgraad', meters_altitude: 'Hoogteverschil', levels: [ '', 'gemakkelijk', 'middel', 'moeilijk' ], searchResults: 'Search results', noResults: 'keine Suchergebnisse gefunden', searchCat: 'Kategorie', selectLayer: 'select layer', allLayers: 'all layers', noLayerSelected: 'no layer selected', deleteLayer: 'delete', moreResults: 'more results', resultsFound: 'results found', distance: 'Distance' }; var styleMapRoutePois = new OpenLayers.StyleMap( { graphicWidth: 18, graphicHeight: 18, graphicXOffset: -9, graphicYOffset: -9 } ); var lookupPois = { 'A33': { externalGraphic: 'images/routefeatures/abstieg.png' }, 'A34': { externalGraphic: 'images/routefeatures/treppe.png' }, 'A36': { externalGraphic: 'images/routefeatures/attention.png' }, 'B11': { externalGraphic: 'images/routefeatures/station.png' }, // Infotafel 'B21': { externalGraphic: 'images/routefeatures/bank.png' }, 'B22': { externalGraphic: 'images/routefeatures/bank_tisch.png' }, 'B23': { externalGraphic: 'images/routefeatures/trash.png' }, 'B24': { externalGraphic: 'images/routefeatures/shelter.png' }, 'C12': { externalGraphic: 'images/routefeatures/sehenswuerdigkeit.png' }, 'C13': { externalGraphic: 'images/routefeatures/viewpoint.png' }, 'C21': { externalGraphic: 'images/routefeatures/restaurant.png' }, 'C22': { externalGraphic: 'images/routefeatures/restaurant.png' }, 'C24': { externalGraphic: 'images/routefeatures/camping.png' }, 'C31': { externalGraphic: 'images/routefeatures/bus.png' }, 'C32': { externalGraphic: 'images/routefeatures/train.png' }, 'C33': { externalGraphic: 'images/routefeatures/parking.png' }, 'C34': { externalGraphic: 'images/routefeatures/playground.png' }, 'C37': { externalGraphic: 'images/routefeatures/wc.png' }, 'C38': { externalGraphic: 'images/routefeatures/checkpoint.png' }, 'start': { externalGraphic: 'images/routefeatures/start.png' } }; styleMapRoutePois.addUniqueValueRules( "default", "symbol", lookupPois ); var styleMapCommunesSurface = new OpenLayers.StyleMap( { 'fillColor': '#db20b6', 'fillOpacity': 0.2, 'strokeColor': '#db20b6', 'strokeWidth': 0.0, 'strokeOpacity': 0.8 } ); var styleMapCommunesLine = new OpenLayers.StyleMap( { 'fillColor': '#db20b6', 'fillOpacity': 0.0, 'strokeColor': '#db20b6', 'strokeWidth': 2.0, 'strokeOpacity': 0.8 } ); var styleMapLocalities = new OpenLayers.StyleMap( { 'default': new OpenLayers.Style( { 'fontColor': '#ffffff', 'fontOpacity': 0.7, 'fontFamily': 'arial, sans-serif', 'fontSize': '${fontSize}', 'fontWeight': 'bold', 'label': '${name}', 'labelYOffset': '${labelYOffset}', // [px] 'pointRadius': '${pointRadius}', 'fillColor': '#ffffff', 'fillOpacity': '${opacity}', 'stroke': false }, { context: { name: function( feature ){ var name = feature.attributes.name; var level = feature.attributes.level; var zoom = map.getZoom(); if( zoom <= 11 ) { if( level == 1 ) { return name; } else { return ''; }; } else { if( zoom <= 13 ) { if( level <= 2 ) { return name; } else { return ''; }; } else { return name; }; }; }, opacity: function( feature ){ var opacity = 0.7; var level = feature.attributes.level; var zoom = map.getZoom(); if( zoom <= 11 ) { if( level == 1 ) { return opacity; } else { return 0.0; }; } else { if( zoom <= 13 ) { if( level <= 2 ) { return opacity; } else { return 0.0; }; } else { return opacity; }; }; }, fontSize: function( feature ){ var level = feature.attributes.level; if( level == 1 ) { return "18px"; } else { return "14px"; }; }, pointRadius: function( feature ){ var level = feature.attributes.level; if( level == 1 ) { return "8"; } else { return "5"; }; }, labelYOffset: function( feature ){ var level = feature.attributes.level; if( level == 1 ) { return 18; } else { return 14; }; } } } ) } );