function _displayMapRead (divtarget) {
divtarget = typeof divtarget !== 'undefined' ? divtarget : 'app';
document.getElementById(divtarget).innerHTML = "
";
document.getElementById('home').className = "nav-link flat active";
document.getElementById('leaflet_crud_create').className = "nav-link flat";
document.getElementById('leaflet_crud_read').className = "nav-link flat active";
document.getElementById('navbarDropdownUpdate').className = "nav-link dropdown-toggle";
document.getElementById('leaflet_crud_delete').className = "nav-link flat";
var map, isCollapsed, odm1;
if (document.body.clientWidth <= 767) {
isCollapsed = true;
} else {
isCollapsed = false;
}
var promisePoint = $.ajax({ url: "assets/dataservice/read_point.php",
method: "GET",
dataType: "json",
data: {command:"POINT"},
username: null,
password: null
});
var pointObjects = L.geoJson(null, {
onEachFeature: function (feature, layer) {
if (feature.properties) {
layer.on({
click: function (e) {
var htmlformcomponent = "" +
"" +
"" +
"" +
"Dati indetificativi | " +
"
" +
"" +
"" +
"" +
"Note | " +
""+feature.properties.notes+" | " +
"
" +
"" +
"
" +
"";
$("#app_modal_body").empty();
$("#app_modal_body").removeClass().addClass('modal-body');
$("#app_modal_size").removeClass().addClass('modal-dialog');
$("#app_modal_body").html(htmlformcomponent);
$("#app_modal_label").html("POINT");
$("#modalbox").modal('show');
}
});
}
}
});
promisePoint.then(function (data) {
pointObjects.addData(data);
map.addLayer(pointObjects);
});
var promiseLinestring = $.ajax({ url: "assets/dataservice/read_linestring.php",
method: "GET",
dataType: "json",
data: {command:"LINESTRING"},
username: null,
password: null
});
var linestringObjects = L.geoJson(null, {
onEachFeature: function (feature, layer) {
if (feature.properties) {
layer.on({
click: function (e) {
var htmlformcomponent = "" +
"" +
"" +
"" +
"Dati indetificativi | " +
"
" +
"" +
"" +
"" +
"Note | " +
""+feature.properties.notes+" | " +
"
" +
"" +
"
" +
"";
$("#app_modal_body").empty();
$("#app_modal_body").removeClass().addClass('modal-body');
$("#app_modal_size").removeClass().addClass('modal-dialog');
$("#app_modal_body").html(htmlformcomponent);
$("#app_modal_label").html("LINESTRING");
$("#modalbox").modal('show');
}
});
}
}
});
promiseLinestring.then(function (data) {
linestringObjects.addData(data);
map.addLayer(linestringObjects);
});
var promisePolygon = $.ajax({ url: "assets/dataservice/read_polygon.php",
method: "GET",
dataType: "json",
data: {command:"POLYGON"},
username: null,
password: null
});
var polygonObjects = L.geoJson(null, {
onEachFeature: function (feature, layer) {
if (feature.properties) {
layer.on({
click: function (e) {
var htmlformcomponent = "" +
"" +
"" +
"" +
"Dati indetificativi | " +
"
" +
"" +
"" +
"" +
"Notes | " +
""+feature.properties.notes+" | " +
"
" +
"" +
"
" +
"";
$("#app_modal_body").empty();
$("#app_modal_body").removeClass().addClass('modal-body');
$("#app_modal_size").removeClass().addClass('modal-dialog');
$("#app_modal_body").html(htmlformcomponent);
$("#app_modal_label").html("POLYGON");
$("#modalbox").modal('show');
}
});
}
}
});
promisePolygon.then(function (data) {
polygonObjects.addData(data);
map.addLayer(polygonObjects);
});
var url = "https://test-paesaggistica.lavoripubblici.sicilia.it/geoserver/mappers/wms";
//################# INIZIO PARTICELLA SELEZIONATA #################
100 ) { ?>
particella = L.geoJson(, {
style: {'color': "#ff0000",'fillColor': "rgb(255, 255, 0)",'fillOpacity': 0.4,'dashArray': 4,'weight': 3,'opacity': 0.9}
});
//################# FINE PARTICELLA SELEZIONATA #################
odm1 = L.tileLayer ('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 20,
minZoom: 1,
transparent: true,
attribution: 'OpenStreetMap | contributors CC-BY-SA.'
});
odm2 = L.tileLayer ('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
maxZoom: 20,
minZoom: 1,
transparent: true,
attribution: '© Esri | Source: Esri, USDA, USGS, AEX, GeoEye and the GIS User Community'
});
odm3 = L.tileLayer.wms (url, {
maxZoom: 20,
minZoom: 5,
transparent: true,
layers: 'mappers:provincie',
attribution: '© mapcloud services'
});
ctr10k = L.tileLayer.wms ('http://geoportal.mapcloud.it:8080/geoserver/wms', {
format: 'image/png',
transparent: true,
maxZoom: 20,
minZoom: 5,
transparent: true,
layers: 'mapcloud:ctr10k',
attribution: 'Carta Tecnica Regionale 1:10.000 - Regione Sicilia (Servizio WMS)'
});
particelle = L.tileLayer.wms(url, {
layers: "mappers:particelle_",
format: "image/png",
maxZoom: 20,
minZoom: 10,
transparent: true,
attribution: '© mapcloud services'
}),
map = L.map("map", {
zoom: ,
center: [],
layers: [odm1,particella],
minZoom: 3,
maxZoom: 20,
zoomControl: false,
attributionControl: false
});
map.setMaxBounds([]);
var zoomControl = L.control.zoom({
position: "topleft"
}).addTo(map);
var baseLayers = [
{label: 'Opendata Map', noShow: false, children: [
{label: 'OpenStreetMap', layer: odm1},
{label: 'Satellite Image', layer: odm2},
{label: 'Limiti provinciali', layer: odm3},
]},
{label: 'Cartografia Regionale', children: [
{label: 'CTR 10K - volo 2012-2013', layer: ctr10k },
]},
];
var overlayLayers =
{
label: 'CARTOGRAFICI',
noShow: true,
children: [
{label: 'Catasto', children: [
{label: 'Particelle catastali', layer: particelle},
]},
{label: 'Particelle progetto', children: [
{label: 'Particelle selezionate', layer: particella},
]},
{label: 'Elelenti del progetto', children: [
{label: 'Elementi puntuali', layer: pointObjects},
{label: 'Elementi lineari', layer: linestringObjects},
{label: 'Elementi poligonali', layer: polygonObjects},
]},
]
};
var options = {
collapsed: true,
closedSymbol: '',
openedSymbol: '',
namedToggle: false,
spaceSymbol: ' ',
selectorBack: false,
collapseAll: '',
expandAll: '',
};
var layerControlTree = L.control.layers.tree(baseLayers, overlayLayers, options).addTo(map);
}