'),h=_.map(c,function(c){var d=_.findIndex(a,function(a){return a===c});return i(c,d,b,f,a)},this);return g.append(h),e.append('
'+d+"
"),e.append(g),e}).value();c.html(o),c.scrollTop(0)}var l=KR.Util.getDatasetTemplate("popup"),m=new a;return c=$(c),b=$(b),d=$(d),{showFeature:j,showFeatures:k,setMap:function(a){m.setMap(a)}}}}();var KR=this.KR||{};KR.DatasetLoader=function(a,b,c,d,e,f){"use strict";function g(a){var b=KR.Util.stamp(a);return function(c){return c&&c.features.length?(_.each(c.features,function(c){c.properties.datasetID=b,_.has(a,"circle")&&(c.properties.circle=a.circle),_.has(a,"provider")&&(c.properties.provider=a.provider),_.has(a,"extras")&&(c.properties=_.extend(c.properties,a.extras)),c.properties.feedbackForm=a.feedbackForm,_.has(a,"mappings")&&_.each(a.mappings,function(a,b){c.properties[b]=c.properties[a]}),c.template=KR.Util.getTemplateForFeature(c,a)}),c):c}}function h(a){var b=_.reduce(_.without(_.keys(a),"datasets"),function(b,c){return"style"!==c&&(b[c]=a[c]),b},{});if(a.style){b.extras=b.extras||{};var c=KR.Util.stamp(a);b.extras.groupId=c,KR.Style.groups[c]=a.style}return a.datasets=_.map(a.datasets,function(a){return _.extend({},b,a)}),a}function i(a,b){var c={dataset:b,onEachFeature:function(a,c){A&&A(a,c,b)}};return b.style&&(c.style=b.style),L.Knreise.geoJson(a,c)}function j(a,b){a.clearLayers();var c=_.reduce(b,function(a,b){return a.concat(b.toGeoJSON().features)},[]);a.addData(KR.Util.createFeatureCollection(c)),a.fire("dataAdded")}function k(a,c){a.clearLayers();var d=_.reduce(c,function(a,c){return c.setMap(b),a.concat(c.getLayers())},[]);a.addLayers(d)}function l(a,b){a.on("hide",function(){b(!0)}),a.on("show",function(){b(!0)})}function m(a,b){var c;e?c=i(null,a):a.cluster?(c=new L.Knreise.MarkerClusterGroup({dataset:a,maxClusterRadius:f}).addTo(b),z&&z(c,a)):c=i(null,a).addTo(b);var d=!0;return a.minFeatures&&(d=!1),c.enabled=d,c}function n(a,b){a.enabled!==b&&(a.enabled=b,a.fire("changeEnabled"))}function o(a){if(a.datasets&&!a.grouped){var b=_.filter(a.datasets,function(a){return a.visible}).length;return b>0}return a.visible}function p(a){return a.minZoom&&b.getZoom()
-1){var c=a.split(":");a=c[0],b=c[1]}if(_.has(f,a)){var d=f[a];return b&&"norvegiana"===d.dataset.api&&(d.dataset.query="dc_subject_text:"+b),d}}).compact().value()}}(KR.Config);var KR=this.KR||{};!function(a){"use strict";function b(a){return turf.featurecollection([turf.simplify(a.features[0],.001,!1)])}function c(a,b){return b=b||{},{polyline:{positions:a,width:5,material:new Cesium.PolylineOutlineMaterialProperty({color:Cesium.Color.ORANGE,outlineWidth:2,outlineColor:Cesium.Color.BLACK})}}}function d(a,b,c){var d=a.layer||"topo2";if("norges_grunnkart_graatone"===d&&(d="norges_grunnkart"),"hist"===d)c(b.getWms("http://wms.geonorge.no/skwms1/wms.historiskekart","historiskekart"));else if("nib"===d){var e="http://knreise.no/nib/?type=token";KR.Util.sendRequest(e,null,function(a){c(0!==a.indexOf("**")?b.getWmts("http://crossorigin.me/http://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nibcache_wmts","NiB",{TILEMATRIXSET:"EPSG:900913",TILEMATRIX:"EPSG:900913:{TileMatrix}",FORMAT:"image/jpeg",GKT:a}):b.getTiles("http://www.webatlas.no/wacloud/servicerepository/combine.aspx?X={x}&Y={y}&Z={z}&layers=TMS_WEBATLAS_STANDARD:1"))})}else c(b.getWmts("http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts",d,{TILEMATRIXSET:"EPSG:3857",TILEMATRIX:"EPSG:3857:{TileMatrix}",FORMAT:"image/png"}))}function e(a){function b(){e.find(".glyphicon").removeClass("glyphicon-play").addClass("glyphicon-pause"),a.start()}function c(){e.find(".glyphicon").removeClass("glyphicon-pause").addClass("glyphicon-play"),a.stop()}function d(){a.isRunning()?c():b()}var e=$("#playpause");return{play:b,pause:c,toggle:d}}var f={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!0,navigationInstructionsInitiallyVisible:!1,orderIndependentTranslucency:!1};a.setupMap3d=function(a,g,h){function i(){var b=KR.Config.getDatasets(g,a);return _.chain(b).map(function(a){return a.datasets?a.datasets:a}).flatten().filter(function(a){return _.has(a.dataset,"kommune")&&_.isUndefined(a.dataset.kommune)?!1:!0}).value()}function j(a,b){return new KR.CesiumMap(a,_.extend(f,{limitBounds:h.limitBounds,terrainUrl:h.terrainUrl,enableLighting:h.enableLighting}),b)}function k(b,c,d){_.each(b,function(b){var d=KR.Util.getDatasetId(b),e={template:b.template,datasetId:d,"marker-color":KR.Style.colorForFeature({properties:{datasetId:d}},!1)};o.loadDataset2(b.dataset,c,a,e)}),o.addClickhandler(function(a){q.show(a),d&&d()})}function l(a){o=j("cesium-viewer",a),o.viewer.scene.imageryLayers.removeAll(),d(h,o,o.addImageryProvider),k(i(),a),o.stopLoading()}function m(){var f,g,l=!1;KR.Util.getLine(a,h.line,function(a){if(p=KR.CesiumUtils.getBounds(a),o=j("cesium-viewer",p),d(h,o,o.addImageryProvider),k(i(),p,function(){h.player&&(l=f.isRunning(),g.pause(),f.stop())}),o.build3DLine(a,function(a){var b=c(a,{color:Cesium.Color.DEEPSKYBLUE,glow:.25});o.viewer.zoomTo(o.viewer.entities.add(b)),o.stopLoading()}),h.player){var m=b(a);o.build3DLine(m,function(a){f=new KR.PathTracer(o.viewer,a,m),f.setPitchCorr(.1),g=new e(f),$("#playpause").removeClass("hidden"),$("#playpause").click(g.toggle)}),q.addCloseCb(function(){l&&g.play()})}})}function n(){h.bbox?l(h.bbox):h.komm?a.getMunicipalityBounds(h.komm,l):h.line?m():alert("Missing parameters!")}h=h||{},h=_.extend({player:!0,limitBounds:!1},h);var o,p,q=KR.CesiumSidebar($("#cesium-sidebar"),{});n()}}(KR);
\ No newline at end of file
+},noListThreshold:0,description:"Personer og eiendommer fra folketellingen 1910"},ark_hist:{grouped:!0,name:"Arkeologi og historie",datasets:[{name:"MUSIT",provider:"Universitetsmuseene",dataset:{api:"norvegiana",dataset:"MUSIT"},template:KR.Util.getDatasetTemplate("musit")},{name:"DiMu",dataset:{api:"norvegiana",dataset:"DiMu"},template:KR.Util.getDatasetTemplate("digitalt_museum"),isStatic:!1},{id:"riksantikvaren",name:"Riksantikvaren",provider:"Riksantikvaren",dataset:{api:"kulturminnedataSparql",kommune:c,fylke:d},template:KR.Util.getDatasetTemplate("ra_sparql"),bbox:!1,isStatic:!0,init:e.initKulturminnePoly,loadWhenLessThan:{count:5,callback:e.loadKulturminnePoly}}],description:"Data fra Universitetsmuseene, Digitalt museum og Riksantikvaren"},jernbane:{id:"jernbane",dataset:{api:"jernbanemuseet"},provider:"Jernbanemuseet",name:"Jernbanemuseet",hideFromGenerator:!0,template:KR.Util.getDatasetTemplate("jernbanemuseet"),getFeatureData:function(a,c){b.getItem({api:"jernbanemuseet",id:a.properties.id},c)},isStatic:!0,bbox:!1,description:"Jernbanemuseet"},arkeologi:{grouped:!0,name:"Arkeologi",style:{fillcolor:"#436978",circle:!1,thumbnail:!0},datasets:[{name:"MUSIT",provider:"Universitetsmuseene",dataset:{api:"norvegiana",dataset:"MUSIT"},template:KR.Util.getDatasetTemplate("musit")},{id:"riksantikvaren",name:"Riksantikvaren",provider:"Riksantikvaren",dataset:{filter:'FILTER regex(?loccatlabel, "^Arkeologisk", "i") .',api:"kulturminnedataSparql",kommune:c,fylke:d},template:KR.Util.getDatasetTemplate("ra_sparql"),bbox:!1,isStatic:!0,init:e.initKulturminnePoly,loadWhenLessThan:{count:5,callback:e.loadKulturminnePoly}}],description:"Arkeologidata fra Universitetsmuseene og Riksantikvaren"},historie:{grouped:!0,name:"Historie",style:{fillcolor:"#D252B9",circle:!1,thumbnail:!0},datasets:[{id:"riksantikvaren",name:"Riksantikvaren",provider:"Riksantikvaren",dataset:{filter:'FILTER (!regex(?loccatlabel, "^Arkeologisk", "i"))',api:"kulturminnedataSparql",kommune:c,fylke:d},template:KR.Util.getDatasetTemplate("ra_sparql"),bbox:!1,isStatic:!0,init:e.initKulturminnePoly,loadWhenLessThan:{count:5,callback:e.loadKulturminnePoly}},{name:"DiMu",dataset:{api:"norvegiana",dataset:"DiMu",query:"-dc_subject_facet:Kunst"},template:KR.Util.getDatasetTemplate("digitalt_museum"),isStatic:!1,bbox:!0},{dataset:{api:"norvegiana",dataset:"Industrimuseum"},isStatic:!1,bbox:!0},{dataset:{api:"norvegiana",dataset:"Foto-SF"},isStatic:!1,bbox:!1,template:KR.Util.getDatasetTemplate("foto_sf")},{dataset:{api:"norvegiana",dataset:"Kystreise"},isStatic:!0,bbox:!1}],description:"Historie og kulturminner fra Riksantikvaren og Digitalt museum "},kunst:{grouped:!0,name:"Kunst",style:{fillcolor:"#72B026",circle:!1,thumbnail:!0},datasets:[{name:"DiMu",dataset:{api:"norvegiana",dataset:"DiMu",query:"dc_subject_facet:Kunst"},template:KR.Util.getDatasetTemplate("digitalt_museum"),isStatic:!1}],description:"Kunstdata fra Digitalt museum "},wikipedia:{name:"Wikipedia",provider:"Wikipedia",dataset:{api:"wikipedia"},style:{thumbnail:!0},minZoom:13,template:KR.Util.getDatasetTemplate("wikipedia"),description:"Stedfestede artikler fra bokmålswikipedia"},wikipediaNN:{name:"Wikipedia Nynorsk",provider:"Wikipedia Nynorsk",dataset:{api:"wikipediaNN"},style:{thumbnail:!0},minZoom:13,template:KR.Util.getDatasetTemplate("wikipedia"),description:"Stedfestede artikler fra nynorskwikipedia"},lokalwiki:{id:"lokalwiki",name:"Lokalhistoriewiki",hideFromGenerator:!1,provider:"Lokalhistoriewiki",dataset:{api:"lokalhistoriewiki"},style:{thumbnail:!0},minZoom:13,bbox:!0,isStatic:!1,description:"Stedfestede artikler fra lokalhistoriewiki.no"},riksantikvaren:{id:"riksantikvaren",name:"Kulturminnesøk",hideFromGenerator:!1,provider:"Riksantikvaren",dataset:{api:"kulturminnedataSparql",kommune:c,fylke:d},template:KR.Util.getDatasetTemplate("ra_sparql"),bbox:!1,isStatic:!0,init:e.initKulturminnePoly,loadWhenLessThan:{count:10,callback:e.loadKulturminnePoly},description:"Data fra Riksantikvarens kulturminnesøk"},brukerminner:{name:"Kulturminnesøk - brukerregistreringer",hideFromGenerator:!1,provider:"riksantikvaren",dataset:{api:"kulturminnedata",layer:2,getExtraData:!0,extraDataLayer:6,matchId:"KulturminnesokID"},cluster:!0,isStatic:!1,style:{thumbnail:!0},description:"Brukerregistrerte data fra Riksantikvarens kulturminnesøk",template:KR.Util.getDatasetTemplate("brukerminne")},groruddalen:{name:"Byantikvaren Oslo - Groruddalen",hideFromGenerator:!0,provider:"Byantikvaren i Oslo",dataset:{api:"cartodb",table:"byantikvaren_oslo_groruddalen"},bbox:!1,isStatic:!1,style:{thumbnail:!0},template:KR.Util.getDatasetTemplate("byantikvaren_oslo"),description:"Byantikvarens Groruddalsatlas"},norgerundt:{name:"Norge Rundt",hideFromGenerator:!0,provider:"NRK",dataset:{api:"cartodb",table:"nrk_norge_rundt"},bbox:!1,isStatic:!1,style:{thumbnail:!0},description:"Stedfestede innslag fra Norge Rundt"},dimu:{name:"Digitalt Museum",hideFromGenerator:!1,provider:"dimu",dataset:{dataset:"DiMu",api:"norvegiana"},cluster:!0,isStatic:!1,style:{thumbnail:!0},description:"Alle stedfestede data fra Digitalt Museum",allowTopic:!0,feedbackForm:!0},musit:{name:"Universitetsmuseene",hideFromGenerator:!1,provider:"Universitetsmuseene",dataset:{dataset:"MUSIT",api:"norvegiana"},cluster:!0,isStatic:!1,style:{thumbnail:!0},description:"Alle stedfestede data fra Universitetsmuseene",allowTopic:!0,feedbackForm:!0},industrimuseum:{name:"Industrimuseum",hideFromGenerator:!1,provider:"Industrimuseum",dataset:{dataset:"Industrimuseum",api:"norvegiana"},cluster:!0,isStatic:!1,style:{thumbnail:!0},description:"Alle stedfestede data fra Industrimuseum",allowTopic:!0,feedbackForm:!0},kystreise:{name:"Kystreise",hideFromGenerator:!1,provider:"Kystreise",dataset:{dataset:"Kystreise",api:"norvegiana"},cluster:!0,isStatic:!1,style:{thumbnail:!0},description:"Alle stedfestede data fra Kystreise",allowTopic:!0,feedbackForm:!0},dimufoto:{hideFromGenerator:!0,dataset:{api:"norvegiana",dataset:"DiMu",query:"europeana_type_facet:IMAGE"},template:KR.Util.getDatasetTemplate("digitalt_museum"),isStatic:!1,style:{thumbnail:!0},noListThreshold:1/0},kulturminnesok_flickr:{name:"Kulturminnesøk",dataset_name_override:"Kulturminnesøk",provider:"Kulturminnesøk Flickr",hideFromGenerator:!0,dataset:{api:"flickr",group_id:"1426230@N24"},template:KR.Util.getDatasetTemplate("flickr"),isStatic:!0,style:{thumbnail:!0},description:"Bilder fra Kulturminnesøks Flickr-gruppe"},riksarkivet:{name:"Riksarkivet",dataset_name_override:"Riksarkivet",provider:"riksarkivet",hideFromGenerator:!0,dataset:{api:"flickr",user_id:"national_archives_of_norway"},template:KR.Util.getDatasetTemplate("flickr"),isStatic:!1,style:{thumbnail:!0},description:"Bilder fra Riksarkivets Flickr-konto"},nasjonalbiblioteket:{name:"Nasjonalbiblioteket",dataset_name_override:"Nasjonalbiblioteket",provider:"nasjonalbiblioteket",hideFromGenerator:!0,dataset:{api:"flickr",user_id:"national_library_of_norway"},template:KR.Util.getDatasetTemplate("flickr"),isStatic:!1,style:{thumbnail:!0},description:"Bilder fra Nasjonalbibliotekets Flickr-konto"},oslobyarkiv:{name:"Oslo Byarkiv",dataset_name_override:"Oslo Byarkiv",provider:"oslobyarkiv",hideFromGenerator:!0,dataset:{api:"flickr",user_id:"byarkiv"},template:KR.Util.getDatasetTemplate("flickr"),isStatic:!1,style:{thumbnail:!0},description:"Bilder fra Oslo byarkiv sin Flickr-konto"},nasjonalmuseet:{name:"Nasjonalmuseet",dataset_name_override:"Nasjonalmuseet",provider:"nasjonalmuseet",hideFromGenerator:!0,dataset:{api:"flickr",user_id:"nasjonalmuseet"},template:KR.Util.getDatasetTemplate("flickr"),isStatic:!1,style:{thumbnail:!0},description:"Bilder fra Nasjonalmuseet sin Flickr-konto"},nve:{name:"NVE",dataset_name_override:"NVE",provider:"nve",hideFromGenerator:!0,dataset:{api:"flickr",user_id:"nve",accuracy:"6"},template:KR.Util.getDatasetTemplate("flickr"),isStatic:!1,style:{thumbnail:!0},description:"Bilder fra NVE Flickr-konto"},vestfoldmuseene:{name:"Vestfoldmuseene",dataset_name_override:"Vestfoldmuseene",provider:"Vestfoldmuseene",hideFromGenerator:!0,dataset:{api:"flickr",user_id:"vestfoldmuseene",accuracy:"1"},template:KR.Util.getDatasetTemplate("flickr"),isStatic:!1,style:{thumbnail:!0},description:"Bilder fra Vestfoldmuseene sin Flickr-konto"},perspektivet:{name:"Perspektivet Museum",dataset_name_override:"Perspektivet Museum",provider:"Perspektivet Museum",hideFromGenerator:!0,dataset:{api:"flickr",user_id:"perspektivetmuseum",accuracy:"1"},template:KR.Util.getDatasetTemplate("flickr"),isStatic:!1,style:{thumbnail:!0},description:"Bilder fra Perspektivet Museum sin Flickr-konto"}};if(!c&&!d){var g={bbox:!0,minZoom:12,isStatic:!1,bboxFunc:KR.Util.sparqlBbox};_.extend(f.riksantikvaren,g),_.extend(f.ark_hist.datasets[2],g),_.extend(f.arkeologi.datasets[1],g),_.extend(f.historie.datasets[0],g)}return f},a.getDatasets=function(b,c,d,e){var f=a.getDatasetList(c,d,e);return _.chain(b).map(function(a){var b;if(a.indexOf(":")>-1){var c=a.split(":");a=c[0],b=c[1]}if(_.has(f,a)){var d=f[a];return b&&"norvegiana"===d.dataset.api&&(d.dataset.query="dc_subject_text:"+b),d}}).compact().value()}}(KR.Config);var KR=this.KR||{};!function(a){"use strict";function b(a){return turf.featurecollection([turf.simplify(a.features[0],.001,!1)])}function c(a,b){return b=b||{},{polyline:{positions:a,width:5,material:new Cesium.PolylineOutlineMaterialProperty({color:Cesium.Color.ORANGE,outlineWidth:2,outlineColor:Cesium.Color.BLACK})}}}function d(a,b,c){var d=a.layer||"topo2";if("norges_grunnkart_graatone"===d&&(d="norges_grunnkart"),"hist"===d)c(b.getWms("http://wms.geonorge.no/skwms1/wms.historiskekart","historiskekart"));else if("nib"===d){var e="http://knreise.no/nib/?type=token";KR.Util.sendRequest(e,null,function(a){c(0!==a.indexOf("**")?b.getWmts("http://crossorigin.me/http://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nibcache_wmts","NiB",{TILEMATRIXSET:"EPSG:900913",TILEMATRIX:"EPSG:900913:{TileMatrix}",FORMAT:"image/jpeg",GKT:a}):b.getTiles("http://www.webatlas.no/wacloud/servicerepository/combine.aspx?X={x}&Y={y}&Z={z}&layers=TMS_WEBATLAS_STANDARD:1"))})}else c(b.getWmts("http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts",d,{TILEMATRIXSET:"EPSG:3857",TILEMATRIX:"EPSG:3857:{TileMatrix}",FORMAT:"image/png"}))}function e(a){function b(){e.find(".glyphicon").removeClass("glyphicon-play").addClass("glyphicon-pause"),a.start()}function c(){e.find(".glyphicon").removeClass("glyphicon-pause").addClass("glyphicon-play"),a.stop()}function d(){a.isRunning()?c():b()}var e=$("#playpause");return{play:b,pause:c,toggle:d}}var f={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!0,navigationInstructionsInitiallyVisible:!1,orderIndependentTranslucency:!1};a.setupMap3d=function(a,g,h){function i(){var b=KR.Config.getDatasets(g,a);return _.chain(b).map(function(a){return a.datasets?a.datasets:a}).flatten().filter(function(a){return _.has(a.dataset,"kommune")&&_.isUndefined(a.dataset.kommune)?!1:!0}).value()}function j(a,b){return new KR.CesiumMap(a,_.extend(f,{limitBounds:h.limitBounds,terrainUrl:h.terrainUrl,enableLighting:h.enableLighting}),b)}function k(b,c,d){_.each(b,function(b){var d=KR.Util.getDatasetId(b),e={template:b.template,datasetId:d,"marker-color":KR.Style.colorForFeature({properties:{datasetId:d}},!1)};o.loadDataset2(b.dataset,c,a,e)}),o.addClickhandler(function(a){q.show(a),d&&d()})}function l(a){o=j("cesium-viewer",a),o.viewer.scene.imageryLayers.removeAll(),d(h,o,o.addImageryProvider),k(i(),a),o.stopLoading()}function m(){var f,g,l=!1;KR.Util.getLine(a,h.line,function(a){if(p=KR.CesiumUtils.getBounds(a),o=j("cesium-viewer",p),d(h,o,o.addImageryProvider),k(i(),p,function(){h.player&&(l=f.isRunning(),g.pause(),f.stop())}),o.build3DLine(a,function(a){var b=c(a,{color:Cesium.Color.DEEPSKYBLUE,glow:.25});o.viewer.zoomTo(o.viewer.entities.add(b)),o.stopLoading()}),h.player){var m=b(a);o.build3DLine(m,function(a){f=new KR.PathTracer(o.viewer,a,m),f.setPitchCorr(.1),g=new e(f),$("#playpause").removeClass("hidden"),$("#playpause").click(g.toggle)}),q.addCloseCb(function(){l&&g.play()})}})}function n(){h.bbox?l(h.bbox):h.komm?a.getMunicipalityBounds(h.komm,l):h.line?m():alert("Missing parameters!")}h=h||{},h=_.extend({player:!0,limitBounds:!1},h);var o,p,q=KR.CesiumSidebar($("#cesium-sidebar"),{});n()}}(KR);
\ No newline at end of file