1var harbours=new Array();var selectControlHarbour;var harbour_state=0;var harbour_current_feature=null;var popuptime=0;function make_harbour_request(params){var url="";for(var name in params){url+=(url.indexOf("?")>-1)?"&":"?";url+=encodeURIComponent(name)+"="+encodeURIComponent(params[name])} 2var skgUrl="http://dev.openseamap.org/website/map/api/getHarbours.php"+url;var script=document.createElement("script");script.src=skgUrl;script.type="text/javascript";document.body.appendChild(script)} 3function putHarbourMarker(id,lon,lat,names,link,type){if(!harbour_exist(id,type)){var name=names.split("-");if(type==-1){type=determineHarbourType(name[0])} 4var popupText="<b>"+name[0]+"</b> <br/>";if(typeof name[1]!="undefined"){popupText+=name[1]} 5if(typeof name[2]!="undefined"){popupText+="<br/><i>"+name[2]+"</i>"} 6if(link!=''){popupText+="<br/><br/><a href='"+link+"' target='blank'>"+linkTextSkipperGuide+"</a>"} 7popupText+="<br/><a href='http://openportguide.org/cgi-bin/weather/weather.pl/weather.png?var=meteogram&nx=614&ny=750&lat="+lat+"&lon="+lon+"&lang="+language+"&unit=metric&label="+convert2Locode(name[0])+"' target='blank'>"+linkTextWeatherHarbour+"</a>";create_harbour_marker(lon2x(lon),lat2y(lat),popupText,type);var harbour={id:id,name:names,lat:lat,lon:lon,type:type,feature:null};harbours.push(harbour)}} 8function refreshHarbours(){if(refreshHarbours.call_count==undefined){refreshHarbours.call_count=0}else{++refreshHarbours.call_count} 9bounds=map.getExtent().toArray();var b=y2lat(bounds[1]).toFixed(5);var t=y2lat(bounds[3]).toFixed(5);var l=x2lon(bounds[0]).toFixed(5);var r=x2lon(bounds[2]).toFixed(5);var params={"b":b,"t":t,"l":l,"r":r,"ucid":refreshHarbours.call_count,"maxSize":getHarbourVisibility(zoom),"zoom":zoom};make_harbour_request(params)} 10function harbour_exist(id,type){for(var i in harbours){if(harbours[i].id==id&&(harbours[i].type==type||type==-1&&(harbours[i].type==5||harbours[i].type==6))){return!0}} 11return!1} 12function isWPI(type){if(type<=4){return!0} 13return!1} 14function determineHarbourType(myName){for(var i in harbours){var otherName=harbours[i].name.split("-");if(myName==otherName[0]){return 6}} 15return 5} 16function getHarbourVisibility(zoom){var maxType=1;if(zoom>=7){maxType=2} 17if(zoom>=8){maxType=3} 18if(zoom>=9){maxType=4} 19if(zoom>=10){maxType=6} 20return maxType} 21function get_harbour(id,type){for(var i in harbours){if(harbours[i].id==id&&harbours[i].type==type){return harbours[i]}} 22return''} 23function create_harbour_marker(x,y,popupText,type){var layer_poi_icon_style=OpenLayers.Util.extend({});var harbour_marker=new OpenLayers.Geometry.Point(x,y);var maxType=getHarbourVisibility(zoom);if(type<=maxType){if(isWPI(type)){layer_poi_icon_style.externalGraphic='./resources/places/harbour_32.png'}else{if(type==6){layer_poi_icon_style.externalGraphic='./resources/places/anchorage_32.png'}else{layer_poi_icon_style.externalGraphic='./resources/places/marina_32.png'}} 24layer_poi_icon_style.graphicWidth=24;layer_poi_icon_style.graphicHeight=24;if(zoom>=5||refreshHarbours.call_count>0){var pointFeature=new OpenLayers.Feature.Vector(harbour_marker,null,layer_poi_icon_style);pointFeature.popupClass=OpenLayers.Class(OpenLayers.Popup.FramedCloud);pointFeature.data.popupContentHTML=popupText;layer_pois.addFeatures([pointFeature])}}} 25;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.