(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_a = []; var iconList = []; style['689'] = { 'LineString': new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'red', width: 3, }), }), 'MultiLineString': new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'red', width: 3, }), }), }; // GPX start var vectorgpx = new ol.layer.Vector({ name: 'Archesane - Spino - Ververs', description: ' ', source: new ol.source.Vector({ url: ['/files/gpx/archesane.gpx'], radius: 0, format: new ol.format.GPX() }), style: function (feature) { return style['689'][feature.getGeometry().getType()]; }, }); vectorList_a.push(vectorgpx); var iconLayer = new ol.layer.Vector({ source: new ol.source.Vector({ features: iconList, }), }); vectorList_a.push(iconLayer); var vectorList_20 = []; var iconList = []; style['673'] = { '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: '#914f15', width: 3, }), }), 'MultiLineString': new ol.style.Style({ stroke: new ol.style.Stroke({ color: '#914f15', width: 3, }), }), }; // GPX start var t = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat([10.590972039361224, 45.67376762402138])), name: 'Bivacco “Due Aceri”', description: 'Situato poco sotto la vetta del mponte Pizzocolo, vi si gode una splendida vista panoramica. Poco sopra c\'è una cappellina, sempre aperta (nella quale si celebra la S. Messa la terza domenica di giugno) e sulla vetta una croce e un’asta con tubicini attraverso i quali è possibile inquadrare e riconoscere alcune montagne. 

Costruito sui ruderi di una costruzione militare risalente alla Prima guerra mondiale, il bivacco è formato da un solo locale con un camino, due tavoloni con relative panche e una cassetta di pronto soccorso. Una scala a pioli conduce ad un soppalco ove è possibile sostare la notte. ' }); t.setStyle( new ol.style.Style({ image: new ol.style.Circle({ fill: new ol.style.Fill({ color: '#914f15' }), 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_20.push(iconLayer); var vectorList_19 = []; var iconList = []; style['669'] = { '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: '#159181', width: 3, }), }), 'MultiLineString': new ol.style.Style({ stroke: new ol.style.Stroke({ color: '#159181', width: 3, }), }), }; // GPX start var t = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat([10.560180804632, 45.697801215542])), name: 'Campèi de Sima', description: '

Il Rifugio Sezionale si trova a Campiglio di Cima (Campèi de Sìma), località del Comune di Toscolano Maderno, all’interno del Parco Naturalistico Alto Garda Bresciano, ad un\'altezza di 1.017 metri. Più che di un rifugio si tratta di un vero e proprio “borgo alpino”, composto da tre fabbricati e da una chiesetta intitolata alla Madonna della Neve. La ristrutturazione terminata nel 2000, frutto della sinergia tra ERSAF (proprietario dei fabbricati) e A.N.A., ha permesso nel giro di cinque anni di rendere fruibile il complesso delle malghe di Campiglio di Cima.' }); t.setStyle( new ol.style.Style({ image: new ol.style.Circle({ fill: new ol.style.Fill({ color: '#159181' }), radius: 8, stroke: new ol.style.Stroke({ color: '#000000', width: 1, }), }), }), ); iconList.push(t); style['671'] = { '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: '#159181', width: 3, }), }), 'MultiLineString': new ol.style.Style({ stroke: new ol.style.Stroke({ color: '#159181', width: 3, }), }), }; // GPX start var t = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat([10.556957635784, 45.678020597491])), name: 'Rifugio \"Pirlo\" allo Spino', description: '

Rifugio di proprietà del Cai Salò, è aperto dalla primavera all\'autunno e nei fine settimana del restante periodo dell\'anno; è base di gite interessanti come il Pizzocolo (un\'ora e mezza di cammino) e il Monte Spino (meno di un\'ora). Ottimo punto di ristoro e di pernottamento e base di appoggio per coloro che vogliono cimentarsi sulle adiacenti ferrate attrezzate. Il Rifugio GIORGIO PIRLO allo SPINO 1165m sorge ai piedi dei monti Spino e Pizzocolo, punto nodale per coloro che effettuano giri in MTB oppure per escursionisti. Dotato di 2 grandi camerate per gruppi (40 posti letto) con servizi ed un ottimo ristorante. Possibilità di utilizzo della sala principale per incontri di gruppo. Facilmente raggiungibile da Toscolano Maderno e da Gaino. Rifugio a quota 1185 sul Monte Spino, eretto su un precedente casamento della Guardia di Finanza ed intitolato al tenente medico Giorgio Pirlo, caduto nella Seconda guerra mondiale.' }); t.setStyle( new ol.style.Style({ image: new ol.style.Circle({ fill: new ol.style.Fill({ color: '#159181' }), 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_19.push(iconLayer); var vectorList_41 = []; var iconList = []; 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); var iconLayer = new ol.layer.Vector({ source: new ol.source.Vector({ features: iconList, }), }); vectorList_41.push(iconLayer); var vectorList_22 = []; var iconList = []; style['670'] = { '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: '#5a6360', width: 3, }), }), 'MultiLineString': new ol.style.Style({ stroke: new ol.style.Stroke({ color: '#5a6360', width: 3, }), }), }; // GPX start var t = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat([10.584539139646, 45.671028637753])), name: 'Malga Valle', description: '

Piccola malga vicino alla sommità del monte Pizzocolo ' }); t.setStyle( new ol.style.Style({ image: new ol.style.Circle({ fill: new ol.style.Fill({ color: '#5a6360' }), 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_22.push(iconLayer); var vectorList_30 = []; var iconList = []; style['768'] = { '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: '#7e97b6', width: 3, }), }), 'MultiLineString': new ol.style.Style({ stroke: new ol.style.Stroke({ color: '#7e97b6', width: 3, }), }), }; // GPX start var t = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat([10.563368414453006, 45.67185539898287])), name: 'Marmere', description: 'Dal rifugio Pirlo allo Spino (1160 m) si prende il comodo sentiero che con alcuni saliscendi percorre a mezzacosta il versante sud-ovest di Monte Spino, supera il canale che scende dal Buco del Gatto e continua verso il Passo del Buco del Tedesco. Da qui vi sono molte vie, alcune particolarmente impegnative ed esposte, che offrono sicure emozioni.' }); t.setStyle( new ol.style.Style({ image: new ol.style.Circle({ fill: new ol.style.Fill({ color: '#7e97b6' }), 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_30.push(iconLayer); var vectorList_31 = []; var iconList = []; style['765'] = { '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: '#102a47', width: 3, }), }), 'MultiLineString': new ol.style.Style({ stroke: new ol.style.Stroke({ color: '#102a47', width: 3, }), }), }; // GPX start var t = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat([10.591356732838612, 45.6740794252752])), name: 'Punto di lancio parapendio', description: 'Ampia prateria situata sul sentiero che conduce alla cima del Pizzocolo. Ideale punto di partenza per voli in parapendio. ' }); t.setStyle( new ol.style.Style({ image: new ol.style.Circle({ fill: new ol.style.Fill({ color: '#102a47' }), 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_31.push(iconLayer); var vectorList_21 = []; var iconList = []; style['502'] = { '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: '#9ea752', width: 3, }), }), 'MultiLineString': new ol.style.Style({ stroke: new ol.style.Stroke({ color: '#9ea752', width: 3, }), }), }; // GPX start var t = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat([10.570558909885, 45.657259340254])), name: 'Sant’Urbano', description: '

Tettoia in cemento con caminetto e punto bivacco.' }); t.setStyle( new ol.style.Style({ image: new ol.style.Circle({ fill: new ol.style.Fill({ color: '#9ea752' }), 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_21.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: 'Archesane - Spino - Ververs', fold: 'open', // Adding a 'fold' property set to either 'open' or 'close' makes the group layer collapsible layers: [ new ol.layer.Group({ title: '
Altro', layers: vectorList_a }), new ol.layer.Group({ title: '
BIVACCO', layers: vectorList_20 }), new ol.layer.Group({ title: '
RIFUGIO', layers: vectorList_19 }), new ol.layer.Group({ title: '
ALBERI MONUMENTALI', layers: vectorList_41 }), new ol.layer.Group({ title: '
MALGA', layers: vectorList_22 }), new ol.layer.Group({ title: '
CLIMBING', layers: vectorList_30 }), new ol.layer.Group({ title: '
PARAGLIDING', layers: vectorList_31 }), new ol.layer.Group({ title: '
TETTOIA', layers: vectorList_21 }), ] }), ], view: view, }); // GEOLOCALIZZAZIONE start ************************************************************************************ var geolocation = new ol.Geolocation({ // enableHighAccuracy must be set to true to have the heading value. trackingOptions: { enableHighAccuracy: true, }, projection: view.getProjection(), }); function el(id) { return document.getElementById(id); } el('track').addEventListener('change', function () { geolocation.setTracking(this.checked); }); geolocation.on('change', function () { el('accuracy').innerText = geolocation.getAccuracy() + ' [m]'; el('altitude').innerText = geolocation.getAltitude() + ' [m]'; el('altitudeAccuracy').innerText = geolocation.getAltitudeAccuracy() + ' [m]'; el('heading').innerText = geolocation.getHeading() + ' [rad]'; el('speed').innerText = geolocation.getSpeed() + ' [m/s]'; el('position').innerText = geolocation.getPosition(); }); // handle geolocation error. geolocation.on('error', function (error) { var info = document.getElementById('info-track'); info.innerHTML = error.message; info.style.display = ''; }); var accuracyFeature = new ol.Feature(); geolocation.on('change:accuracyGeometry', function () { accuracyFeature.setGeometry(geolocation.getAccuracyGeometry()); map.getView().animate({ center: geolocation.getPosition() }, { duration: 750 }); }); var positionFeature = new ol.Feature(); positionFeature.setStyle( new ol.style.Style({ image: new ol.style.Circle({ radius: 6, fill: new ol.style.Fill({ color: '#3399CC', }), stroke: new ol.style.Stroke({ color: '#fff', width: 2, }), }), }) ); // geolocation.on('change:position', function () { geolocation.on('change', function () { var coordinates = geolocation.getPosition(); positionFeature.setGeometry(coordinates ? new ol.geom.Point(coordinates) : null); }); new ol.layer.Vector({ map: map, source: new ol.source.Vector({ features: [accuracyFeature, positionFeature], }), }); // GEOLOCALIZZAZIONE end ************************************************************************************ // LINK To POINT start ************************************************************************************ // LINK To POINT end ************************************************************************************ // POPOUP start ************************************************************************************ var element = document.getElementById('popup'); var popup = new ol.Overlay({ element: element, positioning: 'bottom-center', stopEvent: false, offset: [0, 0], }); map.addOverlay(popup); map.on('singleclick', function (evt) { $(element).popover('dispose'); var feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) { return feature; }); if (feature) { var coordinate = evt.coordinate; var hdms = ol.coordinate.toStringHDMS(ol.proj.toLonLat(coordinate)); content.innerHTML = '

' + feature.get('name') + '

' + 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); })();