Ero sivun ”Widget:Ol3SiteMapX” versioiden välillä
Järvi-meriwikistä
p (Tekstin korvaus – ”//www.jarviwiki.fi/scripts/” muotoon ”/scripts/”) |
|||
Rivi 12: | Rivi 12: | ||
<script src="/scripts/proj4js/dist/proj4.js"></script> | <script src="/scripts/proj4js/dist/proj4.js"></script> | ||
− | <script src="/scripts/jwol3js/jwol3.js"></script> | + | <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:TheSiteMap|escape:'html'}-->_memo = { 'SitesO': {}, 'TypesO': {}, 'obsTypeToShow': '' }; | var <!--{$id|default:TheSiteMap|escape:'html'}-->_memo = { 'SitesO': {}, 'TypesO': {}, 'obsTypeToShow': '' }; | ||
+ | function <!--{$id|default:TheSiteMap|escape:'html'}-->_jQueryTest() { | ||
− | + | if ( typeof window.jQuery == 'undefined' ) { | |
− | + | setTimeout( function(){ <!--{$id|default:TheSiteMap|escape:'html'}-->_jQueryTest() }, 300); | |
− | + | } else { | |
− | + | <!--{$id|default:TheSiteMap|escape:'html'}-->_func(); | |
− | + | } | |
− | + | } | |
− | + | setTimeout( function(){ <!--{$id|default:TheSiteMap|escape:'html'}-->_jQueryTest() }, 300); | |
− | |||
− | + | function <!--{$id|default:TheSiteMap|escape:'html'}-->_func() { | |
//widget globals | //widget globals | ||
Rivi 39: | Rivi 39: | ||
memo.g = { 'sizeFactor': 1.5, 'lang': '<!--{$lang|default:fi|escape:'html'}-->' }; | memo.g = { 'sizeFactor': 1.5, 'lang': '<!--{$lang|default:fi|escape:'html'}-->' }; | ||
− | var page = "<!--{$page|escape:'urlpathinfo'}-->"; | + | var page = "<!--{$page|default:X|escape:'urlpathinfo'}-->"; |
var sid = "<!--{$siteid|default:X|escape:'urlpathinfo'}-->"; | var sid = "<!--{$siteid|default:X|escape:'urlpathinfo'}-->"; | ||
− | var selectable = ("<!--{$selectable|escape:'urlpathinfo'}-->" == "true"); | + | var selectable = ("<!--{$selectable|default:false|escape:'urlpathinfo'}-->" == "true"); |
var zoom = <!--{$zoom|default:0|escape:'urlpathinfo'}-->; | var zoom = <!--{$zoom|default:0|escape:'urlpathinfo'}-->; | ||
var base = "<!--{$base|default:X|escape:'urlpathinfo'}-->"; | var base = "<!--{$base|default:X|escape:'urlpathinfo'}-->"; | ||
function gotCoords(request) { | function gotCoords(request) { | ||
− | + | console.log(request); | |
for (var x in request.query.results) { | for (var x in request.query.results) { | ||
var resultItem = request.query.results[x].printouts; break; | var resultItem = request.query.results[x].printouts; break; | ||
Rivi 65: | Rivi 65: | ||
var layersArr = []; | var layersArr = []; | ||
+ | |||
+ | layersArr.push({ 'type': 'geoloc', 'name': 'Sijaintisi', 'show': true, 'center': false, 'zoom': 12, 'track': false }); | ||
layersArr.push({ | layersArr.push({ | ||
Rivi 77: | Rivi 79: | ||
attribution: '' | attribution: '' | ||
}); | }); | ||
− | |||
− | |||
// do the base map with these settings | // do the base map with these settings |