Это мои настройки
Код: Выделить всё
layers:
- name: basic
title: Stavropol main layer
sources: [basic_cache]
caches:
basic_cache:
grids: [basic_grid]
sources: [basic_wms]
sources:
basic_wms:
type: wms
req:
url: http://82.146.61.184/cgi-bin/mapserv?map=/var/www/maps/w.map
layers: basic
#, STREET, LESXOZ, DOM, garagi
grids:
basic_grid:
res_factor: 'sqrt2'
bbox: [-19000, -10000, 9000, 7000]
srs: 'EPSG:4326'
bbox_srs: 'EPSG:4326'
num_levels: 14
cache:
# where to store the cached images
base_dir: './cache_data'
# where to store lockfiles
lock_dir: './cache_data/locks'
И пишет код на странице:
Код: Выделить всё
JavaScript code
<script src="static/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init(){
OpenLayers.Util.onImageLoadErrorColor = "transparent";
map = new OpenLayers.Map('map', {
maxResolution: 109.375,
maxExtent: new OpenLayers.Bounds(-19000.0, -10000.0, 9000.0, 7000.0),
projection: new OpenLayers.Projection("EPSG:4326")
});
var layer = new OpenLayers.Layer.WMS( "WMS basic",
"../service?", {layers: "basic", format: "image/png", srs:"EPSG:4326"},
{singleTile: true, ratio: 1}, {isBaseLayer: true} );
map.addLayer(layer);
map.zoomToMaxExtent();
}
</script>