[mapserver-users] openlayers 3

Yves Jacolin yves.jacolin at camptocamp.com
Mon May 16 00:29:28 PDT 2016


Hello,

It could be two kind of problem:
* server side
* client site

It is difficult to see a problem (except obvious one) in such code. Did you 
check that your mapserver is working correctly?

If not check this:
http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/jask/jask.map&REQUEST=getcapabilities&SERVICE=WMS&VERSION=1.3.0

If you get the capabilities, check any errors messages in the capabilities. If 
you can't have the capabitilies, try to find the error or post the error 
message if you can't find it.

When WMS service works, you can try the ol3 mailing list to see why the client 
side is not working.

Regards,

Y.

On Friday, May 13, 2016 11:54:55 hosain mohammadi wrote:
> hello
> 
> i'd like to use openlayers3 for wms service
> the belowe code is correct?
> 
> <!doctype html>
> <html lang="en">
>   <head>
>     <link rel="stylesheet"
> href="http://openlayers.org/en/v3.15.1/css/ol.css" type="text/css">
>     <style>
>       .map {
>         height: 100%;
>         width: 100%;
>       }
>     </style>
>     <script src="http://openlayers.org/en/v3.15.1/build/ol.js"
> type="text/javascript"></script>
>     <title>web gis</title>
>   </head>
>   <body>
> 
>     <div id="map"></div>
>     <script type="text/javascript">
> 
>     var layers = [
>           new ol.layer.Image({
>             extent: [1062293,17704892,1085747,17720997],
>             source: new ol.source.ImageWMS({
>               url: '
> http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/jask/jask.map
> ',
>               params: {
>                 'LAYERS': 'jask',
>                 'CRS': 'EPSG:4326',
>                 'BBOX': '1062293,17704862,1085747,17720997',
>                 'FORMAT': 'image/png',
>                 'mode':'map'
>               },
>               serverType: 'mapserver'
>             })
>           })
>         ];
>     var projection = new ol.proj.Projection({
>      code: 'EPSG:4326',
>      units: 'm'
>      });
> 
>         var map = new ol.Map({
>           layers: layers,
>           target: 'map',
>           controls: [
>               new ol.control.Zoom(),
>               new ol.control.ZoomSlider()
>           ],
> 
>           view: new ol.View({
>             center: [1073136.94,17716190.89],
>             zoom: 13,
>             projection: projection
>           })
>         });
> 
> 
> 
>     </script>
>   </body>
> </html>
> 
> 
> 
> someone has offer?

-- 
Responsable Formation et Support
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel (France) : +33 4 58 48 20 43 (new !)
Tel (Suisse) : +41 21 619 10 43
Mob. : +33 6 18 75 42 21
Fax : 04 79 70 15 81
Mail : yves.jacolin at camptocamp.com
http://www.camptocamp.com


More information about the mapserver-users mailing list