[maplab-users] Query Object on Map

Adriano Hantequeste Gomes adrianohg at gmail.com
Thu Jan 11 14:00:07 EST 2007


Hi All,

I change the code:

// Adriano hantequeste Gomes - 11/jan/07
//
// Consulta Objeto
//
//

if ($http_form_vars["nome_b"]) 	{

	$bairro = $http_form_vars["nome_b"];
	$oextent = $oMapSession->oMap->extent;
	$capa = $oMapSession->oMap->getLayerByname("Bairros");
	// ("Capa" is a Layer Object)
	$capa->queryByAttributes("NOME_BAIRR",$bairro,MS_SINGLE);

	if ($capa->getNumResults() > 0)
	{
		echo "Encontrou";
		$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 - 350;
		$nmaxx = $oextent->maxx + 350;
		$nminy = $oextent->miny - 275;
		$nmaxy = $oextent->maxy + 275; //  (My Map have a  extent = 700 x 550 pixels)
		$oextent->setextent($nminx,$nminy,$nmaxx,$nmaxy);
	}

	$oMapNavigator->zoomRectangle($oextent->minx,$oextent->miny,$oextent->maxx,$oextent->maxy);

}



I find the record on shape but retry this error:

Encontrou
Fatal error: [MapServer Error]: msCalculateScale(): Invalid image
extent, minx=384426.000000, miny=7740866.107143, maxx=384426.000000,
maxy=7740866.107143. in
D:\ms4w\apps\maplab-2.2.1\projects\gmf_apps\Geo\wrapper\map_navigator.php
on line 341

-- 
Atenciosamente,
Adriano Hantequeste Gomes
CREA 080047648-4
Departamento de Geoprocessamento - GEO
Gerência de Estatística e Analise Criminal - GEAC
Secretaria de Estado da Segurança Pública e Defesa Social - SESP
Av. Marechal Mascarenhas de Moraes, 2355
Bento Ferreira - Vitória - Espírito Santo
CEP: 29.052-121
Telefone: 55 27 3334-4736
Fax:       55 27 3334-4735
Celular:   55 27 9225-4852



More information about the Maplab-users mailing list