var map, featureList;
var percorsoIsolaEcologicaSearch = [];
var GiochiSenzaFrontiereSearch = [];
var electroparkMercatoSearch = [];
var fds2016Search = [];
var TuComeMeStopViolenceSearch = [];
var univercity2016Search = [];
var pointOfViewSearch = [];
var MostraFotograficaLaBellaVitaAPreSearch = [];
var AperitivoDiquartiereSearch = [];
var CarnevaleAPreSearch = [];
var FestivalDiFineEstateSearch = [];
var CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataSearch = [];
var MURASearch = [];
var SeminiamoLibertaPerRaccogliereIlFuturoSearch = [];
var MostraImmortalArteAStaglienoSearch = [];
var AnzianoNellombraSearch = [];
var WhatsUpGenovaGiovaniProgettiInFieraSearch = [];
var TUTTI_INSIEME_APPASSIONATAMENTESearch = [];
var CaricaLarteACaricamentoSearch = [];
var RiArtEcoEducationalSearch = [];
var a70UnicefSearch = [];
var bastaunraggiodisoleSearch = [];
var notteBiancaBambiniSearch = [];
var terzoTempoSearch = [];
$(window).resize(function() {
sizeLayerControl();
});
$(document).on("click", ".feature-row", function(e) {
$(document).off("mouseout", ".feature-row", clearHighlight);
sidebarClick(parseInt($(this).attr("id"), 10));
});
if ( !("ontouchstart" in window) ) {
$(document).on("mouseover", ".feature-row", function(e) {
highlight.clearLayers().addLayer(L.circleMarker([$(this).attr("lat"), $(this).attr("lng")], highlightStyle));
});
}
$(document).on("mouseout", ".feature-row", clearHighlight);
$("#about-btn").click(function() {
$("#aboutModal").modal("show");
$(".navbar-collapse.in").collapse("hide");
return false;
});
/*
$("#full-extent-btn").click(function() {
map.fitBounds(singola.getBounds());
$(".navbar-collapse.in").collapse("hide");
return false;
});
*/
$("#legend-btn").click(function() {
$("#legendModal").modal("show");
$(".navbar-collapse.in").collapse("hide");
return false;
});
$("#login-btn").click(function() {
$("#loginModal").modal("show");
$(".navbar-collapse.in").collapse("hide");
return false;
});
$("#list-btn").click(function() {
animateSidebar();
return false;
});
$("#nav-btn").click(function() {
$(".navbar-collapse").collapse("toggle");
return false;
});
$("#sidebar-toggle-btn").click(function() {
animateSidebar();
return false;
});
$("#sidebar-hide-btn").click(function() {
animateSidebar();
return false;
});
function animateSidebar() {
$("#sidebar").animate({
width: "toggle"
}, 350, function() {
map.invalidateSize();
});
}
function sizeLayerControl() {
$(".leaflet-control-layers").css("max-height", $("#map").height() - 50);
}
function clearHighlight() {
highlight.clearLayers();
}
function sidebarClick(id) {
var layer = markerClusters.getLayer(id);
map.setView([layer.getLatLng().lat, layer.getLatLng().lng], 17);
layer.fire("click");
/* Hide sidebar and go to the map on small screens */
if (document.body.clientWidth <= 767) {
$("#sidebar").hide();
map.invalidateSize();
}
}
function syncSidebar() {
/* Empty sidebar features */
$("#feature-list tbody").empty();
/* Loop through theaters layer and add only features which are in the map bounds */
percorsoIsolaEcologica.eachLayer(function (layer) {
if (map.hasLayer(percorsoIsolaEcologicaLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
GiochiSenzaFrontiere.eachLayer(function (layer) {
if (map.hasLayer(GiochiSenzaFrontiereLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
electroparkMercato.eachLayer(function (layer) {
if (map.hasLayer(electroparkMercatoLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
fds2016.eachLayer(function (layer) {
if (map.hasLayer(fds2016Layer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
TuComeMeStopViolence.eachLayer(function (layer) {
if (map.hasLayer(TuComeMeStopViolenceLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
univercity2016.eachLayer(function (layer) {
if (map.hasLayer(univercity2016Layer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
pointOfView.eachLayer(function (layer) {
if (map.hasLayer(pointOfViewLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
MostraFotograficaLaBellaVitaAPre.eachLayer(function (layer) {
if (map.hasLayer(MostraFotograficaLaBellaVitaAPreLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
AperitivoDiquartiere.eachLayer(function (layer) {
if (map.hasLayer(AperitivoDiquartiereLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
CarnevaleAPre.eachLayer(function (layer) {
if (map.hasLayer(CarnevaleAPreLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
FestivalDiFineEstate.eachLayer(function (layer) {
if (map.hasLayer(FestivalDiFineEstateLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata.eachLayer(function (layer) {
if (map.hasLayer(CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
MURA.eachLayer(function (layer) {
if (map.hasLayer(MURALayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
SeminiamoLibertaPerRaccogliereIlFuturo.eachLayer(function (layer) {
if (map.hasLayer(SeminiamoLibertaPerRaccogliereIlFuturoLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
MostraImmortalArteAStaglieno.eachLayer(function (layer) {
if (map.hasLayer(MostraImmortalArteAStaglienoLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
AnzianoNellombra.eachLayer(function (layer) {
if (map.hasLayer(AnzianoNellombraLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
WhatsUpGenovaGiovaniProgettiInFiera.eachLayer(function (layer) {
if (map.hasLayer(WhatsUpGenovaGiovaniProgettiInFieraLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
TUTTI_INSIEME_APPASSIONATAMENTE.eachLayer(function (layer) {
if (map.hasLayer(TUTTI_INSIEME_APPASSIONATAMENTELayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
CaricaLarteACaricamento.eachLayer(function (layer) {
if (map.hasLayer(CaricaLarteACaricamentoLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
RiArtEcoEducational.eachLayer(function (layer) {
if (map.hasLayer(RiArtEcoEducationalLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
a70Unicef.eachLayer(function (layer) {
if (map.hasLayer(a70UnicefLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
bastaunraggiodisole.eachLayer(function (layer) {
if (map.hasLayer(bastaunraggiodisoleLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
notteBiancaBambini.eachLayer(function (layer) {
if (map.hasLayer(notteBiancaBambiniLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Loop through theaters layer and add only features which are in the map bounds */
terzoTempo.eachLayer(function (layer) {
if (map.hasLayer(terzoTempoLayer)) {
if (map.getBounds().contains(layer.getLatLng())) {
var appendString = '
 |
';
appendString +=layer.feature.properties.nome + ' |
|
'
$("#feature-list tbody").append(appendString);
}
}
});
/* Update list.js featureList */
featureList = new List("features", {
valueNames: ["feature-name"]
});
featureList.sort("feature-name", {
order: "asc"
});
}
/* basemap */
var osmBaseMap = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap © CartoDB',
subdomains: 'abcd',
maxZoom: 19
});
/*
var osmBaseMap = L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png", {
maxZoom: 19,
attribution: '© OpenStreetMap contributors'
});
*/
var highlight = L.geoJson(null);
var highlightStyle = {
stroke: false,
fillColor: "#00FFFF",
fillOpacity: 0.7,
radius: 10
};
/* Single marker cluster layer to hold all clusters */
var markerClusters = new L.MarkerClusterGroup({
spiderfyOnMaxZoom: true,
showCoverageOnHover: false,
zoomToBoundsOnClick: true,
disableClusteringAtZoom: 16
});
/* geojson layer configuration */
var percorsoIsolaEcologicaLayer = L.geoJson(null);
var percorsoIsolaEcologica = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/percorsoIsolaEcologica.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
percorsoIsolaEcologicaSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "percorsoIsolaEcologica",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/obiettiviamministrazione/percorsoIsolaEcologica.geojson", function (data) {
percorsoIsolaEcologica.addData(data);
map.addLayer(percorsoIsolaEcologicaLayer);
});
var GiochiSenzaFrontiereLayer = L.geoJson(null);
var GiochiSenzaFrontiere = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/Giochi_senza_Frontiere.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
GiochiSenzaFrontiereSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "GiochiSenzaFrontiere",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/Giochi_senza_Frontiere.geojson", function (data) {
GiochiSenzaFrontiere.addData(data);
map.addLayer(GiochiSenzaFrontiereLayer);
});
var electroparkMercatoLayer = L.geoJson(null);
var electroparkMercato = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/electroparkMercato.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
electroparkMercatoSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "electroparkMercato",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/legalitaediritti/electroparkMercato.geojson", function (data) {
electroparkMercato.addData(data);
map.addLayer(electroparkMercatoLayer);
});
var fds2016Layer = L.geoJson(null);
var fds2016 = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/fds2016.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
fds2016Search.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "fds2016",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/fds2016.geojson", function (data) {
fds2016.addData(data);
map.addLayer(fds2016Layer);
});
var TuComeMeStopViolenceLayer = L.geoJson(null);
var TuComeMeStopViolence = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/TuComeMe_Stop_Violence.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
TuComeMeStopViolenceSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "TuComeMeStopViolence",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/TuComeMe_Stop_Violence.geojson", function (data) {
TuComeMeStopViolence.addData(data);
map.addLayer(TuComeMeStopViolenceLayer);
});
var univercity2016Layer = L.geoJson(null);
var univercity2016 = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/univercity2016.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
univercity2016Search.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "univercity2016",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/univercity2016.geojson", function (data) {
univercity2016.addData(data);
map.addLayer(univercity2016Layer);
});
var pointOfViewLayer = L.geoJson(null);
var pointOfView = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/pointOfView.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
pointOfViewSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "pointOfView",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/pointOfView.geojson", function (data) {
pointOfView.addData(data);
map.addLayer(pointOfViewLayer);
});
var MostraFotograficaLaBellaVitaAPreLayer = L.geoJson(null);
var MostraFotograficaLaBellaVitaAPre = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/MostraFotograficaLaBellaVitaAPre.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
MostraFotograficaLaBellaVitaAPreSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "MostraFotograficaLaBellaVitaAPre",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/curaepresidio/MostraFotograficaLaBellaVitaAPre.geojson", function (data) {
MostraFotograficaLaBellaVitaAPre.addData(data);
map.addLayer(MostraFotograficaLaBellaVitaAPreLayer);
});
var AperitivoDiquartiereLayer = L.geoJson(null);
var AperitivoDiquartiere = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/AperitivoDiquartiere.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
AperitivoDiquartiereSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "AperitivoDiquartiere",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/curaepresidio/AperitivoDiquartiere.geojson", function (data) {
AperitivoDiquartiere.addData(data);
map.addLayer(AperitivoDiquartiereLayer);
});
var CarnevaleAPreLayer = L.geoJson(null);
var CarnevaleAPre = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/CarnevaleAPre.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
CarnevaleAPreSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "CarnevaleAPre",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/CarnevaleAPre.geojson", function (data) {
CarnevaleAPre.addData(data);
map.addLayer(CarnevaleAPreLayer);
});
var FestivalDiFineEstateLayer = L.geoJson(null);
var FestivalDiFineEstate = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/FestivalDiFineEstate.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
FestivalDiFineEstateSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "FestivalDiFineEstate",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/curaepresidio/FestivalDiFineEstate.geojson", function (data) {
FestivalDiFineEstate.addData(data);
map.addLayer(FestivalDiFineEstateLayer);
});
var CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataLayer = L.geoJson(null);
var CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata.geojson", function (data) {
CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata.addData(data);
map.addLayer(CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataLayer);
});
var MURALayer = L.geoJson(null);
var MURA = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/MURA.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
MURASearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "MURA",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/MURA.geojson", function (data) {
MURA.addData(data);
map.addLayer(MURALayer);
});
var SeminiamoLibertaPerRaccogliereIlFuturoLayer = L.geoJson(null);
var SeminiamoLibertaPerRaccogliereIlFuturo = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/SeminiamoLibertaPerRaccogliereIlFuturo.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
SeminiamoLibertaPerRaccogliereIlFuturoSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "SeminiamoLibertaPerRaccogliereIlFuturo",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/SeminiamoLibertaPerRaccogliereIlFuturo.geojson", function (data) {
SeminiamoLibertaPerRaccogliereIlFuturo.addData(data);
map.addLayer(SeminiamoLibertaPerRaccogliereIlFuturoLayer);
});
var MostraImmortalArteAStaglienoLayer = L.geoJson(null);
var MostraImmortalArteAStaglieno = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/MostraImmortalArteAStaglieno.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
MostraImmortalArteAStaglienoSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "MostraImmortalArteAStaglieno",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/MostraImmortalArteAStaglieno.geojson", function (data) {
MostraImmortalArteAStaglieno.addData(data);
map.addLayer(MostraImmortalArteAStaglienoLayer);
});
var AnzianoNellombraLayer = L.geoJson(null);
var AnzianoNellombra = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/AnzianoNellombra.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
AnzianoNellombraSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "AnzianoNellombra",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitasanitarie/AnzianoNellombra.geojson", function (data) {
AnzianoNellombra.addData(data);
map.addLayer(AnzianoNellombraLayer);
});
var WhatsUpGenovaGiovaniProgettiInFieraLayer = L.geoJson(null);
var WhatsUpGenovaGiovaniProgettiInFiera = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/WhatsUpGenovaGiovaniProgettiInFiera.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
WhatsUpGenovaGiovaniProgettiInFieraSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "WhatsUpGenovaGiovaniProgettiInFiera",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/WhatsUpGenovaGiovaniProgettiInFiera.geojson", function (data) {
WhatsUpGenovaGiovaniProgettiInFiera.addData(data);
map.addLayer(WhatsUpGenovaGiovaniProgettiInFieraLayer);
});
var TUTTI_INSIEME_APPASSIONATAMENTELayer = L.geoJson(null);
var TUTTI_INSIEME_APPASSIONATAMENTE = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/TUTTI_INSIEME_APPASSIONATAMENTE.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
TUTTI_INSIEME_APPASSIONATAMENTESearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "TUTTI_INSIEME_APPASSIONATAMENTE",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/legalitaediritti/TUTTI_INSIEME_APPASSIONATAMENTE.geojson", function (data) {
TUTTI_INSIEME_APPASSIONATAMENTE.addData(data);
map.addLayer(TUTTI_INSIEME_APPASSIONATAMENTELayer);
});
var CaricaLarteACaricamentoLayer = L.geoJson(null);
var CaricaLarteACaricamento = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/CaricaLarteACaricamento.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
CaricaLarteACaricamentoSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "CaricaLarteACaricamento",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/CaricaLarteACaricamento.geojson", function (data) {
CaricaLarteACaricamento.addData(data);
map.addLayer(CaricaLarteACaricamentoLayer);
});
var RiArtEcoEducationalLayer = L.geoJson(null);
var RiArtEcoEducational = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/RiArtEcoEducational.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
RiArtEcoEducationalSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "RiArtEcoEducational",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/RiArtEcoEducational.geojson", function (data) {
RiArtEcoEducational.addData(data);
map.addLayer(RiArtEcoEducationalLayer);
});
var a70UnicefLayer = L.geoJson(null);
var a70Unicef = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/a70Unicef.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
a70UnicefSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "a70Unicef",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/a70Unicef.geojson", function (data) {
a70Unicef.addData(data);
map.addLayer(a70UnicefLayer);
});
var bastaunraggiodisoleLayer = L.geoJson(null);
var bastaunraggiodisole = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/bastaunraggiodisole.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
bastaunraggiodisoleSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "bastaunraggiodisole",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/bastaunraggiodisole.geojson", function (data) {
bastaunraggiodisole.addData(data);
map.addLayer(bastaunraggiodisoleLayer);
});
var notteBiancaBambiniLayer = L.geoJson(null);
var notteBiancaBambini = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/notteBiancaBambini.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
notteBiancaBambiniSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "notteBiancaBambini",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/legalitaediritti/notteBiancaBambini.geojson", function (data) {
notteBiancaBambini.addData(data);
map.addLayer(notteBiancaBambiniLayer);
});
var terzoTempoLayer = L.geoJson(null);
var terzoTempo = L.geoJson(null, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {
icon: L.icon({
iconUrl: "assets/img/singola/terzoTempo.png",
iconSize: [24, 28],
iconAnchor: [12, 28],
popupAnchor: [0, -25]
}),
title: feature.properties.nome,
riseOnHover: true
});
},
onEachFeature: function (feature, layer) {
if (feature.properties) {
var image = '
';
if (feature.properties.tipo == 'associazione') {
var imagePath = 'pictures/associazioni/'+feature.properties.immagine;
image = '
';
}
var content = image;
if (feature.properties.tipo == 'soggetto') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Luogo |
" + feature.properties.luogo + " |
";
} else if (feature.properties.tipo == 'associazione') {
content = content + "
| Nome |
" + feature.properties.nome + " |
" + "
| Sede legale |
" + feature.properties.sede_legale + " |
" + "
| Sede operativa |
" + feature.properties.sede_operativa + " |
" + "
| Email |
" + feature.properties.email + " |
" + "
| Facebook |
" + feature.properties.facebook + " |
" + "
| Sito web |
" + feature.properties.sito + " |
";
} else {
content = content + "
| Azione |
" + feature.properties.nome + " |
"+ "
| Soggetto promotore |
" + (('soggetto promotore' in feature.properties) ? feature.properties['soggetto promotore'] : '') + " |
" + "
| Soggetti |
" + feature.properties.soggetti + " |
" + "
| Tipologia |
" + feature.properties.tipologia + " |
" + "
| Luoghi |
" + feature.properties.luoghi + " |
" + "
| Ambito |
" + feature.properties.ambito + " |
";
}
layer.on({
click: function (e) {
$("#feature-title").html(feature.properties.nome);
$("#feature-info").html(content);
$("#featureModal").modal("show");
highlight.clearLayers().addLayer(L.circleMarker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], highlightStyle));
}
});
var appendFeature = '
 |
';
appendFeature+= layer.feature.properties.nome + ' |
|
';
$("#feature-list tbody").append(appendFeature);
terzoTempoSearch.push({
name: layer.feature.properties.nome,
address: layer.feature.properties.luogo,
source: "terzoTempo",
id: L.stamp(layer),
lat: layer.feature.geometry.coordinates[1],
lng: layer.feature.geometry.coordinates[0]
});
}
}
});
$.getJSON("data/singola/attivitaeducative/terzoTempo.geojson", function (data) {
terzoTempo.addData(data);
map.addLayer(terzoTempoLayer);
});
map = L.map("map", {
zoom: 14,
center: [44.4182, 8.9322],
layers: [osmBaseMap, markerClusters, highlight],
zoomControl: false,
attributionControl: false
});
/* Layer control listeners that allow for a single markerClusters layer */
map.on("overlayadd", function(e) {
if (e.layer === percorsoIsolaEcologicaLayer) {
markerClusters.addLayer(percorsoIsolaEcologica);
syncSidebar();
}
if (e.layer === GiochiSenzaFrontiereLayer) {
markerClusters.addLayer(GiochiSenzaFrontiere);
syncSidebar();
}
if (e.layer === electroparkMercatoLayer) {
markerClusters.addLayer(electroparkMercato);
syncSidebar();
}
if (e.layer === fds2016Layer) {
markerClusters.addLayer(fds2016);
syncSidebar();
}
if (e.layer === TuComeMeStopViolenceLayer) {
markerClusters.addLayer(TuComeMeStopViolence);
syncSidebar();
}
if (e.layer === univercity2016Layer) {
markerClusters.addLayer(univercity2016);
syncSidebar();
}
if (e.layer === pointOfViewLayer) {
markerClusters.addLayer(pointOfView);
syncSidebar();
}
if (e.layer === MostraFotograficaLaBellaVitaAPreLayer) {
markerClusters.addLayer(MostraFotograficaLaBellaVitaAPre);
syncSidebar();
}
if (e.layer === AperitivoDiquartiereLayer) {
markerClusters.addLayer(AperitivoDiquartiere);
syncSidebar();
}
if (e.layer === CarnevaleAPreLayer) {
markerClusters.addLayer(CarnevaleAPre);
syncSidebar();
}
if (e.layer === FestivalDiFineEstateLayer) {
markerClusters.addLayer(FestivalDiFineEstate);
syncSidebar();
}
if (e.layer === CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataLayer) {
markerClusters.addLayer(CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata);
syncSidebar();
}
if (e.layer === MURALayer) {
markerClusters.addLayer(MURA);
syncSidebar();
}
if (e.layer === SeminiamoLibertaPerRaccogliereIlFuturoLayer) {
markerClusters.addLayer(SeminiamoLibertaPerRaccogliereIlFuturo);
syncSidebar();
}
if (e.layer === MostraImmortalArteAStaglienoLayer) {
markerClusters.addLayer(MostraImmortalArteAStaglieno);
syncSidebar();
}
if (e.layer === AnzianoNellombraLayer) {
markerClusters.addLayer(AnzianoNellombra);
syncSidebar();
}
if (e.layer === WhatsUpGenovaGiovaniProgettiInFieraLayer) {
markerClusters.addLayer(WhatsUpGenovaGiovaniProgettiInFiera);
syncSidebar();
}
if (e.layer === TUTTI_INSIEME_APPASSIONATAMENTELayer) {
markerClusters.addLayer(TUTTI_INSIEME_APPASSIONATAMENTE);
syncSidebar();
}
if (e.layer === CaricaLarteACaricamentoLayer) {
markerClusters.addLayer(CaricaLarteACaricamento);
syncSidebar();
}
if (e.layer === RiArtEcoEducationalLayer) {
markerClusters.addLayer(RiArtEcoEducational);
syncSidebar();
}
if (e.layer === a70UnicefLayer) {
markerClusters.addLayer(a70Unicef);
syncSidebar();
}
if (e.layer === bastaunraggiodisoleLayer) {
markerClusters.addLayer(bastaunraggiodisole);
syncSidebar();
}
if (e.layer === notteBiancaBambiniLayer) {
markerClusters.addLayer(notteBiancaBambini);
syncSidebar();
}
if (e.layer === terzoTempoLayer) {
markerClusters.addLayer(terzoTempo);
syncSidebar();
}
});
map.on("overlayremove", function(e) {
if (e.layer === percorsoIsolaEcologicaLayer) {
markerClusters.removeLayer(percorsoIsolaEcologica);
syncSidebar();
}
if (e.layer === GiochiSenzaFrontiereLayer) {
markerClusters.removeLayer(GiochiSenzaFrontiere);
syncSidebar();
}
if (e.layer === electroparkMercatoLayer) {
markerClusters.removeLayer(electroparkMercato);
syncSidebar();
}
if (e.layer === fds2016Layer) {
markerClusters.removeLayer(fds2016);
syncSidebar();
}
if (e.layer === TuComeMeStopViolenceLayer) {
markerClusters.removeLayer(TuComeMeStopViolence);
syncSidebar();
}
if (e.layer === univercity2016Layer) {
markerClusters.removeLayer(univercity2016);
syncSidebar();
}
if (e.layer === pointOfViewLayer) {
markerClusters.removeLayer(pointOfView);
syncSidebar();
}
if (e.layer === MostraFotograficaLaBellaVitaAPreLayer) {
markerClusters.removeLayer(MostraFotograficaLaBellaVitaAPre);
syncSidebar();
}
if (e.layer === AperitivoDiquartiereLayer) {
markerClusters.removeLayer(AperitivoDiquartiere);
syncSidebar();
}
if (e.layer === CarnevaleAPreLayer) {
markerClusters.removeLayer(CarnevaleAPre);
syncSidebar();
}
if (e.layer === FestivalDiFineEstateLayer) {
markerClusters.removeLayer(FestivalDiFineEstate);
syncSidebar();
}
if (e.layer === CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataLayer) {
markerClusters.removeLayer(CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata);
syncSidebar();
}
if (e.layer === MURALayer) {
markerClusters.removeLayer(MURA);
syncSidebar();
}
if (e.layer === SeminiamoLibertaPerRaccogliereIlFuturoLayer) {
markerClusters.removeLayer(SeminiamoLibertaPerRaccogliereIlFuturo);
syncSidebar();
}
if (e.layer === MostraImmortalArteAStaglienoLayer) {
markerClusters.removeLayer(MostraImmortalArteAStaglieno);
syncSidebar();
}
if (e.layer === AnzianoNellombraLayer) {
markerClusters.removeLayer(AnzianoNellombra);
syncSidebar();
}
if (e.layer === WhatsUpGenovaGiovaniProgettiInFieraLayer) {
markerClusters.removeLayer(WhatsUpGenovaGiovaniProgettiInFiera);
syncSidebar();
}
if (e.layer === TUTTI_INSIEME_APPASSIONATAMENTELayer) {
markerClusters.removeLayer(TUTTI_INSIEME_APPASSIONATAMENTE);
syncSidebar();
}
if (e.layer === CaricaLarteACaricamentoLayer) {
markerClusters.removeLayer(CaricaLarteACaricamento);
syncSidebar();
}
if (e.layer === RiArtEcoEducationalLayer) {
markerClusters.removeLayer(RiArtEcoEducational);
syncSidebar();
}
if (e.layer === a70UnicefLayer) {
markerClusters.removeLayer(a70Unicef);
syncSidebar();
}
if (e.layer === bastaunraggiodisoleLayer) {
markerClusters.removeLayer(bastaunraggiodisole);
syncSidebar();
}
if (e.layer === notteBiancaBambiniLayer) {
markerClusters.removeLayer(notteBiancaBambini);
syncSidebar();
}
if (e.layer === terzoTempoLayer) {
markerClusters.removeLayer(terzoTempo);
syncSidebar();
}
});
/* Filter sidebar feature list to only show features in current map bounds */
map.on("moveend", function (e) {
syncSidebar();
});
/* Clear feature highlight when map is clicked */
map.on("click", function(e) {
highlight.clearLayers();
});
/* Attribution control */
function updateAttribution(e) {
$.each(map._layers, function(index, layer) {
if (layer.getAttribution) {
$("#attribution").html((layer.getAttribution()));
}
});
}
map.on("layeradd", updateAttribution);
map.on("layerremove", updateAttribution);
var attributionControl = L.control({
position: "bottomright"
});
attributionControl.onAdd = function (map) {
var div = L.DomUtil.create("div", "leaflet-control-attribution");
div.innerHTML = "Developed by bryanmcbride.com | Attribution";
return div;
};
map.addControl(attributionControl);
/*
var zoomControl = L.control.zoom({
position: "bottomright"
}).addTo(map);
*/
var zoomHome = L.Control.zoomHome({position: 'bottomright'});
zoomHome.addTo(map);
/* GPS enabled geolocation control set to follow the user's location */
var locateControl = L.control.locate({
position: "bottomright",
drawCircle: true,
follow: true,
setView: true,
keepCurrentZoomLevel: true,
markerStyle: {
weight: 1,
opacity: 0.8,
fillOpacity: 0.8
},
circleStyle: {
weight: 1,
clickable: false
},
icon: "fa fa-location-arrow",
metric: false,
strings: {
title: "La mia posizione",
popup: "Sei entro {distance} {unit} da questo punto",
outsideMapBoundsMsg: "Sembri posizionato al di fuori dei confini della mappa"
},
locateOptions: {
maxZoom: 18,
watch: true,
enableHighAccuracy: true,
maximumAge: 10000,
timeout: 10000
}
}).addTo(map);
/* Larger screens get expanded layer control and visible sidebar */
if (document.body.clientWidth <= 767) {
var isCollapsed = true;
} else {
var isCollapsed = false;
}
var baseLayers = {
"Mappa": osmBaseMap
};
var groupedOverlays = {
"Cura e presidio del territorio": {
"
Mostra fotografica La Bella Vita a Prè": MostraFotograficaLaBellaVitaAPreLayer,
"
Aperitivo di Quartiere": AperitivoDiquartiereLayer,
"
Festival di fine estate": FestivalDiFineEstateLayer,
},
"Attività di formazione": {
},
"Attività di promozione della legalità e dei diritti": {
"
Electropark al Mercato": electroparkMercatoLayer,
"
Tutti insieme appassionatamente - Storie Quotidiane di Normale Disabilità": TUTTI_INSIEME_APPASSIONATAMENTELayer,
"
Notte bianca dei Bambini": notteBiancaBambiniLayer,
},
"Condivisione con amministrazione degli obiettivi e ricerca delle soluzioni": {
"
Percorso partecipativo Isola Ecologica": percorsoIsolaEcologicaLayer,
},
"Attività culturali": {
},
"Attività sanitarie e/o socio-assistenziali": {
"
Anziano nell'ombra": AnzianoNellombraLayer,
},
"Attività educative, formative, artistiche": {
"
Giochi senza Frontiere": GiochiSenzaFrontiereLayer,
"
Festival della Scienza 2016": fds2016Layer,
"
TuComeMe Stop Violence": TuComeMeStopViolenceLayer,
"
Univercity 2016": univercity2016Layer,
"
Point Of View": pointOfViewLayer,
"
Carnevale a Prè": CarnevaleAPreLayer,
"
Carruggi e Lanterne sagra dell'acciuga fritta e della farinata": CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataLayer,
"
M.U.R.A.": MURALayer,
"
Seminiamo libertà per raccogliere il futuro": SeminiamoLibertaPerRaccogliereIlFuturoLayer,
"
Mostra ImmortalArte a Staglieno": MostraImmortalArteAStaglienoLayer,
"
What's Up Genova: giovani progetti in fiera": WhatsUpGenovaGiovaniProgettiInFieraLayer,
"
Carica l'arte a Caricamento": CaricaLarteACaricamentoLayer,
"
RiArtEco Educational": RiArtEcoEducationalLayer,
"
70esimo anniversario UNICEF": a70UnicefLayer,
"
Festival della Scienza 2016 -basta un raggio di sole": bastaunraggiodisoleLayer,
"
Terzo Tempo solidarietà e socialità nello sport": terzoTempoLayer,
},
};
L.Control.GroupedLayers.include({
addOverlays: function () {
for (var i in this._layers) {
if (this._layers[i].overlay) {
if (!this._map.hasLayer(this._layers[i].layer)) {
this._map.addLayer(this._layers[i].layer);
}
}
}
},
removeOverlays: function () {
for (var i in this._layers) {
if (this._layers[i].overlay) {
if (this._map.hasLayer(this._layers[i].layer)) {
this._map.removeLayer(this._layers[i].layer);
}
}
}
}
});
var layerControl = L.control.groupedLayers(baseLayers, groupedOverlays, {
collapsed: isCollapsed
}).addTo(map);
/* Highlight search box text on click */
$("#searchbox").click(function () {
$(this).select();
});
/* Prevent hitting enter from refreshing the page */
$("#searchbox").keypress(function (e) {
if (e.which == 13) {
e.preventDefault();
}
});
$("#featureModal").on("hidden.bs.modal", function (e) {
$(document).on("mouseout", ".feature-row", clearHighlight);
});
/* Typeahead search functionality */
$(document).one("ajaxStop", function () {
$("#loading").hide();
sizeLayerControl();
/* Fit map to main layer bounds */
/*map.fitBounds(singola.getBounds());*/
featureList = new List("features", {valueNames: ["feature-name"]});
featureList.sort("feature-name", {order:"asc"});
var percorsoIsolaEcologicaBH = new Bloodhound({
name: "percorsoIsolaEcologica",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: percorsoIsolaEcologicaSearch,
limit: 10
});
percorsoIsolaEcologicaBH.initialize();
var GiochiSenzaFrontiereBH = new Bloodhound({
name: "GiochiSenzaFrontiere",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: GiochiSenzaFrontiereSearch,
limit: 10
});
GiochiSenzaFrontiereBH.initialize();
var electroparkMercatoBH = new Bloodhound({
name: "electroparkMercato",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: electroparkMercatoSearch,
limit: 10
});
electroparkMercatoBH.initialize();
var fds2016BH = new Bloodhound({
name: "fds2016",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: fds2016Search,
limit: 10
});
fds2016BH.initialize();
var TuComeMeStopViolenceBH = new Bloodhound({
name: "TuComeMeStopViolence",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: TuComeMeStopViolenceSearch,
limit: 10
});
TuComeMeStopViolenceBH.initialize();
var univercity2016BH = new Bloodhound({
name: "univercity2016",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: univercity2016Search,
limit: 10
});
univercity2016BH.initialize();
var pointOfViewBH = new Bloodhound({
name: "pointOfView",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: pointOfViewSearch,
limit: 10
});
pointOfViewBH.initialize();
var MostraFotograficaLaBellaVitaAPreBH = new Bloodhound({
name: "MostraFotograficaLaBellaVitaAPre",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: MostraFotograficaLaBellaVitaAPreSearch,
limit: 10
});
MostraFotograficaLaBellaVitaAPreBH.initialize();
var AperitivoDiquartiereBH = new Bloodhound({
name: "AperitivoDiquartiere",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: AperitivoDiquartiereSearch,
limit: 10
});
AperitivoDiquartiereBH.initialize();
var CarnevaleAPreBH = new Bloodhound({
name: "CarnevaleAPre",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: CarnevaleAPreSearch,
limit: 10
});
CarnevaleAPreBH.initialize();
var FestivalDiFineEstateBH = new Bloodhound({
name: "FestivalDiFineEstate",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: FestivalDiFineEstateSearch,
limit: 10
});
FestivalDiFineEstateBH.initialize();
var CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataBH = new Bloodhound({
name: "CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataSearch,
limit: 10
});
CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataBH.initialize();
var MURABH = new Bloodhound({
name: "MURA",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: MURASearch,
limit: 10
});
MURABH.initialize();
var SeminiamoLibertaPerRaccogliereIlFuturoBH = new Bloodhound({
name: "SeminiamoLibertaPerRaccogliereIlFuturo",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: SeminiamoLibertaPerRaccogliereIlFuturoSearch,
limit: 10
});
SeminiamoLibertaPerRaccogliereIlFuturoBH.initialize();
var MostraImmortalArteAStaglienoBH = new Bloodhound({
name: "MostraImmortalArteAStaglieno",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: MostraImmortalArteAStaglienoSearch,
limit: 10
});
MostraImmortalArteAStaglienoBH.initialize();
var AnzianoNellombraBH = new Bloodhound({
name: "AnzianoNellombra",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: AnzianoNellombraSearch,
limit: 10
});
AnzianoNellombraBH.initialize();
var WhatsUpGenovaGiovaniProgettiInFieraBH = new Bloodhound({
name: "WhatsUpGenovaGiovaniProgettiInFiera",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: WhatsUpGenovaGiovaniProgettiInFieraSearch,
limit: 10
});
WhatsUpGenovaGiovaniProgettiInFieraBH.initialize();
var TUTTI_INSIEME_APPASSIONATAMENTEBH = new Bloodhound({
name: "TUTTI_INSIEME_APPASSIONATAMENTE",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: TUTTI_INSIEME_APPASSIONATAMENTESearch,
limit: 10
});
TUTTI_INSIEME_APPASSIONATAMENTEBH.initialize();
var CaricaLarteACaricamentoBH = new Bloodhound({
name: "CaricaLarteACaricamento",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: CaricaLarteACaricamentoSearch,
limit: 10
});
CaricaLarteACaricamentoBH.initialize();
var RiArtEcoEducationalBH = new Bloodhound({
name: "RiArtEcoEducational",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: RiArtEcoEducationalSearch,
limit: 10
});
RiArtEcoEducationalBH.initialize();
var a70UnicefBH = new Bloodhound({
name: "a70Unicef",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: a70UnicefSearch,
limit: 10
});
a70UnicefBH.initialize();
var bastaunraggiodisoleBH = new Bloodhound({
name: "bastaunraggiodisole",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: bastaunraggiodisoleSearch,
limit: 10
});
bastaunraggiodisoleBH.initialize();
var notteBiancaBambiniBH = new Bloodhound({
name: "notteBiancaBambini",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: notteBiancaBambiniSearch,
limit: 10
});
notteBiancaBambiniBH.initialize();
var terzoTempoBH = new Bloodhound({
name: "terzoTempo",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.name);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: terzoTempoSearch,
limit: 10
});
terzoTempoBH.initialize();
/* instantiate the typeahead UI */
$("#searchbox").typeahead({
minLength: 3,
highlight: true,
hint: false
}, {
name: "percorsoIsolaEcologica",
displayKey: "name",
source: percorsoIsolaEcologicaBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "GiochiSenzaFrontiere",
displayKey: "name",
source: GiochiSenzaFrontiereBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "electroparkMercato",
displayKey: "name",
source: electroparkMercatoBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "fds2016",
displayKey: "name",
source: fds2016BH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "TuComeMeStopViolence",
displayKey: "name",
source: TuComeMeStopViolenceBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "univercity2016",
displayKey: "name",
source: univercity2016BH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "pointOfView",
displayKey: "name",
source: pointOfViewBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "MostraFotograficaLaBellaVitaAPre",
displayKey: "name",
source: MostraFotograficaLaBellaVitaAPreBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "AperitivoDiquartiere",
displayKey: "name",
source: AperitivoDiquartiereBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "CarnevaleAPre",
displayKey: "name",
source: CarnevaleAPreBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "FestivalDiFineEstate",
displayKey: "name",
source: FestivalDiFineEstateBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata",
displayKey: "name",
source: CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "MURA",
displayKey: "name",
source: MURABH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "SeminiamoLibertaPerRaccogliereIlFuturo",
displayKey: "name",
source: SeminiamoLibertaPerRaccogliereIlFuturoBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "MostraImmortalArteAStaglieno",
displayKey: "name",
source: MostraImmortalArteAStaglienoBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "AnzianoNellombra",
displayKey: "name",
source: AnzianoNellombraBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "WhatsUpGenovaGiovaniProgettiInFiera",
displayKey: "name",
source: WhatsUpGenovaGiovaniProgettiInFieraBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "TUTTI_INSIEME_APPASSIONATAMENTE",
displayKey: "name",
source: TUTTI_INSIEME_APPASSIONATAMENTEBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "CaricaLarteACaricamento",
displayKey: "name",
source: CaricaLarteACaricamentoBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "RiArtEcoEducational",
displayKey: "name",
source: RiArtEcoEducationalBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "a70Unicef",
displayKey: "name",
source: a70UnicefBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "bastaunraggiodisole",
displayKey: "name",
source: bastaunraggiodisoleBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "notteBiancaBambini",
displayKey: "name",
source: notteBiancaBambiniBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}, {
name: "terzoTempo",
displayKey: "name",
source: terzoTempoBH.ttAdapter(),
templates: {
header: "",
suggestion: Handlebars.compile(["{{name}}
{{address}}"].join(""))
}
}).on("typeahead:selected", function (obj, datum) {
if (datum.source === "percorsoIsolaEcologica") {
if (!map.hasLayer(percorsoIsolaEcologicaLayer)) {
map.addLayer(percorsoIsolaEcologicaLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "GiochiSenzaFrontiere") {
if (!map.hasLayer(GiochiSenzaFrontiereLayer)) {
map.addLayer(GiochiSenzaFrontiereLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "electroparkMercato") {
if (!map.hasLayer(electroparkMercatoLayer)) {
map.addLayer(electroparkMercatoLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "fds2016") {
if (!map.hasLayer(fds2016Layer)) {
map.addLayer(fds2016Layer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "TuComeMeStopViolence") {
if (!map.hasLayer(TuComeMeStopViolenceLayer)) {
map.addLayer(TuComeMeStopViolenceLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "univercity2016") {
if (!map.hasLayer(univercity2016Layer)) {
map.addLayer(univercity2016Layer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "pointOfView") {
if (!map.hasLayer(pointOfViewLayer)) {
map.addLayer(pointOfViewLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "MostraFotograficaLaBellaVitaAPre") {
if (!map.hasLayer(MostraFotograficaLaBellaVitaAPreLayer)) {
map.addLayer(MostraFotograficaLaBellaVitaAPreLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "AperitivoDiquartiere") {
if (!map.hasLayer(AperitivoDiquartiereLayer)) {
map.addLayer(AperitivoDiquartiereLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "CarnevaleAPre") {
if (!map.hasLayer(CarnevaleAPreLayer)) {
map.addLayer(CarnevaleAPreLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "FestivalDiFineEstate") {
if (!map.hasLayer(FestivalDiFineEstateLayer)) {
map.addLayer(FestivalDiFineEstateLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinata") {
if (!map.hasLayer(CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataLayer)) {
map.addLayer(CarruggiELanterneSagraDeAcciugaFrittaEDellaFarinataLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "MURA") {
if (!map.hasLayer(MURALayer)) {
map.addLayer(MURALayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "SeminiamoLibertaPerRaccogliereIlFuturo") {
if (!map.hasLayer(SeminiamoLibertaPerRaccogliereIlFuturoLayer)) {
map.addLayer(SeminiamoLibertaPerRaccogliereIlFuturoLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "MostraImmortalArteAStaglieno") {
if (!map.hasLayer(MostraImmortalArteAStaglienoLayer)) {
map.addLayer(MostraImmortalArteAStaglienoLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "AnzianoNellombra") {
if (!map.hasLayer(AnzianoNellombraLayer)) {
map.addLayer(AnzianoNellombraLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "WhatsUpGenovaGiovaniProgettiInFiera") {
if (!map.hasLayer(WhatsUpGenovaGiovaniProgettiInFieraLayer)) {
map.addLayer(WhatsUpGenovaGiovaniProgettiInFieraLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "TUTTI_INSIEME_APPASSIONATAMENTE") {
if (!map.hasLayer(TUTTI_INSIEME_APPASSIONATAMENTELayer)) {
map.addLayer(TUTTI_INSIEME_APPASSIONATAMENTELayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "CaricaLarteACaricamento") {
if (!map.hasLayer(CaricaLarteACaricamentoLayer)) {
map.addLayer(CaricaLarteACaricamentoLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "RiArtEcoEducational") {
if (!map.hasLayer(RiArtEcoEducationalLayer)) {
map.addLayer(RiArtEcoEducationalLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "a70Unicef") {
if (!map.hasLayer(a70UnicefLayer)) {
map.addLayer(a70UnicefLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "bastaunraggiodisole") {
if (!map.hasLayer(bastaunraggiodisoleLayer)) {
map.addLayer(bastaunraggiodisoleLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "notteBiancaBambini") {
if (!map.hasLayer(notteBiancaBambiniLayer)) {
map.addLayer(notteBiancaBambiniLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
if (datum.source === "terzoTempo") {
if (!map.hasLayer(terzoTempoLayer)) {
map.addLayer(terzoTempoLayer);
}
map.setView([datum.lat, datum.lng], 17);
if (map._layers[datum.id]) {
map._layers[datum.id].fire("click");
}
}
}).on("typeahead:opened", function () {
$(".navbar-collapse.in").css("max-height", $(document).height() - $(".navbar-header").height());
$(".navbar-collapse.in").css("height", $(document).height() - $(".navbar-header").height());
}).on("typeahead:closed", function () {
$(".navbar-collapse.in").css("max-height", "");
$(".navbar-collapse.in").css("height", "");
});
$(".twitter-typeahead").css("position", "static");
$(".twitter-typeahead").css("display", "block");
});
// Leaflet patch to make layer control scrollable on touch browsers
var container = $(".leaflet-control-layers")[0];
if (!L.Browser.touch) {
L.DomEvent
.disableClickPropagation(container)
.disableScrollPropagation(container);
} else {
L.DomEvent.disableClickPropagation(container);
}