[mapserver-users] CGI script - MAP NOT CHANGING SCALE
Lowell Filak
lfilak at medinaco.org
Mon May 20 06:38:47 PDT 2002
Can you forward the set_extent subroutine?
Lowel F.
The following message was sent by "Marie Flanagan" <theflan at gofree.indigo.ie> on Sat, 18 May 2002 11:02:35 +0100.
> Hi list,
>
> I have a problem with a CGI script - with zooming in/out.
> 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?
>
> 2 of my layers are being created on the fly from a flat file. One of > the 'dynamic' layers is a shape and is added as a feature to the layer, > the other is a set of points and labels.
>
> Help gratetfully received - as I am driven demented with this problem!
>
> 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++;
> }
>
More information about the MapServer-users
mailing list