I use zoom_to_box and it works for me. The only other option I can see 
is to pan and zoom to a specific point and zoom level. But I don't feel 
it gives me enough control.

If the bounding box in the envelope does not match the proportions of 
your image (900 x 450) then the box is expanded in the longer direction. 
You can then use env = myMap.envelope() to get the actual envelope used.

You could always write your own function to take a single coordinate for 
the center and a scale denominator then construct an envelope from those 
values.

Andy

Balram wrote:
> Hi friends,
> 
> I have created python script to render map using mapnik. I have done basic
> map operation like pan to left, right,top, bottom. I have also done zoom to
> map.
> 
> But I am not able to zoom at particular latitude longitude values. I don't
> want to use Envelope() which takes four parameter. 
> 
> My code is as below:
> 
>     myMap = Map(900,450,"+proj=latlong +datum=WGS84")
>     p = Projection("+proj=latlong +datum=WGS84")
>    
> myMap.zoom_to_box(p.forward(Envelope(52.132633,5.291266,52.182633,5.361266)))
>     myMap.zoom(0.4)    
>     render_to_file(myMap,"proj.png","png")
> 
> Please help me. 
> Any help would be greatly appreciated!!!
> Thank You!!!
> 
> BalRam

-- 
Andy
PGP Key ID: 0xDC1B5864
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to