-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
75 lines (69 loc) · 2.4 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<html>
<head>
<title>OpenLayers Example</title>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
</head>
<body>
<div style="width:100%; height:100%" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map', {
});
map.addControl(
new OpenLayers.Control.LayerSwitcher({'ascending':false})
);
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
var dm_wms = new OpenLayers.Layer.WMS(
"Canadian Data",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{
layers: "bathymetry,land_fn,park,drain_fn,drainage," +
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true",
format: "image/png"
},
{isBaseLayer: false}
);
var wms_soma = new OpenLayers.Layer.WMS(
"Somabrasil",
"http://mapas.cnpm.embrapa.br/geoserver_soma/wms",
{
layers: "municipios",
transparent: "true",
format: "image/png"
},
{isBaseLayer: false}
);
// coloca o mapa no local errado
// tirando da view
var wms_sql = new OpenLayers.Layer.WMS(
"Query layer v1.3",
"http://mapas.cnpm.embrapa.br/geoserver_soma/wms",
{
layers: "view_censo",
viewparams: `sql:select * from vw_pam_all_shapes where uf = 'SP' and ano = 2010 and cultura = 'Soja'`,
transparent: "true",
format: "image/png",
version: 1.3
},
{isBaseLayer: false}
);
var wms_sql2 = new OpenLayers.Layer.WMS(
"Query layer v1.1",
"http://mapas.cnpm.embrapa.br/geoserver_soma/wms",
{
layers: "view_censo",
viewparams: `sql:select * from vw_pam_all_shapes where uf = 'SP' and ano = 2010 and cultura = 'Soja'`,
transparent: "true",
format: "image/png",
version: 1.1
},
{isBaseLayer: false}
);
// canadian data não esta funcionando
//map.addLayers([wms, dm_wms, wms_soma]);
map.addLayers([wms, wms_soma, wms_sql2]);
map.zoomToMaxExtent();
</script>
</body>
</html>