AW: [OpenLayers-Users] Re: problem with overview map

vrbikdan vrbikdan at gmail.com
Fri Mar 25 08:47:17 EDT 2011


Code is somewhere on the beginning of this topic, but I can post here the
most part of code.

var P4326   = new OpenLayers.Projection("EPSG:4326");
var P900913 = new OpenLayers.Projection("EPSG:900913");

var body2, body3, body4, body5, body6, body7, cyklo, turist, gphy, sat,
podklad, uzemi;


function mapa(){		  
        //OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url="
		
		map = new OpenLayers.Map('jizerky',{
                    controls: [
                        new OpenLayers.Control.Navigation(),
                        new OpenLayers.Control.ScaleLine()],
                        projection: P900913,
						displayProjection: P4326,
						units: "m",
						maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508,
20037508.34)
        });
		
		gphy = new OpenLayers.Layer.Google("terénní", 
					{type: G_PHYSICAL_MAP, 
					sphericalMercator:true,
					//displayInLayerSwitcher: false
					}
					
		);
		
		
		
		sat = new OpenLayers.Layer.Google("satelitní snímky", 
					{type: G_SATELLITE_MAP, 
					sphericalMercator:true,
					//isBaseLayer: false
					}
					
		);
		
		podklad = new OpenLayers.Layer.WMS("turistická mapa",
"http://localhost:8080/geoserver/wms",
                    {
                    layers: 'dp:podkladova_mapa_GM',
                    styles: '',
                    srs: 'EPSG:4326',
                    format: 'image/png',
                    tiled: 'true',
                    tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true',
                    },
					{minScale: 60000, maxScale: 10000}
        );
		
		cyklo = new OpenLayers.Layer.WMS("cyklostezky",
"http://localhost:8080/geoserver/wms",
					{height: '358',
                    width: '512',
					layers: 'dp:cyklostezky',
                    styles: '',
                    srs: 'EPSG:4326',
                    format: 'image/png',
                    tiled: 'true',
                    tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true'
                    },
					{minScale: 60000, maxScale: 10000}
        );
		
		turist = new OpenLayers.Layer.WMS("turistické trasy",
"http://localhost:8080/geoserver/wms",
					{height: '358',
                    width: '512',
					layers: 'dp:turisticke_trasy',
                    styles: '',
                    srs: 'EPSG:4326',
                    format: 'image/png',
                    tiled: 'true',
                    tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true'					
                    },
					{minScale: 60000, maxScale: 10000}
        );
		
		body2 = new OpenLayers.Layer.WMS("místa dalekého rozhledu",
"http://localhost:8080/geoserver/wms",
					{width: '462',
                        layers: 'dp:body2',
                        styles: '',
                        srs: 'EPSG:900913',
                        height: '512',
                        format: 'image/png',
                        tiled: 'true',
                        tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true'					
                    },
					{minScale: 60000, maxScale: 10000}
        );
		
		body3 = new OpenLayers.Layer.WMS("turistické zajímavosti",
"http://localhost:8080/geoserver/wms",
					{width: '462',
                        layers: 'dp:body3',
                        styles: '',
                        srs: 'EPSG:900913',
                        height: '512',
                        format: 'image/png',
                        tiled: 'true',
                        tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true'					
                    },
					{minScale: 60000, maxScale: 10000}
        );
		
		body4 = new OpenLayers.Layer.WMS("občerstvení",
"http://localhost:8080/geoserver/wms",
					{width: '462',
                        layers: 'dp:body4WGS84',
                        styles: '',
                        srs: 'EPSG:4326',
                        height: '512',
                        format: 'image/png',
                        tiled: 'true',
                        tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true'					
                    },
					{minScale: 60000, maxScale: 10000}
        );
		
		body5 = new OpenLayers.Layer.WMS("nádraží a infocentra",
"http://localhost:8080/geoserver/wms",
					{width: '462',
                    layers: 'dp:body5',
                    styles: '',
                    srs: 'EPSG:900913',
                    height: '512',
                    format: 'image/png',
                    tiled: 'true',
                    tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true'					
                    },
					{minScale: 60000, maxScale: 10000}
        );
		
		body6 = new OpenLayers.Layer.WMS("ostatní",
"http://localhost:8080/geoserver/wms",
					{width: '462',
                        layers: 'dp:body6',
                        styles: '',
                        srs: 'EPSG:900913',
                        height: '512',
                        format: 'image/png',
                        tiled: 'true',
                        tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true'					
                    },
					{minScale: 60000, maxScale: 10000}
        );
		
		body7 = new OpenLayers.Layer.WMS("ubytování",
"http://localhost:8080/geoserver/wms",
					{width: '462',
                        layers: 'dp:body7',
                        styles: '',
                        srs: 'EPSG:4326',
                        height: '512',
                        format: 'image/png',
                        tiled: 'true',
                        tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true'					
                    },
					{minScale: 60000, maxScale: 10000}
        );
		
		uzemi = new OpenLayers.Layer.WMS("uzemi",
"http://localhost:8080/geoserver/wms",
					{height: '358',
                    width: '512',
					layers: 'dp:uzemi',
                    styles: '',
                    srs: 'EPSG:4326',
                    format: 'image/png',
                    tiled: 'true',
                    tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
					transparent: 'true'					
                    },
					{displayInLayerSwitcher: false}
        );
		
		
		//map.addLayers([gphy, sat, podklad, uzemi, cyklo, turist, body2, body3,
body4, body7, body5, body6]);
		map.addLayers([gphy, sat, uzemi, podklad, turist, body5]);
		

		
		map.setCenter(new
OpenLayers.LonLat(15.205078122883185,50.86577799589138).transform(P4326,P900913),
11);
		map.addControl(new OpenLayers.Control.PanPanel());
		map.addControl(new OpenLayers.Control.ZoomPanel());
		
		var overview = new OpenLayers.Control.OverviewMap({
			div: document.getElementById('prehledkaContainer'),
			mapOptions: {
					units: "m",
					maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508,
20037508.34),
			}
		});
		map.addControl(overview);

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/problem-with-overview-map-tp6190056p6207552.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list