window.blob=JSON.parse('{}'); window.arma=null; // // MAIN LOAD START HERE // https://web.archive.org/web/20200502112446/http://dev.openlayers.org/releases/OpenLayers-2.13.1/doc/apidocs/files/OpenLayers-js.html // // function getJSONbioosm() { url="./bioosm.json"; var request; if(window.XMLHttpRequest) request=new XMLHttpRequest(); else request=new ActiveXObject("Microsoft.XMLHTTP"); request.onreadystatechange=function() { if(request.readyState==4) { window.blob=JSON.parse(request.responseText); window.arma=blob.arma; // Display ONLY platyhelminthes if reguired pus=document.URL.match(/platyhelminthes=understone/); console.log(pus); if(pus) plostenkoidy(); else // Else initial load armageddon() } } request.open("GET","./"+ubermaster+".json",true); // defined in html request.send(); } getJSONbioosm(); var stud=JSON.parse('{}'); var vectorLayerDynamic = new OpenLayers.Layer.Vector('Overlay',{attribution:'Brmlab'}); var vectorLayerPonygon = new OpenLayers.Layer.Vector('Overlay',{attribution:'Brmlab'}); map.addLayer(vectorLayerPonygon); map.addLayer(vectorLayerDynamic); //map.setLayerZIndex(vectorLayerDynamic,999); //map.raiseLayer(vectorLayerDynamic,map.layers.length); var studlay = new OpenLayers.Layer.Vector("Overlay",{attribution:"Brmlab"}); // studanky map.addLayer(studlay); var regsel=document.getElementById("reg") var physel=document.getElementById("phy") var clasel=document.getElementById("cla") var ordsel=document.getElementById("ord") var famsel=document.getElementById("fam") var gensel=document.getElementById("gen") var spesel=document.getElementById("spe") var ICON_animalia="animalia.png" var ICON_bacteria="bacteria.png" var ICON_fungi="fungi.png" var ICON_chromista="chromista.png" var ICON_plantae="plantae.svg" var ICON_plostenkoid="plostenkoid.png" var ICON_protista="protista.png" var ICON_biohazard="biohazard.svg" var ICON_studanka="studanka.png" var ICON_negative="negative.png" function getJSONstud() { url="./stud.json"; var request; if(window.XMLHttpRequest) request=new XMLHttpRequest(); else request=new ActiveXObject("Microsoft.XMLHTTP"); request.onreadystatechange=function() { if(request.readyState==4) { stud=JSON.parse(request.responseText); studdraw(stud); } } request.open("GET",url,true); request.send(); } function studdraw(sj) { studlay.destroyFeatures(); sjs=stud.std; s=[]; for(i=0;i"+sjs[i].name+""},{'externalGraphic':ICON_studanka,'graphicHeight':24,'graphicWidth':24,'graphicXOffset':-12,'graphicYOffset':-12}); studlay.addFeatures(s[i]); } } function studdrv() { box=document.getElementById("studchecker"); if(box.checked) getJSONstud(); else studlay.destroyFeatures(); } // Return icon by Regnum function geticon (a,i) { if(a[i].genus=="negative") return ICON_negative; var p=true; var r="" if(document.getElementById("reg").value!="ALL") { r=document.getElementById("reg").value p=false; } else { r=a[i].regnum for(var e=i;e>=0 && a[e].locality==a[i].locality;e--) { if(a[e].phylum!="Platyhelminthes") p=false; if(a[e].regnum!=a[i].regnum) { r="ALL"; break; } } } switch (r) { case "Animalia": { if(p) return ICON_plostenkoid; return ICON_animalia; } case "Bacteria": return ICON_bacteria; case "Fungi": return ICON_fungi; case "Chromista": return ICON_chromista; case "Plantae": return ICON_plantae; case "Protista": return ICON_protista; default: return ICON_biohazard } } function genphy() { physel.innerHTML="" clasel.innerHTML="" ordsel.innerHTML="" famsel.innerHTML="" gensel.innerHTML="" spesel.innerHTML="" var phyarr=[] for (var i=0;i" continue } if(phyarr[i]!=phyarr[i-1]) physel.innerHTML+="" } armageddon() // Populate the map with monsters... } function gencla() { clasel.innerHTML="" ordsel.innerHTML="" famsel.innerHTML="" gensel.innerHTML="" spesel.innerHTML="" var claarr=[] for (var i=0;i" continue } if(claarr[i]!=claarr[i-1]) clasel.innerHTML+="" } armageddon() // Populate the map with monsters... } function genord() { ordsel.innerHTML="" famsel.innerHTML="" gensel.innerHTML="" spesel.innerHTML="" var ordarr=[] for (var i=0;i" continue } if(ordarr[i]!=ordarr[i-1]) ordsel.innerHTML+="" } armageddon() // Populate the map with monsters... } function genfam() { famsel.innerHTML="" gensel.innerHTML="" spesel.innerHTML="" var famarr=[] for (var i=0;i" continue } if(famarr[i]!=famarr[i-1]) famsel.innerHTML+="" } armageddon() // Populate the map with monsters... } function gengen() { gensel.innerHTML="" spesel.innerHTML="" var genarr=[] for (var i=0;i" continue } if(genarr[i]!=genarr[i-1]) gensel.innerHTML+="" } //genspe() // ...and here we go armageddon() // Populate the map with monsters... } function genspe() { spesel.innerHTML="" var spearr=[] for (var i=0;i" continue } if(spearr[i]!=spearr[i-1]) spesel.innerHTML+="" } armageddon() // Populate the map with monsters... } function armageddon() { console.log("a "+window.arma.length); var speval=document.getElementById("spe").value var genval=document.getElementById("gen").value var famval=document.getElementById("fam").value var ordval=document.getElementById("ord").value var claval=document.getElementById("cla").value var phyval=document.getElementById("phy").value var regval=document.getElementById("reg").value var a=[] if(speval!="ALL") { for(var i=0;i' if(a[i].obr != "") spoj+='' else spoj+='' spoj+=""+a[i].title+"
"+a[i].takendate+"" spoj+="" ox=a[i].x oy=a[i].y continue; } switch(a[i].specie) { case "sp.": { wikisp="https://en.wikipedia.org/wiki/"+a[i].genus break; } case "negative": case "": { wikisp="https://en.wikipedia.org/wiki/Null_result" break; } default: { wikisp="https://en.wikipedia.org/wiki/"+a[i].genus+" "+a[i].specie break; } } // Bud prvni zaznam, nebo zmena pozice // Predchozi pozice jen 1 zaznam? if(sam != "") { samicon=geticon(a,i-1) n[i] = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(ox,oy).transform(epsg4326,projectTo),{'description':sam},{'externalGraphic':samicon,'graphicHeight':24,'graphicWidth':24,'graphicXOffset':-12,'graphicYOffset':-12}); vectorLayerDynamic.addFeatures(n[i]); spoj="" sam="" } // ELSE vytvori prazdny radek // Predchozi pozice vic zaznamu? if(spoj!="") { spojicon=geticon(a,i-1) n[i] = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(ox,oy).transform(epsg4326,projectTo),{'description':""+spoj+"
"},{'externalGraphic':spojicon,'graphicHeight':24,'graphicWidth':24,'graphicXOffset':-12,'graphicYOffset':-12}); vectorLayerDynamic.addFeatures(n[i]); spoj="" sam="" } bylo=a[i].locality spoj='' if(a[i].obr != "") spoj+='' else spoj+='' spoj+=''+a[i].title+'
'+a[i].takendate+'' spoj+="" sam=''+a[i].title+'' sam+='
' sam+=''+(a[i].title=="negative"?"Negative observation":a[i].title)+'
' if(a[i].imperium != "") sam+='Domain: '+a[i].imperium+'
' if(a[i].regnum != "") sam+='Kingdom: '+a[i].regnum+'
' if(a[i].phylum != "") sam+='Phylum: '+a[i].phylum+'
' if(a[i].classis != "") sam+='Class: '+a[i].classis+'
' if(a[i].ordo != "") sam+='Order: '+a[i].ordo+'
' if(a[i].familia != "") sam+='Family: '+a[i].familia+'
' if(a[i].genus != "" && a[i].genus!="negative") sam+='Genus: '+a[i].genus+'
' if(a[i].specie != "") sam+='Species: '+a[i].specie+'
' if(a[i].biotope != "") sam+="Biotope: "+a[i].biotope+"
" if(a[i].pov != "") sam+="River: "+a[i].pov+"
" if(a[i].temperature != "") sam+="Temperature: "+a[i].temperature+" °C
" if(a[i].pov != "") sam+="Conductivity: "+a[i].conductivity+" mSv
" if(a[i].pov != "") sam+="pH: "+a[i].ph+"
" if(a[i].takendate != "") sam+="Date: "+a[i].takendate+"
" sam+="Location: "+a[i].locality+" ("+a[i].locplain+")
" if(a[i].observer != "") sam+="Spectator: "+a[i].observer+"
" if(a[i].micro != "") sam+="Microscope: "+a[i].micro+" ("+a[i].microtyp+")
" if(a[i].enlargement != "") sam+="Amplification: "+a[i].enlargement+"
" /* if [[ "$des" != "" ]]; then # sam="$samDepictio: $des
" # fi */ //if(a[i].videolink != "") // sam+='Video: '+a[i].videolink+'
' sam+="
" ox=a[i].x oy=a[i].y } // Konec prochazeni a[] // Do not forget to print last line when FOR ends! samicon=geticon(a,i-1) if(sam == "") sam=''+spoj+'
' n[i]=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[i-1].x,a[i-1].y).transform(epsg4326,projectTo),{description:"'"+sam+"'"},{externalGraphic:samicon,graphicHeight:24,graphicWidth:24,graphicXOffset:-12,graphicYOffset:-12}); vectorLayerDynamic.addFeatures(n[i]); } // Konec armageddonu //var laycon = [vectorLayer,vectorLayerPonygon,vectorLayerDynamic,studlay]; var laycon = [vectorLayer,vectorLayerDynamic,studlay]; var controls = {selector: new OpenLayers.Control.SelectFeature(laycon, { onSelect: createPopup, onUnselect: destroyPopup })}; map.addControl(controls['selector']); controls['selector'].activate(); function createPopup(feature) { feature.popup = new OpenLayers.Popup.FramedCloud('pop', feature.geometry.getBounds().getCenterLonLat(), null, '
'+feature.attributes.description+'
', null, false, // Close button? function() { controls['selector'].unselectAll(); } ); //feature.popup.closeOnMove = true; map.addPopup(feature.popup); } function destroyPopup(feature) { feature.popup.destroy(); feature.popup = null; } // Vyhledavani function limit() { srch=document.getElementById("srch").value.toLowerCase(); var p=[] for(var i=0;i=0|| window.arma[i].imperium.toLowerCase().indexOf(srch)>=0|| window.arma[i].regnum.toLowerCase().indexOf(srch)>=0|| window.arma[i].phylum.toLowerCase().indexOf(srch)>=0|| window.arma[i].classis.toLowerCase().indexOf(srch)>=0|| window.arma[i].ordo.toLowerCase().indexOf(srch)>=0|| window.arma[i].familia.toLowerCase().indexOf(srch)>=0|| //window.arma[i].genus.toLowerCase().indexOf(srch)>=0|| // v "qualis" //window.arma[i].observerie.toLowerCase().indexOf(srch)>=0|| window.arma[i].locplain.toLowerCase().indexOf(srch)>=0|| window.arma[i].description.toLowerCase().indexOf(srch)>=0|| window.arma[i].takendate.toLowerCase().indexOf(srch)>=0|| window.arma[i].micro.toLowerCase().indexOf(srch)>=0|| window.arma[i].microtyp.toLowerCase().indexOf(srch)>=0|| window.arma[i].biotope.toLowerCase().indexOf(srch)>=0|| window.arma[i].pov.toLowerCase().indexOf(srch)>=0) p.push(arma[i]) } icongeddon(p) } // ====== GEOJSON ====== var metageo=JSON.parse("{}"); var geje=[]; var gejbarva=""; function placegeo(coor,gejbarva) { var geja=new Array; epsg4326 = new OpenLayers.Projection("EPSG:4326"); //WGS 1984 projection projectTo = map.getProjectionObject(); for(i=0;i#[0-9a-fA-F]*<\/se:SvgParameter/)[0].match(/#[0-9a-fA-F]*/)[0]; getgeo(url,g,tmpc); //console.log(tmpc); } } request.open("GET",url+s,true); request.send(); } function getgeo(url,g,c) { var request; if(window.XMLHttpRequest) request=new XMLHttpRequest(); else request=new ActiveXObject("Microsoft.XMLHTTP"); request.overrideMimeType("application/geo+json"); request.onreadystatechange=function() { if(request.readyState==4) { tmpg=JSON.parse(request.responseText); for(var e=0;e