[mapserver-users] rectangle in reference map

Vincent Schut schut at GisSrv.IenD.wau.nl
Wed Jun 5 06:42:41 EDT 2002


Hmm, strange.
I don't see any significant difference between my reference section and the 
one cited below which 'should be sufficient'.
To be sure, I tried with the following:

REFERENCE
	IMAGE "/home/samboja/ms_data/data/reference/sl_ref.png"
	EXTENT 492499.336 9879200.289 502498.366 9890199.289
	COLOR -1 -1 -1
	OUTLINECOLOR 255 0 0
	SIZE 100 110
	STATUS ON
END

The ref image displays OK, but no rectangle appears after zooming in.
I even tried a full recompile/install of the libs (libpng, libgd, libgdal, 
libproj) and mapserver.

Is it something in my php?
essentially, I do the following:
after calculating the new extent (depending on zoomin in/out or panning),
$map->setextent($extent[0],$extent[1],$extent[2],$extent[3]);
$image = $map->prepareImage();
$image = $map->draw();
$ref_image = $map->drawReferenceMap();
and then the necessary stuff to save the temp images and so on.

Did I miss something here?

Vincent.



On Tuesday 04 June 2002 17:52, Pushkar Pradhan wrote:
> #
> # Start of reference map
> #
> REFERENCE
>   IMAGE graphics/reference.png
>   EXTENT 482572 1031082 639981 1151888
>   SIZE 300 232
>   STATUS ON
>   COLOR -1 -1 -1
>   OUTLINECOLOR 255 0 0
> END
>
> Should be sufficient, works fine with standalone CGI as well as mapscript.
> Hope this helps.
>
> > Probably it is something quite stupid.
> > I hesitated to question it here, but it seems my only hope left...
> >
> > I'd like to have a nice red rectangle in my reference map, showing me
> > where I am in the map.
> > I've set up a reference map in the map file, which displays OK. Only no
> > red (neither other color) rectangle appears. Do I need to do something
> > more than just refimage=$map->drawReferenceMap(); ?
> > A rectangle query or something? The mapfile definition page mentions
> > something like that at the reference object, but I can't find anything
> > similar in the php_mapscript object definitions like a queryRectangle
> > method or something similar...
> > All images that I use are png.
> > PHP=4.1.2
> > Mapserver/mapscript = 3.6.0
> >
> > I already tried playing around with the color and outlinecolor items, but
> > nothing happened.
> >
> > Thanks,
> > Vincent.
> > ------------------------------------------------------------
> > Here comes my map file:
> >
> > NAME "samboja"
> > SIZE 400 440
> > STATUS ON
> > EXTENT 492499.336 9879200.289 502498.366 9890199.289
> > UNITS METERS
> > TRANSPARENT ON
> > PROJECTION
> >         "proj=utm"
> >         "ellps=GRS80"
> >         "zone=50"
> >         "south"
> >         "no_defs"
> > END
> > SHAPEPATH "./data"
> >
> >
> > WEB
> >         IMAGEPATH "/home/samboja/ms_tmp/"
> >         IMAGEURL "/samboja/ms_tmp/"
> >         MAXSCALE 70860
> >         MINSCALE 4428
> > END
> >
> >
> > REFERENCE
> >         IMAGE "/home/samboja/ms_data/data/reference/sl_ref.png"
> >         EXTENT 492499.336 9879200.289 502498.366 9890199.289
> >         COLOR 255 0 0
> >         OUTLINECOLOR 255 0 0
> >         SIZE 100 110
> >         STATUS ON
> > END
> >
> >
> > LAYER
> >         NAME "IKONOS2001"
> >         MAXSCALE 70860
> >         MINSCALE 70859
> >         DATA "tilez0/1x1.png"
> >         TYPE RASTER
> >         STATUS ON
> > END
> > LAYER
> >         NAME "IKONOS2001"
> >         MAXSCALE 70859
> >         MINSCALE 35429
> >         TILEINDEX "tilez1_idx.shp"
> >         TILEITEM "Location"
> >         TYPE RASTER
> >         STATUS ON
> > END
> > LAYER
> >         NAME "IKONOS2001"
> >         MAXSCALE 35429
> >         MINSCALE 17714
> >         TILEINDEX "tilez2_idx.shp"
> >         TILEITEM "Location"
> >         TYPE RASTER
> >         STATUS ON
> > END
> > LAYER
> >         NAME "IKONOS2001"
> >         MAXSCALE 17714
> >         MINSCALE 8857
> >         TILEINDEX "tilez3_idx.shp"
> >         TILEITEM "Location"
> >         TYPE RASTER
> >         STATUS ON
> > END
> > LAYER
> >         NAME "IKONOS2001"
> >         MAXSCALE 8857
> >         MINSCALE 4428
> >         TILEINDEX "tilez4_idx.shp"
> >         TILEITEM "Location"
> >         TYPE RASTER
> >         STATUS ON
> > END
> > LAYER
> >         NAME "IKONOS2001"
> >         MAXSCALE 4428
> >         MINSCALE 0
> >         TILEINDEX "tilez5_idx.shp"
> >         TILEITEM "Location"
> >         TYPE RASTER
> >         STATUS ON
> > END
> >
> >
> > LAYER
> >         NAME "TILETEST"
> >         DATA "tilez1_idx.shp"
> >         TYPE POLYGON
> >         CLASS
> >                 COLOR -1 -1 -1
> >                 OUTLINECOLOR 0 200 0
> >         END
> >         STATUS ON
> > END
> >
> >
> >
> > END
>
> -Pushkar S. Pradhan



More information about the mapserver-users mailing list