tecnica:gps_cartografia_gis:php_mapscript_recipes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
tecnica:gps_cartografia_gis:php_mapscript_recipes [2010/02/26 19:28] – niccolo | tecnica:gps_cartografia_gis:php_mapscript_recipes [2010/02/26 23:46] (current) – niccolo | ||
---|---|---|---|
Line 77: | Line 77: | ||
===== Make a query ===== | ===== Make a query ===== | ||
- | Open an existing map file and perform a query-by-rectangle on a layer. | + | Open an existing map file and perform a **query by rectangle** on a layer, print results with a **template**. |
<code php> | <code php> | ||
<?php | <?php | ||
- | |||
$map = ms_newMapObj("/ | $map = ms_newMapObj("/ | ||
- | |||
$selrect = ms_newrectObj(); | $selrect = ms_newrectObj(); | ||
$selrect-> | $selrect-> | ||
Line 120: | Line 118: | ||
<!-- MapServer Template --> | <!-- MapServer Template --> | ||
< | < | ||
+ | </ | ||
+ | |||
+ | This example does not use the template, it **iterates through the query results**: | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | $map = ms_newMapObj("/ | ||
+ | $selrect = ms_newrectObj(); | ||
+ | $selrect-> | ||
+ | |||
+ | $map-> | ||
+ | $layer = $map-> | ||
+ | $count = $layer-> | ||
+ | |||
+ | print "Query result count: " . $count . "< | ||
+ | print "< | ||
+ | for ($i = 0; $i < $count; $i++) { | ||
+ | $qRes = $layer-> | ||
+ | print_r($qRes); | ||
+ | } | ||
+ | print "</ | ||
+ | ?> | ||
</ | </ |
tecnica/gps_cartografia_gis/php_mapscript_recipes.txt · Last modified: 2010/02/26 23:46 by niccolo