[maplab-users] Search objects in a map

Jeff McKenna jmckenna at dmsolutions.ca
Sun Oct 31 17:24:24 EST 2004


Hello,

I think you're having a hard time getting help on this list because you 
are asking about very detailed functionality with 
phpmapscript/mapserver.  You will find more help on the main mapserver 
list (http://lists.umn.edu/archives/mapserver-users.html) where the 
developers of mapserver and phpmapscript could probably help you.
Sorry.

jeff




publi at infonegocio.com wrote:
> 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
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Maplab-users mailing list
> Maplab-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/maplab-users


-- 
Jeff McKenna
GIS Specialist
DM Solutions Group Inc.
http://www.dmsolutions.ca



More information about the Maplab-users mailing list