Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| (31 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
| Rivi 1: | Rivi 1: | ||
<includeonly> | <includeonly> | ||
<link rel="stylesheet" href="/scripts/ | <link rel="stylesheet" href="/scripts/ol-10/ol.css" type="text/css"> | ||
<script src="/scripts/ol-10/ol.js"></script> | |||
<link rel="stylesheet" href="/scripts/ol-ext/dist/ol-ext.min.css" type="text/css"> | <link rel="stylesheet" href="/scripts/ol-ext-10/dist/ol-ext.min.css" type="text/css"> | ||
<script src="/scripts/ol-ext/dist/ol-ext.min.js"></script | <script src="/scripts/ol-ext-10/dist/ol-ext.min.js"></script> | ||
<script src="/scripts/proj4js/dist/proj4.js"></script> | <script src="/scripts/proj4js/dist/proj4.js"></script> | ||
<script src="/scripts/ | <script src="/scripts/jwol10js/jwol10.js"></script> | ||
<div class="jwMapContainer" style="height:<!--{$height|default: | <div class="jwMapContainer" style="height:<!--{$height|default:500px|escape:'html'}-->" > | ||
<div style="height: 100%; width: 100%; position: relative;" id="<!--{$id|default:CommonObsMap|escape:'html'}-->_container"></div> | <div style="height: 100%; width: 100%; position: relative;" id="<!--{$id|default:CommonObsMap|escape:'html'}-->_container"></div> | ||
</div> | </div> | ||
| Rivi 46: | Rivi 43: | ||
if (siteQuery == 'x') { siteQuery = ''; } | if (siteQuery == 'x') { siteQuery = ''; } | ||
var days = parseInt('<!--{$days|default:365|escape:'html'}-->'); | var days = parseInt('<!--{$days|default:365|escape:'html'}-->'); | ||
var | var curdays = parseInt('<!--{$curdays|default:7|escape:'html'}-->'); | ||
var obstypebar = ("<!--{$obstypebar|default:yes|escape:'html'}-->" == "yes" ); | var pointsize = parseInt('<!--{$pointsize|default:6|escape:'html'}-->'); | ||
var obstypebar = ( "<!--{$obstypebar|default:yes|escape:'html'}-->" == "yes" ); | |||
var zoomto = ("<!--{$zoomto|default:false|escape:'html'}-->" == "true"); | var zoomto = ("<!--{$zoomto|default:false|escape:'html'}-->" == "true"); | ||
var simplepoints = ("<!--{$simplepoints|default:false|escape:'html'}-->" == "true"); | var simplepoints = ("<!--{$simplepoints|default:false|escape:'html'}-->" == "true"); | ||
| Rivi 53: | Rivi 51: | ||
var vesifi = ( "<!--{$vesifi|default:yes|escape:'html'}-->" == "yes" ); | var vesifi = ( "<!--{$vesifi|default:yes|escape:'html'}-->" == "yes" ); | ||
var mapbg = "<!--{$mapbg|default:x|escape:'html'}-->"; | var mapbg = "<!--{$mapbg|default:x|escape:'html'}-->"; | ||
var muni = "<!--{$muni|default:x|escape:'html'}-->"; | var muni = "<!--{$muni|default:x|escape:'html'}-->"; | ||
var regs = "<!--{$regs|default:x|escape:'html'}-->"; | |||
var lakes = "<!--{$lakes|default:x|escape:'html'}-->"; | |||
var muniA = muni.split( ',' ); | |||
for ( var mi in muniA ) { | |||
muniA[mi] = 'nationalCode=%27' + muniNameToNumber( muniA[mi].trim() ) + '%27'; | |||
} | |||
var regsA = []; if ( regs != 'x' ) { regsA = regs.split( ',' ); } | |||
for ( var ri in regsA ) { | |||
regsA[ri] = 'tilastointialueet:nimi=%27' + regsA[ri] + '%27'; | |||
} | |||
var lakesA = []; if ( lakes != 'x' ) { lakesA = lakes.split( ',' ); } | |||
for ( var li in lakesA ) { | |||
lakesA[li] = 'JarviTunnus=%27' + lakesA[li] + '%27'; | |||
} | |||
var layersArr = []; | var layersArr = []; | ||
if ( | if ( regsA.length > 0 ) { | ||
layersArr.push( { | |||
'id': 'region', | |||
'type': 'anygeo', | |||
'name': 'Maakunta', | |||
'restUrl': '//geo.stat.fi/geoserver/tilastointialueet/', | |||
'layer': 'tilastointialueet:maakunta1000k', | |||
'cql_filter': regsA.join( '%20OR%20' ), | |||
'selectable': false, | |||
'zoomToExtent': true, | |||
'bbox': false, | |||
'fillColor': 'rgba( 0, 0, 0, 0 )', | |||
'strokeColor': 'rgba( 200, 100, 100, 0.5 )', | |||
'strokeWidth': 5, | |||
'attribution': 'Maakuntarajat: Tilastokeskus', | |||
}); | |||
} | |||
if ( mapbg == 'muni' ) { | |||
layersArr.push( { | layersArr.push( { | ||
'id': 'muni', | 'id': 'muni', | ||
'type': ' | 'type': 'anygeo', | ||
'name': 'Kunta', | 'name': 'Kunta', | ||
'restUrl': '// | 'restUrl': '//inspire-wfs.maanmittauslaitos.fi/inspire-wfs/au', | ||
' | 'layer': 'au:AdministrativeUnit', | ||
'cql_filter': muniA.join( '%20OR%20' ), | |||
'selectable': false, | 'selectable': false, | ||
'zoomToExtent': true, | 'zoomToExtent': true, | ||
'bbox': false, | 'bbox': false, | ||
'fillColor': 'rgba( 0, 0, 0, 0 | 'fillColor': 'rgba( 0, 0, 0, 0 )', | ||
'strokeColor': 'rgba( | 'strokeColor': 'rgba( 200, 100, 100, 0.5 )', | ||
'strokeWidth': 5 | 'strokeWidth': 5 | ||
//'attribution': '<a href="//wwwp2.ymparisto.fi/kayttoehdot.html">Ympäristöhallinnon paikkatietoaineistot</a>', | //'attribution': '<a href="//wwwp2.ymparisto.fi/kayttoehdot.html">Ympäristöhallinnon paikkatietoaineistot</a>', | ||
}); | |||
} | |||
if ( lakesA.length > 0 ) { | |||
layersArr.push( { | |||
'type': 'lake', | |||
'name': 'Järvi', | |||
'search': lakesA.join( '%20OR%20' ), | |||
//'attribution': '<a href="//wwwp2.ymparisto.fi/kayttoehdot.html">Ympäristöhallinnon paikkatietoaineistot</a>', | |||
'visible': true, | |||
'opacitySlider': true, | |||
'showLabels': false, | |||
'selectable': true, | |||
'zoomToExtent': false | |||
}); | }); | ||
} | } | ||
| Rivi 81: | Rivi 127: | ||
'obsSearch': obsQuery, | 'obsSearch': obsQuery, | ||
'obsDays': days, | 'obsDays': days, | ||
'curDays': curdays, | |||
//'attribution': 'Paikat ja havainnot: Järvi-meriwiki', | //'attribution': 'Paikat ja havainnot: Järvi-meriwiki', | ||
'opacitySlider': false, | 'opacitySlider': false, | ||
| Rivi 86: | Rivi 133: | ||
'obstypebar': obstypebar, | 'obstypebar': obstypebar, | ||
'clustered': cluster, | 'clustered': cluster, | ||
' | 'pointSize': pointsize, | ||
'simplepoints': simplepoints, | 'simplepoints': simplepoints, | ||
'vesifi': vesifi, | 'vesifi': vesifi, | ||
| Rivi 92: | Rivi 139: | ||
}); | }); | ||
// do the base map with these settings | // do the base map with these settings | ||
var map = | var map = jwMakeMap({ | ||
'container': '<!--{$id|default:CommonObsMap|escape:'html'}-->_container', | 'container': '<!--{$id|default:CommonObsMap|escape:'html'}-->_container', | ||
'base': base, | 'base': base, | ||


