Ero sivun ”Widget:Ol3AlgalWeekMap” versioiden välillä
Järvi-meriwikistä
p (Tekstin korvaus – ”<script src="//www.jarviwiki.fi/scripts/jwol3js/jwol3.js"></script>” muotoon ”<script src="//www.jarviwiki.fi/scripts/proj4js/dist/proj4.js"></script> <script src="//www.jarviwiki.fi/scripts/jwol3js/jwol3.js"></script>”) |
p (Tekstin korvaus – ”//cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL” muotoon ”https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js”) |
||
(9 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 1: | Rivi 1: | ||
<includeonly> | <includeonly> | ||
− | <link rel="stylesheet" href=" | + | <link rel="stylesheet" href="/scripts/ol3/ol.css" type="text/css"> |
− | <script src="// | + | <script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js"></script> |
− | <script src=" | + | <script src="/scripts/ol3/ol.js"></script> |
− | <link rel="stylesheet" href=" | + | <link rel="stylesheet" href="/scripts/ol-ext/dist/ol-ext.min.css" type="text/css"> |
− | <script src=" | + | <script src="/scripts/ol-ext/dist/ol-ext.min.js"></script> |
− | <link rel="stylesheet" href=" | + | <link rel="stylesheet" href="/scripts/ol-ext/overlay/popupoverlay.css" /> |
− | <link rel="stylesheet" href=" | + | <link rel="stylesheet" href="/scripts/ol-ext/overlay/popupoverlay.anim.css" /> |
− | <script src=" | + | <script src="/scripts/proj4js/dist/proj4.js"></script> |
− | <script src=" | + | <script src="/scripts/jwol3js/jwol3.js"></script> |
<div class="jwMapContainer" style="height:<!--{$height|default:500|escape:'html'}-->px" > | <div class="jwMapContainer" style="height:<!--{$height|default:500|escape:'html'}-->px" > | ||
Rivi 23: | Rivi 23: | ||
var <!--{$id|default:AlgalWeekMap|escape:'html'}-->_memo = { 'SitesO': {}, 'TypesO': {}, 'obsTypeToShow': '' }; | var <!--{$id|default:AlgalWeekMap|escape:'html'}-->_memo = { 'SitesO': {}, 'TypesO': {}, 'obsTypeToShow': '' }; | ||
− | + | function <!--{$id|default:AlgalWeekMap|escape:'html'}-->_jQueryTest() { | |
− | + | if ( typeof window.jQuery == 'undefined' ) { | |
+ | setTimeout( function(){ <!--{$id|default:AlgalWeekMap|escape:'html'}-->_jQueryTest() }, 300); | ||
+ | } else { | ||
+ | <!--{$id|default:AlgalWeekMap|escape:'html'}-->_func(); | ||
+ | } | ||
+ | } | ||
+ | setTimeout( function(){ <!--{$id|default:AlgalWeekMap|escape:'html'}-->_jQueryTest() }, 300); | ||
function <!--{$id|default:AlgalWeekMap|escape:'html'}-->_func() { | function <!--{$id|default:AlgalWeekMap|escape:'html'}-->_func() { | ||
Rivi 35: | Rivi 41: | ||
var zoom = parseInt('<!--{$zoom|default:4|escape:'html'}-->'); | var zoom = parseInt('<!--{$zoom|default:4|escape:'html'}-->'); | ||
var base = "<!--{$base|default:osm|escape:'html'}-->"; | var base = "<!--{$base|default:osm|escape:'html'}-->"; | ||
+ | var baselayers = "<!--{$baselayers|default:x|escape:'html'}-->"; | ||
+ | var baselayersA = baselayers.split( ',' ); | ||
var year = parseInt('<!--{$vuosi|default:4|escape:'html'}-->'); | var year = parseInt('<!--{$vuosi|default:4|escape:'html'}-->'); | ||
Rivi 46: | Rivi 54: | ||
memo.a = {}; | memo.a = {}; | ||
memo.b = {}; | memo.b = {}; | ||
+ | |||
+ | var showregions = false; | ||
+ | for ( var bl in baselayersA ) { | ||
+ | if ( baselayersA[ bl ] == 'regions' ) { showregions = true; } | ||
+ | } | ||
+ | |||
+ | if ( showregions ) { | ||
+ | layersArr.push( { | ||
+ | //'id': 'reagions', | ||
+ | 'type': 'anygeo', | ||
+ | 'name': 'Maakunnat', | ||
+ | 'restUrl': '//geo.stat.fi/geoserver/tilastointialueet/', | ||
+ | 'layer': 'tilastointialueet:maakunta1000k', | ||
+ | //'cql_filter': "tilastointialueet:nimi = '" + short + "'", | ||
+ | 'selectable': false, | ||
+ | //'zoomToExtent': true, | ||
+ | 'fillColor': 'transparent', | ||
+ | 'bbox': false, | ||
+ | //'attribution': '<a href="//wwwp2.ymparisto.fi/kayttoehdot.html">Ympäristöhallinnon paikkatietoaineistot</a>', | ||
+ | }); | ||
+ | } | ||
layersArr.push( { | layersArr.push( { | ||
Rivi 58: | Rivi 87: | ||
'pointRadius': 3, | 'pointRadius': 3, | ||
'label': '', | 'label': '', | ||
− | 'fillColor': '#ccc', | + | 'fillColor': '#ccc', |
− | 'strokeColor': '#ccc', | + | 'strokeColor': '#ccc', |
'zoomToExtent': false | 'zoomToExtent': false | ||
} ); | } ); | ||
Rivi 114: | Rivi 143: | ||
'zoomToExtent': false | 'zoomToExtent': false | ||
}); | }); | ||
− | + | ||
+ | /* | ||
+ | layersArr.push({ | ||
+ | 'type': 'sitesNobses', | ||
+ | 'name': 'Kansalaishavainnot pe-su', | ||
+ | 'siteSearch': '', | ||
+ | 'obsSearch': '[[Päivämäärä::>{{#time: Y-m-d|now - {{#expr: {{#time: w|now}} + 2 }} days }}]][[Päivämäärä::<{{#time: Y-m-d|now - {{#expr: {{#time: w|now}} + 0 }} days }}]][[ObsCode::alg]][[Seuranta::!Valtakunnallinen leväseuranta]]', | ||
+ | 'opacitySlider': false, | ||
+ | 'selectable': true, | ||
+ | 'clustered': false, | ||
+ | 'obstypebar': false, | ||
+ | 'zoomToExtent': false, | ||
+ | 'visible': true | ||
+ | }); | ||
+ | */ | ||
layersArr.push({ | layersArr.push({ | ||
'type': 'sitesNobses', | 'type': 'sitesNobses', | ||
− | 'name': 'Kansalaishavainnot', | + | 'name': 'Kansalaishavainnot kuluva viikko', |
'siteSearch': '', | 'siteSearch': '', | ||
'obsSearch': '[[Vuosi::' + year.toString() + ']][[Viikko::' + week.toString() + ']][[ObsCode::alg]][[Seuranta::!Valtakunnallinen leväseuranta]]', | 'obsSearch': '[[Vuosi::' + year.toString() + ']][[Viikko::' + week.toString() + ']][[ObsCode::alg]][[Seuranta::!Valtakunnallinen leväseuranta]]', |