[mapserver-users] Mapserver wms and Openlayers 3

Yves Jacolin yves.jacolin at camptocamp.com
Tue Aug 4 06:12:15 PDT 2015


Jordan,

Your problem come from probably to a wrong configuration in your ol3 code.

If you can see your WMS working in QGIS you should see the layer in ol3. If 
notn that's meant that your javascript code is incorrect.

Can you show your javascript code?

Could you check the request sent by your client to MapServer using Firebug 
(http://getfirebug.com) and check if the url is working in your navigator?

check the url if it doesnt work and try to understand where the 
misconfiguration come from.

Y.
On Friday, July 24, 2015 12:26:52 jordan wrote:
> Hope you can guide me in this issue I have. My aim is to connect to a
> Postgis database from Openlayers 3 using Mapserver WMS.
> 
> Apparently all is set up in my mapfile for WMS service(postgres connection
> inside). I have tested and validated the getmap request, no errors found.
> 
> Here is my URL:
> http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/maquetado/map
> files/demo3.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=agave_01_gcs
> ,agave_02_gcs&STYLES=&SRS=EPSG:4326&BBOX=-103.809,20.8419,-103.716,20.8878&W
> IDTH=105&HEIGHT=22&FORMAT=image/png
> 
> After that I change the path inside the "http.conf" file as follows:
> SetEnv myMap "C:/ms4w/Apache/htdocs/maquetado/mapfiles/demo3.map"
> 
> Here is my final URL: http://localhost/cgi-bin/mapserv.exe?map=myMap
> 
> I have tested it in GIS clients as a QGIS and ArcGIS and all is ok but when
> I try to use it in OL3 no layers are shown.
> 
> I think that probably something is wrong with my WMS url that OL3 can not
> read..
> So it is possible to change the "mapserv.exe" in my URL specifically omit
> the "exe" ??
> 
> I need something like this: http://localhost/cgi-bin/mapserv?map=myMap
> 
> Best regards
> Jordan
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Mapserver-wms-and-Openlayers-3-tp521695
> 6.html Sent from the Mapserver - User mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

-- 
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