Openlayers & WMS - GetFeatureInfo problem

المشرف العام

Administrator
طاقم الإدارة
I'm making a small project but I encounter some problems. Let me explain that : Having generated mapfile with mapserver and they are viewable by the openlayers interface, I would like to make me GetFeatureInfo on features.

Subsite only problem is that I can not select the correct coordinates of a feature x and y (i and j for the url) because the x and y coordinates correspond to the "frame" openlayers and not of the layer displayed (problem with zooms, good feature pointing, etc.).

http://xxx/cgi-bin/mapserv.exe?map=...at=mime&i=913&j=162&WIDTH=1000&height=1000img : http://i.stack.imgur.com/vNYm4.png

Do you have any idea to solve my problem?

Attached my html and mapfile code:

WMS header, footer, section { margin: 0; padding: 0; } header, footer, aside, nav, article, section { display: block; } body { color: #333; font: 14px Helvetica, Arial, sans-serif; line-height: 18px; } a { color: #363636; } p { margin: 0 0 18px; } #container { width: 1024px; margin: 0 auto; } #map{width: 1000px; height: 1000px; border: 2px solid #666; margin: 0 auto;} /* Header */ header { background: #ffffff; border-bottom: 2px solid #aaa; font-size:26px } header h1 { color: #363636; margin: 0 0 3px; padding: 24px 18px 0; } /* Content Positioning and Size */ nav { float: right; width: 350px; } #content { } #extra { float: left; width: 350px; } /* Footer */ footer { background: #666; border-bottom: 2px solid #666; clear: both; } footer p { color: #ccc; margin: 0; padding: 0 18px 10px; }http://www.gisarab.button_accueil.pngWMS

</br> PICC

</br>

</br>
URL UTILES :​

URL pour accéder au WMS dans une application client SIG : xxx/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/mapfiles/picc.map URL pour accéder aux métadonnées du MapFile du PICC - routes et bâtiments (XML) : xxx/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/mapfiles/picc.map&SERVICE=WMS&REQUEST=GetCapabilities URL pour accéder aux métadonnées du MapFile du MNT (XML) : xxx/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/mapfiles/mnt.map&SERVICE=WMS&REQUEST=GetCapabilities

xxx

</div>Mapfile :

OUTPUTFORMATNAME aggDRIVER AGG/PNGIMAGEMODE RGBEND# LegendLEGEND IMAGECOLOR 255 255 255STATUS ONKEYSIZE 18 12LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89ENDEND# Web interface definition. Only the template parameter# is required to display a map. See MapServer documentationWEB# Set IMAGEPATH to the path where MapServer should# write its output.IMAGEPATH '/tmp/'# Set IMAGEURL to the url that points to IMAGEPATH# as defined in your web server configurationIMAGEURL '/tmp/'# WMS server settingsMETADATA 'ows_title' 'WMS-PICC' 'ows_onlineresource' 'http://xx/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/mapfiles/picc.map' 'ows_srs' 'EPSG:31370' "wms_enable_request" "*" "wms_include_items" "all"END#Scale range at which web interface will operate# Template and header/footer settings# Only the template parameter is required to display a map. See MapServer documentationTEMPLATE 'fooOnlyForWMSGetFeatureInfo'ENDLAYERNAME 'arc'TYPE LINEDUMP trueTEMPLATE fooOnlyForWMSGetFeatureInfoEXTENT 217711.311089 129521.320380 230314.065583 139320.681620CONNECTIONTYPE postgisCONNECTION "dbname='projetsig' host=xx port=5432 user='xx' password='xx' sslmode=disable"DATA 'geom FROM "arc" USING UNIQUE gid USING srid=31370'FILTER ( "rue" IS NOT NULL )METADATA 'ows_title' 'arc' "wms_enable_request" "*" "wms_inlude_items" "all" "ows_featureinfo_textplain_include_items" "*"ENDSTATUS OFFTRANSPARENCY 100PROJECTION'proj=lcc''lat_1=51.16666723333333''lat_2=49.8333339''lat_0=90''lon_0=4.367486666666666''x_0=150000.013''y_0=5400088.438''ellps=intl''towgs84=-106.869,52.2978,-103.724,0.3366,-0.457,1.8422,-1.2747''units=m''no_defs'ENDCLASS NAME 'arc' STYLE WIDTH 0.91 COLOR 54 54 54 ENDENDENDLAYERNAME 'polygone'TYPE POLYGONDUMP trueTEMPLATE fooOnlyForWMSGetFeatureInfoEXTENT 217711.311089 129521.320380 230314.065583 139320.681620CONNECTIONTYPE postgisCONNECTION "dbname='projetsig' host=xx port=5432 user='xxx' password='xxx' sslmode=disable"DATA 'geom FROM "polygone" USING UNIQUE gid USING srid=31370'METADATA 'ows_title' 'polygone' "wms_enable_request" "*" "wms_include_items" "all"ENDSTATUS OFFTRANSPARENCY 100PROJECTION'proj=lcc''lat_1=51.16666723333333''lat_2=49.8333339''lat_0=90''lon_0=4.367486666666666''x_0=150000.013''y_0=5400088.438''ellps=intl''towgs84=-106.869,52.2978,-103.724,0.3366,-0.457,1.8422,-1.2747''units=m''no_defs'ENDCLASS NAME 'polygone' STYLE WIDTH 0.91 OUTLINECOLOR 0 0 0 COLOR 109 188 214 ENDENDENDENDThx.



أكثر...
 
أعلى