Re: [mapserver-users] openlayers 3

2016-05-16 Thread Jeff McKenna

Hello Hosain,

To help you and others get started with OpenLayers, I've added an 
OpenLayers 3 example that uses a (local) WMS service, into MS4W's 
OpenLayers package.  The data is in spatialite format.  What's nice is 
that you can just use this working mapfile (that lives in 
/ms4w/apps/openlayers/examples/map/wms-server.map) and its working 
javascript code (visible through a link on the MS4W homepage at 
127.0.0.1).  Once you install MS4W 3.14 and the OpenLayers 3.15.1 
package (from http://ms4w.com), look for a new "MapServer WMS Example" 
on your MS4W homepage, under the "OpenLayers" section.  This new demo 
will look like this:  http://pasteboard.co/Y63Qzix.jpg


If you use MS4W's setup.exe installer the mapfile and the OpenLayers 
code will be automatically modified for your installation (path to 
mapfile, WMS onlineresource, Apache port, etc.).


I think this will help you and others get started with OpenLayers3 and MS4W.

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




On 2016-05-16 4:29 AM, Yves Jacolin wrote:

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=getcapabilities=WMS=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?



  
http://openlayers.org/en/v3.15.1/css/ol.css; type="text/css">

  .map {
height: 100%;
width: 100%;
  }

http://openlayers.org/en/v3.15.1/build/ol.js";
type="text/javascript">
web gis
  
  




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
  })
});




  




someone has offer?






___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] openlayers 3

2016-05-16 Thread Yves Jacolin
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=getcapabilities=WMS=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?
> 
> 
> 
>   
>  href="http://openlayers.org/en/v3.15.1/css/ol.css; type="text/css">
> 
>   .map {
> height: 100%;
> width: 100%;
>   }
> 
> http://openlayers.org/en/v3.15.1/build/ol.js";
> type="text/javascript">
> web gis
>   
>   
> 
> 
> 
> 
> 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
>   })
> });
> 
> 
> 
> 
>   
> 
> 
> 
> 
> 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.jaco...@camptocamp.com
http://www.camptocamp.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] openlayers 3

2016-05-14 Thread Marco Afonso
Hello hosain,

>From the openlayers code you supplied, you are using OSM layer over your
WMS layer.
You want to use diferente projections, you have to use the proj4js libray.
http://proj4js.org/

1. You did not supplied any MapServer information. What gives this link?
http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/ol/tehran.map=WMS=1.1.1=GetCapabilities

2. Do you have any javascript errors? You can use Google Chrome developer
tools to check this.

3. You need to define in your ol.proj.Projection the proj4 parameters. See
http://spatialreference.org/ref/epsg/32639/

4. Try invert your layers order

5. Set your WMS layer to use the projection you defined

This is what comes in my mind at the moment...

Cheers,


2016-05-14 13:06 GMT+01:00 hosain mohammadi :

> Hello every one
> i would like to use openlayers 3 in mapserver
> anyone have idea about this
>  thanks
>
>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



-- 
Regards,
Marco Afonso
http://goo.gl/ZDtQjm
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] openlayers 3

2016-05-14 Thread hosain mohammadi
Hello every one
i would like to use openlayers 3 in mapserver
anyone have idea about this
 thanks
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] openlayers 3

2016-05-13 Thread hosain mohammadi
hello dears
i'd like to use openayers3 with ms4w 3.0.6 the below code is used.
some one know what is my problem.





  





  .map {
height: 100%;
width: 100%;
  }





web gis

  

  







var extent = [530076.378119036 ,3955633.12330454 ,535309.119388271
,3958672.31583408];

var layers = [

  new ol.layer.Tile({

  title: "tehran",

  extent: extent,

  source: new ol.source.TileWMS({

  url: "
http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/ol/tehran.map&;
",

  params: {

'LAYERS': 'tehran',

'VERSION': '1.1.1',

   'FORMAT': 'image/png',

   'TILED': true


  },

  serverType: 'mapserver'

  })

  }),

new ol.layer.Tile({

source: new ol.source.OSM()

 })
];




var projection = new ol.proj.Projection({

 code: 'EPSG:32639',

 units: 'm'
 });

var  view = new ol.View({

center: [532416 ,3957232],

extent: extent,

zoom: 15,

projection: projection


  });




var map = new ol.Map({

  layers: layers,

  view: view,

  renderer: "canvas",

  target: 'map',

  controls: ol.control.defaults().extend([

   new ol.control.ScaleLine(),

   new ol.control.MousePosition()

  ])

   });




  


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] openlayers 3

2016-05-13 Thread hosain mohammadi
hello

i'd like to use openlayers3 for wms service
the belowe code is correct?



  
http://openlayers.org/en/v3.15.1/css/ol.css;
type="text/css">

  .map {
height: 100%;
width: 100%;
  }

http://openlayers.org/en/v3.15.1/build/ol.js";
type="text/javascript">
web gis
  
  




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
  })
});




  




someone has offer?
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] openlayers 3

2016-05-10 Thread hosain mohammadi
Hello every one
i would like to use openlayers 3 in mapserver
anyone have idea about this
 thanks
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users