'+response.data[i].name+'
'; testoPopup += 'Dettaglio'; polyline50.bindPopup(testoPopup); bounds.extend(latlngs50); } trackcat_50.addTo(map); map.fitBounds(bounds); } }); if(Object.keys(bounds).length>0) { map.fitBounds(bounds); } map.on('overlayadd', function(e) { var catid = e.layer.options.catid; var resource = e.layer.options.resource; if(eval(resource+"cat_"+catid).getLayers().length==0) { $('#cont_mappa').append(''+response.data[i].name+'
'; testoPopup += 'Dettaglio'; polyline.bindPopup(testoPopup); bounds.extend(latlngs); } else if(resource=='tour') { var latlngs = response.data[i].pathArray; var polyline = L.polyline(latlngs, {color: response.data[i].category_color, weight: response.data[i].category_stroke}).addTo(eval('tourcat_'+response.data[i].cat_id)); var stroke = response.data[i].category_stroke; var color = response.data[i].category_color; polyline.on('mouseover', function() { this.setStyle({ weight:stroke*2, color:'#FF005E' }); }); polyline.on('mouseout', function() { this.setStyle({weight:stroke, color:color}) }); var testoPopup = ''; testoPopup += ''+response.data[i].name+'
'; testoPopup += 'Dettaglio'; polyline.bindPopup(testoPopup); bounds.extend(latlngs); } else { if(response.data[i].category_icon) { var catIcon = L.icon({ iconUrl: response.data[i].category_icon, iconSize: [30, 30], }); } else { var catIcon = L.icon({ iconUrl: 'https://unpkg.com/leaflet@1.7.1/dist/images/marker-icon-2x.png', iconSize: [30, 30], }); } var testoPopup = ''+response.data[i].name+'
'; testoPopup += 'Dettaglio'; eval('markersLayer_'+catid).addLayer(L.marker([response.data[i].latitude, response.data[i].longitude], {icon: catIcon}).bindPopup(testoPopup)); eval( resource+"cat_"+response.data[i].cat_id).addLayer(eval('markersLayer_'+catid)); bounds.extend([response.data[i].latitude, response.data[i].longitude]); } } $('#overlay_'+catid).remove(); eval(resource+"cat_"+catid).addTo(map); map.fitBounds(bounds); } }); } } }); L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap', subdomains: ['a','b','c'] }).addTo( map ); });BICICLETTA
Clicca sulla tracciaper visualizzare l’itinerario
© ItinerAria S.r.l. | via al Castello, 8, 13883, Roppolo (BI) | C.F e P.IVA 02343150021 | Capitale Sociale 10.000,00 € Interamente Versato | Iscritta al registro delle imprese Monte Rosa Laghi Piemonte al n. REA BI – 187007