Drawing points and lines dynamically
sc at BYTRON.COM
Fri Apr 15 05:19:39 EDT 2005
I am trying to plot a point at logitude 0.0, latitude 54.0 (somewhere in the
UK), I am using
mapscript/PHP but nothing appears on my map (no circle and no label).
Below is the PHP code that should be displaying the point. The map is
loading ok as I have a
map of the UK and various other layers in my map file that I can switch on
and off with no problems.
One thing that I am confused about is to whether or not the layer that I
want to create the point
on has to be already defined in the map file or whether the code below
actually creates a 'dynamic'
$layer = ms_newLayerObj($map);
$class = ms_newClassObj($layer);
$class->label->color->setRGB(255, 0, 0);
$symbol = $map->getSymbolByName("circle");
$style = ms_newStyleObj($class);
$style->color->setRGB(255, 0, 0);
$image = $map->draw();
$point = ms_newPointObj();
$point->draw($map, $layer, $image, 0, "test");
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.11 - Release Date: 14/04/2005
More information about the mapserver-users