Ero sivun ”Widget:Ol3RBDMap” versioiden välillä
Järvi-meriwikistä
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”) |
|||
(12 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> |
− | <script src=" | + | <script src="/scripts/proj4js/dist/proj4.js"></script> |
− | <script src=" | + | <script src="/scripts/jwol3js/jwol3.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" /> |
<div class="jwMapContainer" style="height:<!--{$height|default:500|escape:'html'}-->px" > | <div class="jwMapContainer" style="height:<!--{$height|default:500|escape:'html'}-->px" > | ||
Rivi 21: | Rivi 21: | ||
var <!--{$id|default:CommonObsMap|escape:'html'}-->_memo = { 'SitesO': {}, 'TypesO': {}, 'obsTypeToShow': '' }; | var <!--{$id|default:CommonObsMap|escape:'html'}-->_memo = { 'SitesO': {}, 'TypesO': {}, 'obsTypeToShow': '' }; | ||
− | + | function <!--{$id|default:CommonObsMap|escape:'html'}-->_jQueryTest() { | |
+ | if ( typeof window.jQuery == 'undefined' ) { | ||
+ | setTimeout( function(){ <!--{$id|default:CommonObsMap|escape:'html'}-->_jQueryTest() }, 300); | ||
+ | } else { | ||
+ | <!--{$id|default:CommonObsMap|escape:'html'}-->_func(); | ||
+ | } | ||
+ | } | ||
+ | setTimeout( function(){ <!--{$id|default:CommonObsMap|escape:'html'}-->_jQueryTest() }, 300); | ||
function <!--{$id|default:CommonObsMap|escape:'html'}-->_func() { | function <!--{$id|default:CommonObsMap|escape:'html'}-->_func() { | ||
Rivi 33: | Rivi 40: | ||
var zoom = parseInt('<!--{$zoom|default:4|escape:'html'}-->'); | var zoom = parseInt('<!--{$zoom|default:4|escape:'html'}-->'); | ||
var vha = '<!--{$vha|escape:'html'}-->'; | var vha = '<!--{$vha|escape:'html'}-->'; | ||
− | var short = vha. | + | var short = vha.replace( 'kansainvälinen vesienhoitoalue', 'kansainvälisen vesienhoitoalueen Suomen osuus' ).replace( 'Tornionjoen', 'Torniojoen' ); |
+ | |||
var base = '<!--{$base|default:mmlTausta|escape:'html'}-->'; | var base = '<!--{$base|default:mmlTausta|escape:'html'}-->'; | ||
Rivi 51: | Rivi 59: | ||
var basinSearch = basinArr.join(' OR '); | var basinSearch = basinArr.join(' OR '); | ||
− | + | console.log( short ); | |
− | |||
layersArr.push( { | layersArr.push( { | ||
'id': 'vha', | 'id': 'vha', | ||
− | 'type': ' | + | 'type': 'anygeo', |
'name': 'Vesienhoitoalue', | 'name': 'Vesienhoitoalue', | ||
− | 'restUrl': '// | + | 'restUrl': '//paikkatiedot.ymparisto.fi/geoserver/inspire_am1/wfs', |
− | ' | + | 'layer': 'inspire_am1:AM.RiverBasinDistrict', |
+ | 'cql_filter': "inspire_am1:nimi = '" + short + "'", | ||
'selectable': false, | 'selectable': false, | ||
'zoomToExtent': true, | 'zoomToExtent': true, | ||
Rivi 81: | Rivi 89: | ||
'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>', | ||
}); | }); | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
// do the base map with these settings | // do the base map with these settings | ||
var map = ol3_jwMakeMap({ | var map = ol3_jwMakeMap({ |