[Geomoose-users] error occur while trying to make a search function using itemquery.php

zye silverrose83 at yahoo.com
Thu Aug 25 22:00:54 EDT 2011


Hello,

Right now i'm trying to make a search using itemquery.php. I use GM 2.4 and
mapserver version 3.0.3. Can you guys give me a solution for this matter?
Why i got this error?

Fatal error: Call to undefined method layerObj::getFeature() in
C:\ms4w\apps\geomoose2\htdocs\php\itemquery.php on line 106

Here my *mapbook.xml:*


<?xml version="1.0"?>
<mapbook version="2.0">
	<configuration>
		
		EPSG:3377
		
            
		
		-120311.3508, -93138.3527, 220252.0581, 96147.8017
		-173234.0000, -90583.0000, 161701.0000 , 91811.0000
		

		false
		/cgi-bin/mapserv.exe
		/ms4w/apps/geomoose2/maps/

		
		false
		false		
		true	

		red
		yellow
		1

		false

		Catalog
		
		Catalog
		Information
		Information
	      
		m
		.5,1,4,8,16,24,32,64,128,270,550,1000
		false
		false
			

	</configuration>
	
    <map-source name="jalanpontian" type="mapserver" reference="true">
		<file>./demo/data/jalanpontian.map</file>
		<layer name="all" reference="true"/>
	</map-source>
	
	<map-source name="kmyarat" type="mapserver" reference="true">
		<file>./demo/data/kmyarat.map</file>
		<layer name="all" reference="true"/>
	</map-source>
	
	<map-source name="daerah" type="mapserver" reference="true" >
		<file>./demo/data/daerah.map</file>
		<layer name="all" reference="true"/>
	</map-source>
	
	<map-source name="lot" type="mapserver" reference="true" >
		<file>./demo/data/lot.map</file>
		<layer name="all" reference="true"/>
	</map-source>
	
	<map-source name="negeri" type="mapserver" reference="false">
		<file>./demo/data/negeri.map</file>
		<layer name="all" reference="true"/>
	</map-source>
	
	
	
	<service name="print" title="Print Map">
		<step type="input">
			<url>php/print.php</url>
			<input type="print_info" name="layers"/>
			<input type="extent" name="extent"/>
			<input type="sketches" name="sketches"/>

			<input type="user" name="title" title="Map Title">Map</input>
			<input type="hidden" name="date" title="Map Date">true</input>

			<input type="select" name="template" title="Output Template: ">
				<option value="letter_landscape">Letter - Landscape</option>
				<option value="letter_portrait">Letter - Portrait</option>
				<option value="poster_landscape">11" x 17" - Landscape</option>
				<option value="poster_portrait">11" x 17" - Portrait</option>
			</input>

			<input type="select" name="quality" title="Image Quality: ">
				<option value="2">Higher</option>
				<option value="3">Highest</option>
				<option value="1">Standard</option>
			</input>

			<input type="select" name="scale" title="Print Scale: ">
				<option value="map">Current Map Scale</option>
				<option value="1000">1:1000</option>
				<option value="5000">1:5000</option>
				<option value="10000">1:10000</option>
			</input>
		</step>
	</service>

	<service name="identify" title="Identify" display="false">
		<url>php/identify.php</url>
		<step type="spatial" name="shape" line="false" polygon="false"
jump-start="true" default="point">
			<input type="visiblelayers" name="layers"/>
		</step>
	</service>

	<service name="birdseye" display="false" target="_blank">
		<url>php/birdseye.php</url>
		<step type="spatial" name="xy" line="false" polygon="false"
jump-start="true" default="point" format="delim" reproject="EPSG:4326">
		</step>
	</service>

	<service name="streetview" display="false" target="_blank">
		<url>php/streetview.php</url>
		<step type="spatial" name="xy" line="false" polygon="false"
jump-start="true" default="point" format="delim" reproject="EPSG:4326">
		</step>
	</service>

	<service name="feature_report" display="false">
		<url>php/feature_report.php</url>
		<input type="hidden" name="layers" value="lmic/fsa"/>
		<input type="hidden" name="src"/>
		<input type="hidden" name="PIN"/>
	</service>

	<service name="select" title="Select">
		<url>php/select.php</url>

		
		<step type="spatial" showTools="true" name="shape" line="true"
polygon="true" point="true" default="polygon" edit-polygon="false"
pan="false" jump-start="true">

			<header></header>

			<input type="visiblelayers" name="layers"/>

			
			<input type="select" name="select_layer" title="Select:">
				<option value="parcels/parcels">Parcels</option>
			</input>
			
			
			<input type="user" name="shape_buffer" title="Buffer Selection Shape
(ft)">0</input>

			<footnote></footnote>
		</step>
	</service>

	
	<service name="buffered_select_followup" title="Buffered Select">
		<url>php/select.php</url>
		<step type="input">
			<input type="hidden" name="shape"/>
			<input type="hidden" name="select_layer"/>
			<input type="hidden" name="query_layer"/>
			<input type="hidden" name="shape_buffer"/>
			<input type="user" name="selection_buffer" title="Buffer Features By: "/>
		</step>
	</service>

	<service name="buffered_select" title="Buffered Select">
		<url>php/select.php</url>

		
		<step type="spatial" showTools="true" name="shape" line="true"
polygon="true" point="true" default="polygon" edit-polygon="false"
pan="false">

			<header></header>

			<input type="visiblelayers" name="layers"/>
			
			<input type="select" name="select_layer" title="Select features from:">
				<option value="parcels/parcels">Parcels</option>
			</input>
			
			<input type="user" name="selection_buffer" title="Buffer Selected
Features (ft)">0</input>

			
			<input type="select" name="query_layer" title="Using Features In">

				<option value="parcels/parcels">Parcels</option>
			</input>

			<footnote></footnote>
		</step>
	</service>

	<service name="popups" display="false">
		<url>php/popups.php</url>
		<step type="spatial" name="shape" line="false" polygon="false"
jump-start="true" default="point">
			<header></header>
			<input type="hidden" name="layer"/>
		</step>
	</service>

	<service name="geocode_address" title="Geocode Address">
		<url>php/geocode.php</url>
		<step type="input">
			<input type="user" name="address" title="Enter Address: "/>
			<input type="hidden" name="googlekey"
value="ABQIAAAA4Q-VLyIpwp3L8M9DIzKb2BT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRe8Hd6FR51Hvb-Fvd-wGjiDZDC4w"/>
		</step>
	</service>

	<service name="search_parcels">
		<url>php/itemquery.php</url>
		<step type="input">
			 <input type="select" name="qitem" title="Search By: ">
             <option value="DAERAH">Daerah</option>
             </input>
             <input type="user" name="qstring" title=""/>
             <input type="hidden" name="layer" value="daerah/all"/>
             <input type="hidden" name="zoom_to_first" value="false"/>
             <input type="hidden" name="highlight" value="true"/>
			 <input type="hidden" name="mode" value="search"/>
		</step>
	</service>

	
	<layer-controls>
		<layer-control name="popups" service-name="popups" layer-input="layer"
on="false" tip="Show Popups for %LAYER%"/> 
	</layer-controls>
	<catalog>

	<layer title="Jalan" src="jalanpontian/all" status="on"/>
	<layer title="Daerah" src="daerah/all" status="off"/>
    <layer title="Kemudahan Masyarakat" src="KMYARAT/all" status="off"/>   
	<layer title="Lot" src="lot/all" status="off"/> 
	<layer title="Negeri" src="negeri/all" status="on" show-legend="true" 
minscale="0" maxscale="500000" /> 
  
         
	</catalog>

	
	<toolbar>
		<tool name="previous" title="Previous Extent" type="internal"
action="previous" selectable="false"/>
		<tool name="next" title="Next Extent" type="internal" action="next"
selectable="false"/>
		<tool name="fullextent" title="Zoom to Full Extent" type="internal"
action="fullextent" selectable="false"/>
		<tool name="pan" title="Pan" type="internal" action="pan"
selected="true"/>
		<tool name="zoomin" title="Zoom In" type="internal" action="zoomin"/>
		<tool name="zoomout" title="Zoom Out" type="internal" action="zoomout"/>
		<tool name="identify" title="Identify" type="service" service="identify"
cursor="url('cursors/identify2.cur') 9 9,url('cursors/identify2.cur'),auto"
/>

		<tool name="buffered_select" title="Buffered Select" type="service"
service="buffered_select"/>
		<tool name="clear" title="Clear Selection" type="javascript"
selectable="false">
			GeoMOOSE.changeLayerVisibility('highlight/all', false);
		</tool>
		<tool name="measure" title="Measure" type="internal" action="measure"/>
		<tool name="measurearea" title="Measure Area" type="internal"
action="measurearea"/>
		<tool name="search_parcels" title="Carian" type="service"
service="search_parcels" selectable="false"/>
		<tool name="print" title="Print" type="service" service="print"
selectable="false"/>
		<tool name="birdseye" title="Bird's Eye View" type="service"
selectable="true" service="birdseye"/>
		<tool name="streetview" title="Google Street View" type="service"
service="streetview" selectable="true"/>
		<tool name="geocode" title="Geocode Address" type="service"
service="geocode_address" selectable="true"/> 	
		<drawer>
			<tool name="markup_tools" title="Sketch Tools" type="internal"
action="none" selectable="false"/>
			<tool name="draw_polygon" title="Draw Polygon" type="internal"
action="draw_polygon"/>
			<tool name="draw_line" title="Draw Line" type="internal"
action="draw_line"/>
			<tool name="draw_point" title="Draw Point" type="internal"
action="draw_point"/>
			<tool name="draw_remove" title="Remove Drawing" type="internal"
action="draw_remove"/>
			<tool name="draw_edit" title="Edit Drawing" type="internal"
action="draw_edit_shapes"/>
			<tool name="draw_edit_attributes" title="Edit Attributes" type="internal"
action="draw_edit_attributes"/>
			<tool name="clear_drawings" title="Clear Drawings" type="internal"
action="clear_drawings" selectable="false"/>
		</drawer>
	</toolbar>
</mapbook>

*My Daerah.map*

MAP
  NAME 'daerah'
  SIZE 800 650
  UNITS meters
  STATUS ON
  EXTENT -142106.613606 -91674.819239 131302.257393 90719.114676
  TRANSPARENT TRUE
  MAXSIZE 10000
  IMAGETYPE PNG
	  
   QUERYMAP
	STATUS ON
	STYLE SELECTED
   END  
	  
   LEGEND
     IMAGECOLOR 255 255 255
     STATUS ON
   END
  
  PROJECTION
	'proj=cass'
	'lat_0=2.121679744444445'
	'lon_0=103.4279362361111'
	'x_0=-14810.562'
	'y_0=8758.32'
	'ellps=GRS80'
	'units=m'
	'no_defs'
  END

  LAYER
    NAME 'daerah'
    DATA './daerah.shp'
    TYPE POLYGON
    STATUS ON
  LABELCACHE ON
 
    CLASS
        NAME 'daerah' 
        STYLE
         WIDTH 0.91 
         OUTLINECOLOR 85 85 127
         COLOR 104 160 87
		 
       END
      END
	    METADATA
	      	'identify_record'	'identify_daerah.html'
	      	'select_record'	'select_daerah.html'
			'popups' 'daerah_popup.html'

			'itemquery'	'daerah_itemquery.html'
			'itemquery-filteritem' 'OBJECTID'
			'itemquery-filter'	'/.*[qstring].*/i' 
			'qstring_validation_pattern' '.'
	   END
END
END



--
View this message in context: http://geomoose-users.964460.n3.nabble.com/error-occur-while-trying-to-make-a-search-function-using-itemquery-php-tp3285645p3285645.html
Sent from the Geomoose-users mailing list archive at Nabble.com.




More information about the Geomoose-users mailing list