var map;
var selectControl, selectedFeature;
var vector9986, vector9987;
var v9986txt="
Deszcz - Stopień 1: deszcz 15-40 mm I/LUB śnieg 10-15 cm
Na zaznaczonym obszarze przewiduje sie opad deszczu o natezeniu ok. 25-30 mm/18h, punktowo w gorach do 35 mm/18h
Wydał: Laskowski | Ważne od: 2020-05-13 18:55:00Ważne do: 2020-05-14 13:00:00 |
";
var v9987txt="Deszcz - Stopień 1: deszcz 15-40 mm I/LUB śnieg 10-15 cm
Natezenie opadow deszczu moze osiagac 25-30 mm/18h, punktowo do 35 mm/18h.
Wydał: Laskowski | Ważne od: 2020-05-13 21:30:00Ważne do: 2020-05-14 15:30:00 |
";
//-------------------------------------------------------------------------------------------------
function onPopupClose(evt) {
selectControl.unselect(selectedFeature);
}
//-------------------------------------------------------------------------------------------------
function onFeatureSelect(feature) {
selectedFeature = feature;
var text= "Brak ostrzeżeń.";
if(feature.geometry.id == vector9986.features[0].geometry.id) text = v9986txt;
else if(feature.geometry.id == vector9987.features[0].geometry.id) text = v9987txt;
popup = new OpenLayers.Popup.FramedCloud("chicken",feature.geometry.getBounds().getCenterLonLat(),null,""+text+"
", null, true, onPopupClose);
feature.popup = popup;
map.addPopup(popup);
}
//-------------------------------------------------------------------------------------------------
function onFeatureUnselect(feature) {
map.removePopup(feature.popup);
feature.popup.destroy();
feature.popup = null;
}
//-------------------------------------------------------------------------------------------------
function init() {
map = new OpenLayers.Map("map");
var mapnik = new OpenLayers.Layer.OSM();
var fromProjection = new OpenLayers.Projection("EPSG:4326");
var toProjection = new OpenLayers.Projection("EPSG:900913");
var position = new OpenLayers.LonLat( 19.4118359375003,52.06827300198528).transform( fromProjection, toProjection);
var zoom = 5;
var epsg4326 = new OpenLayers.Projection("EPSG:4326");
map.addLayer(mapnik);
map.setCenter(position, zoom );
var sitePoints9986 = [];
var siteStyle9986 = {
'strokeWidth': 1,
'strokeColor': '#9496fc',
'strokeOpacity': '0.6',
'fillColor': '#9496fc',
'fillOpacity': '0.5'
};
var point_9986_0 = new OpenLayers.Geometry.Point(19.302978515625,49.385948749419);
point_9986_0.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_0);
var point_9986_1 = new OpenLayers.Geometry.Point(19.011840820312,49.360911547126);
point_9986_1.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_1);
var point_9986_2 = new OpenLayers.Geometry.Point(18.841552734375,49.428840000635);
point_9986_2.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_2);
var point_9986_3 = new OpenLayers.Geometry.Point(18.6767578125,49.582226044622);
point_9986_3.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_3);
var point_9986_4 = new OpenLayers.Geometry.Point(18.693237304688,49.710272582106);
point_9986_4.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_4);
var point_9986_5 = new OpenLayers.Geometry.Point(18.797607421875,49.767074073668);
point_9986_5.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_5);
var point_9986_6 = new OpenLayers.Geometry.Point(19.143676757812,49.845067579564);
point_9986_6.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_6);
var point_9986_7 = new OpenLayers.Geometry.Point(19.286499023438,49.866316729539);
point_9986_7.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_7);
var point_9986_8 = new OpenLayers.Geometry.Point(19.62158203125,49.876937800725);
point_9986_8.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_8);
var point_9986_9 = new OpenLayers.Geometry.Point(19.747924804688,49.862775853413);
point_9986_9.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_9);
var point_9986_10 = new OpenLayers.Geometry.Point(19.88525390625,49.837982453085);
point_9986_10.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_10);
var point_9986_11 = new OpenLayers.Geometry.Point(19.92919921875,49.813176333376);
point_9986_11.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_11);
var point_9986_12 = new OpenLayers.Geometry.Point(19.92919921875,49.774169585277);
point_9986_12.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_12);
var point_9986_13 = new OpenLayers.Geometry.Point(19.857788085938,49.706720281032);
point_9986_13.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_13);
var point_9986_14 = new OpenLayers.Geometry.Point(19.70947265625,49.628503923842);
point_9986_14.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_14);
var point_9986_15 = new OpenLayers.Geometry.Point(19.566650390625,49.564415162555);
point_9986_15.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_15);
var point_9986_16 = new OpenLayers.Geometry.Point(19.517211914062,49.532339195028);
point_9986_16.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_16);
var point_9986_17 = new OpenLayers.Geometry.Point(19.51171875,49.49667452747);
point_9986_17.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_17);
var point_9986_18 = new OpenLayers.Geometry.Point(19.522705078125,49.46098385111);
point_9986_18.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_18);
var point_9986_19 = new OpenLayers.Geometry.Point(19.583129882812,49.435984899682);
point_9986_19.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_19);
var point_9986_20 = new OpenLayers.Geometry.Point(19.632568359375,49.400249996652);
point_9986_20.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_20);
var point_9986_21 = new OpenLayers.Geometry.Point(19.758911132812,49.368066334822);
point_9986_21.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_21);
var point_9986_22 = new OpenLayers.Geometry.Point(19.791870117188,49.350177413469);
point_9986_22.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_22);
var point_9986_23 = new OpenLayers.Geometry.Point(19.88525390625,49.332281984738);
point_9986_23.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_23);
var point_9986_24 = new OpenLayers.Geometry.Point(20.050048828125,49.321541603699);
point_9986_24.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_24);
var point_9986_25 = new OpenLayers.Geometry.Point(20.110473632812,49.317960956023);
point_9986_25.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_25);
var point_9986_26 = new OpenLayers.Geometry.Point(20.165405273438,49.239120832467);
point_9986_26.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_26);
var point_9986_27 = new OpenLayers.Geometry.Point(20.093994140625,49.127813961593);
point_9986_27.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_27);
var point_9986_28 = new OpenLayers.Geometry.Point(20.006103515625,49.117029040779);
point_9986_28.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_28);
var point_9986_29 = new OpenLayers.Geometry.Point(19.780883789062,49.174521518068);
point_9986_29.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_29);
var point_9986_30 = new OpenLayers.Geometry.Point(19.632568359375,49.246293324598);
point_9986_30.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_30);
var point_9986_31 = new OpenLayers.Geometry.Point(19.506225585938,49.385948749419);
point_9986_31.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_31);
var point_9986_32 = new OpenLayers.Geometry.Point(19.40185546875,49.385948749419);
point_9986_32.transform(epsg4326, map.getProjectionObject());
sitePoints9986.push(point_9986_32);
sitePoints9986.push(sitePoints9986[0]);
var linearRing9986= new OpenLayers.Geometry.LinearRing(sitePoints9986);
var geometry9986 = new OpenLayers.Geometry.Polygon([linearRing9986]);
var polygonFeature9986 = new OpenLayers.Feature.Vector(geometry9986, null, siteStyle9986);
vector9986 = new OpenLayers.Layer.Vector("9986");
vector9986.addFeatures([polygonFeature9986]);
map.addLayer(vector9986);
var sitePoints9987 = [];
var siteStyle9987 = {
'strokeWidth': 1,
'strokeColor': '#9496fc',
'strokeOpacity': '0.6',
'fillColor': '#9496fc',
'fillOpacity': '0.5'
};
var point_9987_0 = new OpenLayers.Geometry.Point(24.14794921875,50.55532498252);
point_9987_0.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_0);
var point_9987_1 = new OpenLayers.Geometry.Point(23.02734375,50.541362965222);
point_9987_1.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_1);
var point_9987_2 = new OpenLayers.Geometry.Point(22.247314453125,50.4714908514);
point_9987_2.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_2);
var point_9987_3 = new OpenLayers.Geometry.Point(21.62109375,50.345460408605);
point_9987_3.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_3);
var point_9987_4 = new OpenLayers.Geometry.Point(21.3134765625,50.1276217283);
point_9987_4.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_4);
var point_9987_5 = new OpenLayers.Geometry.Point(21.324462890625,49.965355909913);
point_9987_5.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_5);
var point_9987_6 = new OpenLayers.Geometry.Point(21.654052734375,49.795449888028);
point_9987_6.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_6);
var point_9987_7 = new OpenLayers.Geometry.Point(22.620849609375,49.63917719651);
point_9987_7.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_7);
var point_9987_8 = new OpenLayers.Geometry.Point(22.994384765625,49.624945646501);
point_9987_8.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_8);
var point_9987_9 = new OpenLayers.Geometry.Point(23.236083984375,49.717376404936);
point_9987_9.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_9);
var point_9987_10 = new OpenLayers.Geometry.Point(23.939208984375,50.261253827585);
point_9987_10.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_10);
var point_9987_11 = new OpenLayers.Geometry.Point(24.136962890625,50.331436330839);
point_9987_11.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_11);
var point_9987_12 = new OpenLayers.Geometry.Point(24.290771484375,50.457504020421);
point_9987_12.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_12);
var point_9987_13 = new OpenLayers.Geometry.Point(24.3017578125,50.485473545785);
point_9987_13.transform(epsg4326, map.getProjectionObject());
sitePoints9987.push(point_9987_13);
sitePoints9987.push(sitePoints9987[0]);
var linearRing9987= new OpenLayers.Geometry.LinearRing(sitePoints9987);
var geometry9987 = new OpenLayers.Geometry.Polygon([linearRing9987]);
var polygonFeature9987 = new OpenLayers.Feature.Vector(geometry9987, null, siteStyle9987);
vector9987 = new OpenLayers.Layer.Vector("9987");
vector9987.addFeatures([polygonFeature9987]);
map.addLayer(vector9987);
map.addControl(new OpenLayers.Control.LayerSwitcher());
selectControl = new OpenLayers.Control.SelectFeature([vector9986, vector9987], {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});
map.addControl(selectControl);
selectControl.activate();
}