(function () {
var container = document.getElementById('popup2');
var content = document.getElementById('popup-content');
var closer = document.getElementById('popup-closer');
var overlay = new ol.Overlay({
element: container,
autoPan: true,
autoPanAnimation: {
duration: 250,
},
});
closer.onclick = function () {
overlay.setPosition(undefined);
closer.blur();
return false;
};
// PUNTI start ************************************************************************************
var style = [];
var vectorList_41 = [];
var iconList = [];
style['785'] = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.6)',
}),
radius: 10,
stroke: new ol.style.Stroke({
color: '#ff0',
width: 1,
}),
}),
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
};
// GPX start
var t = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([10.59549, 45.68514])),
name: 'Castagno',
description: '
Nome scientifico: CASTANEA SATIVA
Circonferenza a petto d\'uomo: 490 cm
Altezza stimata: 23 m
Diametro medio chioma: 21,5 m
'
});
t.setStyle(
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: '#bcd6c1'
}),
radius: 8,
stroke: new ol.style.Stroke({
color: '#000000',
width: 1,
}),
}),
}),
);
iconList.push(t);
style['789'] = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.6)',
}),
radius: 10,
stroke: new ol.style.Stroke({
color: '#ff0',
width: 1,
}),
}),
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
};
// GPX start
var t = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([10.56176, 45.67363])),
name: 'Castagno',
description: '
Nome scientifico: CASTANEA SATIVA
Circonferenza a petto d\'uomo: 575 cm
Altezza stimata: 19 m
Diametro medio chioma: 14 m
'
});
t.setStyle(
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: '#bcd6c1'
}),
radius: 8,
stroke: new ol.style.Stroke({
color: '#000000',
width: 1,
}),
}),
}),
);
iconList.push(t);
style['787'] = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.6)',
}),
radius: 10,
stroke: new ol.style.Stroke({
color: '#ff0',
width: 1,
}),
}),
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
};
// GPX start
var t = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([10.57551, 45.65247])),
name: 'Castagno da frutto',
description: '
Nome scientifico: CASTANEA SATIVA
Circonferenza esemplari massima: 500 cm
Altezza esemplari media: 10 m
Età presunta esemplari massima: 150-170 anni
'
});
t.setStyle(
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: '#bcd6c1'
}),
radius: 8,
stroke: new ol.style.Stroke({
color: '#000000',
width: 1,
}),
}),
}),
);
iconList.push(t);
style['781'] = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.6)',
}),
radius: 10,
stroke: new ol.style.Stroke({
color: '#ff0',
width: 1,
}),
}),
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
};
// GPX start
var t = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([10.61240541526365, 45.64232015565001])),
name: 'Cedro del libano',
description: '.jpg)
Nome scientifico: CEDRUS LIBANI
Circonferenza a petto d\'uomo: 425 cm
Altezza stimata: 21 m
Età presunta: 170-175 anni
'
});
t.setStyle(
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: '#bcd6c1'
}),
radius: 8,
stroke: new ol.style.Stroke({
color: '#000000',
width: 1,
}),
}),
}),
);
iconList.push(t);
style['780'] = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.6)',
}),
radius: 10,
stroke: new ol.style.Stroke({
color: '#ff0',
width: 1,
}),
}),
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
};
// GPX start
var t = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([10.612371152403044, 45.64247061693945])),
name: 'Cedro dell\'Himalaya',
description: '
Nome scientifico: CEDRUS DEODARA
Pianta più alta di tutto il comune
Circonferenza a petto d\'uomo: 570 cm
Altezza stimata: 34 m
Diametro medio chioma: 23 m
Età presunta: 170-175 anni
'
});
t.setStyle(
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: '#bcd6c1'
}),
radius: 8,
stroke: new ol.style.Stroke({
color: '#000000',
width: 1,
}),
}),
}),
);
iconList.push(t);
style['783'] = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.6)',
}),
radius: 10,
stroke: new ol.style.Stroke({
color: '#ff0',
width: 1,
}),
}),
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
};
// GPX start
var t = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([10.560875157154143, 45.69777706526676])),
name: 'Faggio',
description: '
Nome scientifico: FAGUS SYLVATICA
Circonferenza esemplari media: 330 m
Altezza esemplari media: 25 m
Età presunta esemplari massima: 100-120 anni
'
});
t.setStyle(
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: '#bcd6c1'
}),
radius: 8,
stroke: new ol.style.Stroke({
color: '#000000',
width: 1,
}),
}),
}),
);
iconList.push(t);
style['782'] = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.6)',
}),
radius: 10,
stroke: new ol.style.Stroke({
color: '#ff0',
width: 1,
}),
}),
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
};
// GPX start
var t = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([10.563107594503325, 45.67557343328634])),
name: 'Faggio e frassino maggiore',
description: '
Nome scientifico: FAGUS SYLVATICA
FRAXINUS EXCELSIOR
Circonferenza esemplari media: 365 m
Altezza esemplari media: 20 m
Età presunta esemplari massima: 120-140
'
});
t.setStyle(
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: '#bcd6c1'
}),
radius: 8,
stroke: new ol.style.Stroke({
color: '#000000',
width: 1,
}),
}),
}),
);
iconList.push(t);
style['788'] = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.6)',
}),
radius: 10,
stroke: new ol.style.Stroke({
color: '#ff0',
width: 1,
}),
}),
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
};
// GPX start
var t = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([10.55382, 45.69884])),
name: 'Faggio e Frassino maggiore',
description: '
Nome scientifico: FAGUS SYLVATICA
FRAXINUS EXCELSIOR
Circonferenza esemplari media: 300 cm
Altezza esemplari media: 22 m
Età presunta esemplari massima: 100-120 anni
'
});
t.setStyle(
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: '#bcd6c1'
}),
radius: 8,
stroke: new ol.style.Stroke({
color: '#000000',
width: 1,
}),
}),
}),
);
iconList.push(t);
style['784'] = {
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.6)',
}),
radius: 10,
stroke: new ol.style.Stroke({
color: '#ff0',
width: 1,
}),
}),
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#bcd6c1',
width: 3,
}),
}),
};
// GPX start
var t = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([10.612313992550558, 45.63112609014257])),
name: 'Platano comune',
description: '
Nome scientifico: PLATANUS X ACERIFOLIA
Circonferenza a petto d\'uomo: 472 cm
Altezza misurata: 22 m
Diametro medio chioma: 25,5 m
Età presunta: 140 anni
'
});
t.setStyle(
new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: '#bcd6c1'
}),
radius: 8,
stroke: new ol.style.Stroke({
color: '#000000',
width: 1,
}),
}),
}),
);
iconList.push(t);
var iconLayer = new ol.layer.Vector({
source: new ol.source.Vector({
features: iconList,
}),
});
vectorList_41.push(iconLayer);
// PUNTI end ************************************************************************************
var view = new ol.View({
center: ol.proj.transform([10.600677, 45.648558], 'EPSG:4326', 'EPSG:3857'),
//maxZoom: 18,
zoom: 14
})
var map = new ol.Map({
//controls: ol.control.defaults().extend([new ol.control.FullScreen()]),
target: 'map',
overlays: [overlay],
layers: [
// LAYOUT DELLA CARTINA
new ol.layer.Group({
title: 'Visualizza', // A layer must have a title to appear in the layerswitcher
layers: [
new ol.layer.Group({
title: 'Terreno', // A layer must have a title to appear in the layerswitcher
type: 'base', // Setting the layers type to 'base' results in it having a radio button and only one base layer being visibile at a time
combine: true, // Setting combine to true causes sub-layers to be hidden in the layerswitcher, only the parent is shown
visible: false,
layers: [
new ol.layer.Tile({
source: new ol.source.Stamen({
layer: 'terrain'
})
})
]
}),
new ol.layer.Tile({
title: 'Curve di livello',
type: 'base',
source: new ol.source.XYZ({
attributions: 'Tiles © ArcGIS',
url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}',
}),
}),
new ol.layer.Tile({
title: 'Satellite',
type: 'base',
source: new ol.source.XYZ({
attributions: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}.jpg',
maxZoom: 19,
}),
}),
new ol.layer.Tile({
title: 'Mappa', // A layer must have a title to appear in the layerswitcher
type: 'base', // Again set this layer as a base layer
visible: true,
source: new ol.source.OSM()
}),
]
}),
new ol.layer.Group({
title: 'Alberi monumentali',
fold: 'open', // Adding a 'fold' property set to either 'open' or 'close' makes the group layer collapsible
layers: [
new ol.layer.Group({
title: '
' + feature.get('description') + '
' + hdms + '';
overlay.setPosition(coordinate);
}
});
// POPOUP end ************************************************************************************
// Get out-of-the-map div element with the ID "layers" and renders layers to it.
// NOTE: If the layers are changed outside of the layer switcher then you
// will need to call ol.control.LayerSwitcher.renderPanel again to refesh
// the layer tree. Style the tree via CSS.
var sidebar = new ol.control.Sidebar({
element: 'sidebar',
position: 'left'
});
var toc = document.getElementById('layers');
ol.control.LayerSwitcher.renderPanel(map, toc, { reverse: true });
map.addControl(sidebar);
})();