[Geomoose-users] Couple of questions

Brent Fraser bfraser at geoanalytic.com
Fri Jul 10 11:28:07 EDT 2009


Antonio,

t faustino wrote:
> GeoMoose v1.6.1
> 
> On parcel search: I added a parcel and simply replaced the demo
> shapefile of the same name; I know my parameters within my parcel are
> not the same and I get this error on Search;
> 
> loadMap(): Web application error. Parameter 'id' value fails to
> validate. msEvalRegex(): Regular expression error. String (83a-78)
> failed expression test.

The Search is enabled in your xml, something like:
   <service title="Search for Parcels by PIN" selectable="false" default="false" 
locked="true" div="pinsearch">
     <url>/cgi-bin/mapserv.exe</url>
     <input type="hidden" name="map" value="./itemquery.map"/>
     <input type="hidden" name="mode" value="nquery"/>
     <input type="hidden" name="layer" value="Parcels"/>
     <input type="user" name="id" title="Zoom to Parcel#:"/>
   </service>

This points to div="pinsearch" in your html:

   <div id="pinsearch">
     <font color="black"><b>Search for Parcel by PIN:</b></font><br/>
     <input name="id"/><input type="submit" value="Search"/>
     <input type="hidden" name="map" 
value="/ms4w/apps/GeoMOOSE/maps_countydemo/itemquery.map"/>
     <input type="hidden" name="mode" value="nquery"/>
     <br><i>Enter part of PIN# (begins with search).<i/>
   </div>

(note the <input name="id"/> )

The value the user types into to the input text box (the one with the name "id") 
gets passed to mapserver as
id=1234 (if the user typed in "1234").  When mapserver parses the map file 
(itemquery.map), it looks for %% strings and looks for CGI parameters with the 
same name as the text between the %% ans substitutes the CGI value.  In the 
itemquery.map:

     FILTERITEM 'PIN'
     FILTER /^%id%/  #begins with search regular expression

mapserver would parse and consider it to be

     FILTERITEM 'PIN'
     FILTER /^1234/  #begins with search regular expression

In your case, it sounds like mapserver's regular expression parser doesn't like 
the text.  Perhaps editing the itemquery.map file to add single quotes around 
the FILTER value would help:

     FILTERITEM 'PIN'
     FILTER '/^%id%/'  #begins with search regular expression


> 
> What is the Parameter 'id' referring to?
> 
> Can someone quickly run down how to add popups?

Not that I've tried this but from the Countydemo it looks like:

To configure:
--------------
1. Add popups="true" to the layer definition in the xml
2. Add query info to layer's map file:

   WEB
     QUERYFORMAT "text/xml"		
     INCLUDE "../temp_directory.map"
   END
and
   HEADER   'imagemap_header.xml'
   TEMPLATE 'imagemap_record.xml'
   FOOTER   'imagemap_footer.xml'

3. Create/edit xml template files (listed above) to use your attributes

To use:
--------
1. Click on the flag icon beside the layer name in the Map Layers panel
2. Select the Pan operation from the toolbar (some others will work too) and 
move the mouse over the feature on the map.

The formatted text will"pop-up" on the cursor.


> 
> I know from reading that a popups="true" need be in the
> configuration.xml but where is the popup reading from? mapfile? a
> separately created xml page?
> 
> Labels seems to be giving me problems; I simply can't get labels to
> show; I know this is more of a mapserver issue but if someone could
> tell me if labeling is a known issue/bug in GeoMoose.

I use labels all the time, so its not a problem with GeoMoose.

Best Regards,
Brent Fraser




More information about the Geomoose-users mailing list