[mapserver-users] Hellp please!!
Venkat Shesu Reddem
venkat.shesu at gmail.com
Sun Apr 8 21:22:39 PDT 2012
Sorry for previous mail.
layer1 = new OpenLayers.Layer.WMS( "QGIS-MAP","
http://localhost/cgi-bin/mapserv.exe", {layers:
'ResidentDistrict_2011',map:
'/wwwroot/example1_test/Canada_Mountains.map',} )
layer2 = new OpenLayers.Layer.WMS( "QGIS-MAP","
http://localhost/cgi-bin/mapserv.exe", {layers: 'LAKES',map:
'/wwwroot/example1_test/Canada_Mountains.map',} )
layer3 = new OpenLayers.Layer.WMS( "QGIS-MAP","
http://localhost/cgi-bin/mapserv.exe", {layers: 'MDI_2011',map:
'/wwwroot/example1_test/Canada_Mountains.map',} )
map.addLayers([layer1,layer2,layer3]);
with regards
Venkat
On Mon, Apr 9, 2012 at 9:51 AM, Venkat Shesu Reddem
<venkat.shesu at gmail.com>wrote:
> Dear Friend,
>
> This may be help you.
> ..................
> .................
> layer = new OpenLayers.Layer.WMS( "QGIS-MAP","
> http://localhost/cgi-bin/mapserv.exe", {layers:
> 'ResidentDistrict_2011',map:
> '/wwwroot/example1_test/Canada_Mountains.map',} )
>
> layer = new OpenLayers.Layer.WMS( "QGIS-MAP","
> http://localhost/cgi-bin/mapserv.exe", {layers: 'LAKES',map:
> '/wwwroot/example1_test/Canada_Mountains.map',} )
>
> layer = new OpenLayers.Layer.WMS( "QGIS-MAP","
> http://localhost/cgi-bin/mapserv.exe", {layers: 'MDI_2011',map:
> '/wwwroot/example1_test/Canada_Mountains.map',} )
>
> map.addLayers([ResidentDistrict_2011, LAKES, MDI_2011]);
>
> ...................
> ..................
>
> with regards
> Venkat
>
> On Mon, Apr 9, 2012 at 9:44 AM, Özgür Arslan <ozgurarslan81 at hotmail.com>wrote:
>
>> HI All,
>>
>> I am working on open layers and map file and I have a question. I am
>> trying to create several layers from 1 map file on open layers, and I want
>> to switch off and on but I couldn't separate the layers in OpenLayers. When
>> I set layers to DEFAULT in map file it displays all layers together like a
>> one layer. I can't create different layers from one map file. Are there any
>> ideas? Codes are below;
>>
>> Thank you
>>
>>
>>
>> <html>
>> <head>
>> <title>OpenLayers Example</title>
>> <link rel="stylesheet" href="openlayers/theme/default/style.css"
>> type="text/css">
>> <script src="http://openlayers.org/api/OpenLayers.js"></script>
>> </head>
>> <body>
>> <center><div id="map"></div></center>
>> <style>
>> @media screen
>> {
>> #map{width:975px; height:750px; border: 2px solid black;}
>> }
>> </style>
>> <script defer="defer" type="text/javascript">
>> var lon = -84.722147;
>> var lat = 49.298594;
>>
>> var zoom = 6;
>> var map, layer;
>>
>> var map = new OpenLayers.Map('map');
>> layer = new OpenLayers.Layer.WMS( "QGIS-MAP",
>> "http://localhost/cgi-bin/mapserv.exe", {layers:
>> 'ResidentDistrict_2011,LAKES,MDI_2011',map:
>> '/wwwroot/example1_test/Canada_Mountains.map',} )
>>
>> map.addLayer(layer);
>> map.zoomToMaxExtent();
>> map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
>>
>> map.addControl(new OpenLayers.Control.PanZoomBar());
>> map.addControl(new OpenLayers.Control.MouseToolbar());
>> map.addControl(new OpenLayers.Control.LayerSwitcher());
>> map.addControl(new OpenLayers.Control.MousePosition());
>> map.addControl(new OpenLayers.Control.OverviewMap());
>> </script>
>>
>> </body>
>> </html>
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120409/543eb0c4/attachment.htm>
More information about the MapServer-users
mailing list