OLCpatches[OLCpatches.length] = ["function addLayerPanoramio()", "addLayerPanoramio.js"];
function addLayerPanoramio()
{
    var styleMapPANO;

    var context = {
        getColor : function(ft){
            if(ft.attributes["owner_name"] == "pillboxs")
                return '#0000FF';
            else
                return '#00FF00';
        },
        getRadius : function(ft){
            if(ft.attributes["owner_name"] == "pillboxs")
                return 4;
            else
                return 6;
        }
    };

    var template = {
        strokeColor:  "${getColor}",
        strokeOpacity: 1,
        strokeWidth: 3,
        fillColor: "#00FF00",
        fillOpacity: 0.5,
        pointRadius: "${getRadius}",
        pointerEvents: "visiblePainted"
    };

    var templateB = {
        strokeColor: "#FFFF00",
        strokeOpacity: 1,
        strokeWidth: 3,
        fillColor: "#FFFF00",
        fillOpacity: 0.25,
        pointRadius: 5,
        pointerEvents: "visiblePainted"
    };

    styleMapPANO = new OpenLayers.StyleMap( { "default" : new OpenLayers.Style(template, {context:context}), "select" : new OpenLayers.Style(templateB)} );


    //#######################################################

    var lyrPanoramio = new OpenLayers.Layer.Vector("Panoramio", {
            protocol: new OpenLayers.Protocol.HTTP({
                url: "/OLClient/extension/!proxyPANO_bbox.asp",
                format: new OpenLayers.Format.PANORAMIO()
            }),
            strategies: [new OpenLayers.Strategy.BBOX({ratio:0.5})],
            styleMap: styleMapPANO,
            projection: new OpenLayers.Projection("EPSG:4326")
        });

    lyrPanoramio["options"] = {
        "isBaseLayer": false,
        "visibility": true,
        "gutter": 0,
        "buffer": 1,
        "opacity": 1,
        "displayOutsideMaxExtent": true
    };

    lyrPanoramio["vendor"] = {
        "sid": "PANO100020",
        "service": "VECTOR",
        "aktlayers": "Vectors",
        "aktqlayers": "Vectors",
        "lyrNames": ["Vectors"],
        "lyrTitles": ["Vectors"],
        "lyrVisible": [1],
        "lyrQueryable": [0],
        "lyrQChecked": [0]
    };

    map.addLayer(lyrPanoramio);
    Wunderbar();

    if(objOLC.options.showPopup)
        regPopupEdit(lyrPanoramio, objOLC.options.popupNr);
}


