[mapserver-users] Query and template files

Michel M. dos Santos michel at omnisystem.com.br
Thu Feb 21 15:14:01 EST 2002



	Thanks Erwin,

	I have another question:

	I want to do a search, for example, by name of the streets. In my html page 
I put a form for the user write the street he wants to search. The street is 
localized and displayed in the map. I need to search the record in dbf file 
and after in shape file ? I now the relation between dbf file and shape file 
are done by record number, correct ?

[]'s
Michel M. dos Santos



Em Qua 20 Fev 2002 05:18, Azimuth, Erwin Perik escreveu:
> Hi Michel,
>
> In the GMAP version the query (by button) is retreiving information
> according to METADATA set in your layers.
>
> Basicly it goes like this:
>
>
> 1) GMap75CheckClick() --> checks user input on the rosa-map, eg zoom-in
> zoom-out, pan, query.
> 2) When query button is used and then user clicks on map it uses following:
>
> else if ($HTTP_FORM_VARS["CMD"] == "QUERY_POINT")
>
> a) here it checks if point or rectangle is used
> b) pixel-coords are then translated to geo-coords
> c) query:
>          * @$gpoMap->queryByPoint($oClickGeo, MS_SINGLE, -1);    <--
> queries the map (single point)
>          * @$gpoMap->queryByRect($oGeorefRect);  <-- queries the map
> (rectangle)
> d) $gbShowQueryResults = TRUE;  <-- query is used
> e) it now reloads gmap.php
> f) in gmap.php you see:   <?php GMapDumpQueryResults(); ?>
> g) this uses the function GMapDumpQueryResults()
> h) In your map-file, it checks for the following in every layer:
>        METADATA
>          "DESCRIPTION"   "PrintedDescription"
>          "RESULT_FIELDS" "FIELD ANOTHER_FILED"    # Field names of you
> .dbf-file
>        END
> i) if it finds metadata it passes it to the main file (gmap.php)
> j) also any found objects are now highlighted in the main map
> * Every time gmap.php is loaded it uses the function GMapDrawMap() :
>
>      if ($gbShowQueryResults)    // <-- found objects, so drawQuery,
> highlights the objects
>          $img = $gpoMap->drawQuery();
>      else                        // <-- nothing found, draw normal map
> (nothing changes)
>          $img = $gpoMap->draw();
> k) General info: certain Variables (like $gpoMap) are set to global to use
> for other functions
>
>
> You now can add features like:
> NewExtent --> map zooms in to the rectangle you used for query based on the
> geo-coords of the rectangle
>
> I never got into the CGI stuff cause i loced the combination of Mapscript
> and Rosa, so sticking with that.
>
> Good luck,
>
> Erwin
>
> At 15:08 19-2-02 -0300, Michel M. dos Santos wrote:
> >         Hello ,
> >
> >         In the example of Itasca , with cgi mode the queries are done by
> > templates
> >files. With the example of gmap , with mapscript/php are done other way.
> > I'm confused with this.
> >
> >         Somebody can help me ?
> >
> >[]'s
> >Michel M. dos Santos
>
> =================
> Azimuth Geodetic
> Koldingweg 8
> 9723 HK Groningen
> tel. 050-5493454
> fax. 050-5497217
> =================
> www.azimuth.nl
> perik at azimuth.nl
> =================



More information about the mapserver-users mailing list