[maplab-users] Search objects in a map

publi at infonegocio.com publi at infonegocio.com
Fri Oct 29 12:18:28 EDT 2004


Hi all,
    I'm still working in search object in a map. I have added the next 
code to MyApp.php (../gmf_apps/MyApp/MyApp.php) :
       if ($http_form_vars["nombre"])
        {
            $nombre = $http_form_vars["nombre"];
            $oextent = $oMapSession->oMap->extent;
            $capa = $oMapSession->oMap->getLayerByname("puntos");  
("Capa" is a Layer Object)
            $capa->queryByAttributes("NOMCALLE",$nombre,MS_SINGLE);
            if ($capa->getNumResults() > 0)
            {
                echo "Ha encontrado";
                $oresult = $capa->getResult(0);
                 // oresult is a ResultCacheMemberObj 
<http://mapserver.gis.umn.edu/doc42/phpmapscript-class-guide.html#result>
                $capa->open();
                $oshape = 
$capa->getShape($oresult->tileindex,$oresult->shapeindex);
                $oextent = $oshape->bounds;
                $oshape->free();
                //New Extent to show
                $nminx = $oextent->minx - 300;
                $nmaxx = $oextent->maxx + 300;
                $nminy = $oextent->miny - 200;
                $nmaxy = $oextent->maxy + 200;   (My Map have a extent = 
600 x 400 pixels)
                $oextent->setextent($nminx,$nminy,$nmaxx,$nmaxy);
      }
     
$oMapNavigator->zoomRectangle($oextent->minx,$oextent->miny,$oextent->maxx,$oextent->maxy);
}

At first sight everything works, but always I obtain the same error in 
map_navigator.php:

*Fatal error*: [MapServer Error]: msCalculateScale(): Invalid image 
extent, minx=429849.430340, miny=4466350.489920, maxx=429849.430340, 
maxy=4466350.489920. in 
*/home/javi/maplab-2.2/projects/gmf_apps/MyApp/wrapper/map_navigator.php* 
on line *341

*What's Wrong??????
And on the other hand, the single searches are made in the present View, 
How Can i search in all the map, although there are parts that are not 
shown?
Thanks all.

My System:

    MapServer 4.2.5
    MapLab 2.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/maplab-users/attachments/20041029/a8658a56/attachment.htm


More information about the Maplab-users mailing list