Display map with specified point in cen ter

Miroslav Šulc miroslav.sulc at STARTNET.CZ
Thu Dec 16 09:59:33 EST 2004


Thank, you, Eric, for both mails. I think it wouldn't be a problem to
rewrite it in PHP. Thank you very much.

Miroslav Šulc


Eric Bridger wrote:

>Yes this can be done with Mapscript. Unfortunately I'm not sure of the
>PHP syntax, but here is a Perl Mapscript example. The trick here is
>getting an image object and doing the drawing yourself using
>pointObj->draw().
>
>my $map = new mapscript::mapObj("simple_points.map");
># create an image for drawing.
>my $img = $map->draw();
>my $layerObj = $map->getLayerByName('points');
>my $point = new mapscript::pointObj();
>$point->{x} = $longitude;
>$point->{y} = $latitude;
>my $label =  "The label";
>$point->draw($map, $layerObj, $img, undef, $label);
># To display labels.
>$map->drawLabelCache($img);
>$img->save("/tmp/map.png");
>
>############### Map file fragment
>LAYER
>  NAME "points"
>  TYPE POINT
>  STATUS ON
>  TOLERANCE 10
>  # Need fake template for querys to work
>  TEMPLATE "bogus.html"
>  CLASS
>    NAME "buoy"
>    STYLE
>      SYMBOL "circle"
>      SIZE 10
>      COLOR 255 0 0
>      OUTLINECOLOR 0 0 0
>    END
>    LABEL
>      COLOR 255 0 0
>      TYPE BITMAP
>      SIZE MEDIUM
>      POSITION AUTO
>      PARTIALS FALSE
>      BUFFER 2
>    END # end of label
>  END
>  PROJECTION
>    "proj=latlong"
>  END
>END
>
>
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: miroslav.sulc.vcf
Type: text/x-vcard
Size: 387 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20041216/e160ba6a/miroslav.sulc.vcf


More information about the mapserver-users mailing list