Re: GeoWebCache, установка и настройка
Добавлено: 19 мар 2014, 12:06
Судя по GetCapabilities адрес вашего WMS-сервера:
Геоинформационные системы (ГИС) и Дистанционное зондирование Земли
https://gis-lab.info/forum/
Код: Выделить всё
http://localhost:8080/geoserver/cite/wms?SERVICE=WMS&
Код: Выделить всё
http://localhost:8080/geoserver/cite/wms?
Код: Выделить всё
http://localhost:8080/geoserver/cite/wms?tile=true
Код: Выделить всё
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://127.0.0.1:8080/geoserver/schemas/wms/1.1.1/WMS_MS_Capabilities.dtd">
<WMT_MS_Capabilities version="1.1.1" updateSequence="110">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Vitiaz Example</title>
<script
src="http://127.0.0.1:8080/geoserver/www/OpenLayers/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');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://localhost:8080/geoserver/cite/wms?SERVICE=WMS&tiled=true&",
{layers: 'cite:ru_boundary-polygon,cite:setka,cite:Post'});
map.addLayers([wms]);
map.zoomToMaxExtent();
</script>
</body>
</html>
Код: Выделить всё
http://127.0.0.1:8080/geoserver/gwc/demo/cite:Proba?gridSet=EPSG:4326&format=image/png
Код: Выделить всё
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="imagetoolbar" content="no">
<title>cite:Proba EPSG:4326 image/png</title>
<style type="text/css">
body { font-family: sans-serif; font-weight: bold; font-size: .8em; }
body { border: 0px; margin: 0px; padding: 0px; }
#map { width: 85%; height: 85%; border: 0px; padding: 0px; }
</style>
<script src="../../openlayers/OpenLayers.js"></script>
<script type="text/javascript">
var map, demolayer;
// sets the chosen modifiable parameter
function setParam(name, value){
str = "demolayer.mergeNewParams({" + name + ": '" + value + "'})"
// alert(str);
eval(str);
}
OpenLayers.DOTS_PER_INCH = 90.71428571428572;
OpenLayers.Util.onImageLoadErrorColor = 'transparent';
function init(){
var mapOptions = {
resolutions: [0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 6.866455078125E-4, 3.4332275390625E-4, 1.71661376953125E-4, 8.58306884765625E-5, 4.291534423828125E-5, 2.1457672119140625E-5, 1.0728836059570312E-5, 5.364418029785156E-6, 2.682209014892578E-6, 1.341104507446289E-6, 6.705522537231445E-7, 3.3527612686157227E-7],
projection: new OpenLayers.Projection('EPSG:4326'),
maxExtent: new OpenLayers.Bounds(-180.0,-90.0,180.0,90.0),
units: "degrees",
controls: []
};
map = new OpenLayers.Map('map', mapOptions );
map.addControl(new OpenLayers.Control.PanZoomBar({
position: new OpenLayers.Pixel(2, 15)
}));
map.addControl(new OpenLayers.Control.Navigation());
map.addControl(new OpenLayers.Control.Scale($('scale')));
map.addControl(new OpenLayers.Control.MousePosition({element: $('location')}));
demolayer = new OpenLayers.Layer.WMS(
"cite:Proba","../service/wms",
{layers: 'cite:Proba', format: 'image/png' },
{ tileSize: new OpenLayers.Size(256,256)});
map.addLayer(demolayer);
map.zoomToExtent(new OpenLayers.Bounds(-180.0,41.1867802,180.0,82.0576893));
// The following is just for GetFeatureInfo, which is not cached. Most people do not need this
map.events.register('click', map, function (e) {
document.getElementById('nodelist').innerHTML = "Loading... please wait...";
var params = {
REQUEST: "GetFeatureInfo",
EXCEPTIONS: "application/vnd.ogc.se_xml",
BBOX: map.getExtent().toBBOX(),
X: e.xy.x,
Y: e.xy.y,
INFO_FORMAT: 'text/html',
QUERY_LAYERS: map.layers[0].params.LAYERS,
FEATURE_COUNT: 50,
Layers: 'cite:Proba',
Styles: '',
Srs: 'EPSG:4326',
WIDTH: map.size.w,
HEIGHT: map.size.h,
format: "image/png" };
OpenLayers.loadURL("../service/wms", params, this, setHTML, setHTML);
OpenLayers.Event.stop(e);
});
}
function setHTML(response){
document.getElementById('nodelist').innerHTML = response.responseText;
};
</script>
</head>
<body onload="init()">
<div id="params"></div>
<div id="map"></div>
<div id="nodelist"></div>
</body>
</html>
Код: Выделить всё
var map, demolayer;
// sets the chosen modifiable parameter
function setParam(name, value){
str = "demolayer.mergeNewParams({" + name + ": '" + value + "'})"
// alert(str);
eval(str);
}
Код: Выделить всё
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://10.11.20.77:8080/geoserver/schemas/wms/1.1.1/WMS_MS_Capabilities.dtd">
<WMT_MS_Capabilities version="1.1.1" updateSequence="110">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Vitiaz Example</title>
<script
src="http://localhost:8080/geoserver/www/OpenLayers/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');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://localhost:8080/geoserver/gwc/service/wms?SERVICE=WMS&tiled=true&",
{layers: 'cite:Proba'});
map.addLayers([wms]);
map.zoomToMaxExtent();
</script>
</body>
</html>
Код: Выделить всё
"http://localhost:8080/geoserver/gwc/service/cite/wms?SERVICE=WMS&tiled=true&",
Код: Выделить всё
http://localhost:8080/geoserver/gwc/demo/setka?gridSet=EPSG:900913&format=image/png
Код: Выделить всё
http://localhost:8080/geoserver/gwc/service/wms?LAYERS=setka&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=5009377.085,7514065.6275,5635549.220625,8140237.763125&WIDTH=256&HEIGHT=256
Код: Выделить всё
400: Empty metatile, error message: MimeType mismatch, expected image/png but got text/html from http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/test/test.map&
Код: Выделить всё
http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/test/test.map&LAYERS=setka&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=5009377.085,7514065.6275,5635549.220625,8140237.763125&WIDTH=256&HEIGHT=256
Код: Выделить всё
localhost - - [09/Oct/2014:14:12:22 +0400] "GET /cgi-bin/mapserv.exe?BBOX=-20037508.34%2C-20037508.34%2C20037508.34%2C20037508.34&TRANSPARENT=TRUE&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&FORMAT=image%2Fpng&SERVICE=WMS&HEIGHT=512&LAYERS=setka&REQUEST=GetMap&STYLES=&WIDTH=512&SRS=EPSG%3A900913 HTTP/1.1" 200 580
Код: Выделить всё
<wmsUrl>
<string>http://localhost /cgi-bin/mapserv.exe?map=/ms4w/apps/test/test.map&</string>
</wmsUrl>