[mapserver-users] Extent and map size; Help needed

Marie Flanagan theflan at gofree.indigo.ie
Thu May 16 06:32:32 EDT 2002


Hello all,

I have a problem with a CGI script - in zooming in/out.  I am drawing layers from a map file, 2 of the layers being created on the fly from a flat file of point labels and co-ordinates.  One of the 'dynamic' layers is a line shape and can be added as a feature to the layer, the other is a set of points and labels, each of which has to be drawn separately (there may be another way of doing it but I haven't discovered it yet).
My set_extent subroutine seems to work in that the map extent is changed, but when the map is drawn it presents as a little map in the top left hand corner if I am zooming in - it's like the exent is working but the scale of the map is not changing.  What am I missing?

Thanks in anticipation of any help offered.

Regards

Marie


Extract from the code:

&set_extent($zoomdir, $zoomsize, $imgx, $imgy, @image_extent);

$shape_layer->addFeature($shape);
$shape_layer->close();

# Now draw all the map layers.  Point layer with labels will be drawn separately after this
for my $i (0 ..($map->{numlayers}-1))
{ 
   my $layer = $map->getLayer($i);
   $success = $layer->draw($map, $image);
   print DBG "Drew layer $layer->{name} --------- $i ------ $success\n"; 
}

$num_stops = @stops_list -1;
for my $i (0 .. $num_stops)
{
   $display_count = $i + 1;
   my ($x, $y, $desc) = split(/\t/, $stops_list[$i]);
   if ($i==0) { $desc="[ $display_count ] START," . $desc; }
   if ($i== ($num_stops)) { $desc = "[ $display_count ] FINISH," . $desc; }
   if ($i > 0 && $i < ($num_stops)) { $desc = "[ $display_count ]"; }
   print DBG "$stops_list[$i] ... $i ... $desc \n";
   $draw_pt1=new pointObj();
   $draw_pt1->{x} = $x;
   $draw_pt1->{y} = $y;
   $draw_pt1->draw($map, $pt_label, $image, undef, "$desc"); 
   $draw_pt2=new pointObj();
   $draw_pt2->{x} = $x;
   $draw_pt2->{y} = $y;
   $draw_pt2->draw($map, $pt_layer, $image, undef, undef); 
   $i++;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020516/02979d03/attachment.html


More information about the mapserver-users mailing list