-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (40 loc) · 1.84 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<html>
<head>
<meta charset=utf-8 />
<title>TANTO - Visualizzare una Query REST fatta su ArcGIS Server</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<meta property="og:image" content="http://tanto.github.io/arcgisqueryrest/imgs/share.jpg" />
<meta property="og:title" content="TANTO - Sfruttare le query REST per accedere a dati grezzi su ArcGIS Server" />
<meta property="og:url" content="http://blog.spaziogis.it/2014/12/28/take-the-best-use-the-rest/" />
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<!-- Load Esri Leaflet from CDN -->
<script src="http://cdn-geoweb.s3.amazonaws.com/esri-leaflet/1.0.0-rc.4/esri-leaflet.js"></script>
<style>
body {margin:0;padding:0;}
#map {position: absolute;top:0;bottom:0;right:0;left:0;}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map('map').setView([43.575209590000043, 12.191401164000069], 9);
L.esri.basemapLayer('Streets').addTo(map);
var query = L.esri.Tasks.query('http://geo.umbriaterritorio.it/ArcGIS/rest/services/Public/ECOGRAFICO_CATASTALE1_WGS84/MapServer/0',{useCors:false});
query.where("DESCR_S49 LIKE '%CORPOSANO%'").run(function(error, results){
var group = new L.featureGroup;
function onEachFeature(feature, layer) {
if (feature.properties && feature.properties.DESCR_S49) {
layer.bindPopup('<strong>DESCR_S49</strong>: ' + feature.properties.DESCR_S49 + '<br>' + '<strong>NUMERO</strong>: ' + feature.properties.NUMERO);
}
}
var punti = L.geoJson(results, {
onEachFeature: onEachFeature
}).addTo(map);
group.addLayer(punti);
map.fitBounds(group.getBounds());
});
</script>
</body>
</html>