[maplab-users] PhpMapScript- setExtent problem - URGENT
Paul Spencer
pagameba at magma.ca
Thu Jun 24 07:46:41 EDT 2004
$dx = abs(($rect->maxx - $rect->minx) * 0.1);
$dy = abs(($rect->maxy - $rect->miny) * 0.1);
$rect->setExtent( $minx - $dx, $miny - $dy, $maxx + $dx, $maxy + $dy );
this should work (untested)
Cheers,
Paul
Swapan Mazumdar wrote:
> I am trying to implement zoom to feature. Infact I can easily do that.
> But the problem is the zoom to (Polygon feature) fits the map extent
> full and no breathing space is left around it. How can I implement this.
> Pl. look at the code:
>
>
>
> $shpObject = $layerObj->getShape(-1,
> intval($http_form_vars["searchIndex"])); //returns chape object
>
> $rect = $shpObject->bounds; //returns enclosing rectangle
>
> $oMap->setExtent($rect->minx, $rect->miny, $rect->maxx, $rect->maxy); //
> HERE I NEED SOME HELP.
>
>
>
> What calculations are needed to zoom out by 10%. Unfortunately map
> object’s nZoomFactor doesn’t take values in fractions.
>
> Your quick pointers will help me a lot, its kindda urgent.
>
>
>
> TIA
>
> Swapan Mazumdar
>
> Durban, South Africa
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Maplab-users mailing list
> Maplab-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/maplab-users
--
-----------------------------------------------------------------
|Paul Spencer pspencer at dmsolutions.ca |
|-----------------------------------------------------------------|
|Applications & Software Development |
|DM Solutions Group Inc http://www.dmsolutions.ca/|
-----------------------------------------------------------------
More information about the Maplab-users
mailing list