Draw point by using phpMapscript(3)
pgiannini at BYTEWISE.IT
Mon Sep 25 09:38:58 EDT 2006
I set the "color" property of the style:
and works well: the point appears on the map
(I don't try, but you can also set the other appearance properties:
outlinecolor, backgroundcolor ...)
> Dear Charlton;
> I have tried many example and also Tried your suggestion But Still I
> got result....
> Dear All;
> I'm asking to the mapserver specialist ' how can I draw point on the map
> point value already variable in the php files
> like $lon,$lat'.
> This following example is the third attempt but still the point doesn't
> appearing on the map.
> Please help me What is the code to draw point on the map by using PHP...
> I have tried the following but still doesn't work. Just Drawing map
> without point.
> $map = ms_newMapObj($map_path."zone.map");
> $map->setExtent($nMinX, $nMinY, $nMaxX, $nMaxY);
> // create a temp layer to hold our points
> $point_layer = ms_newLayerObj($map);
> $point_layer->set("name", "markers");
> $point_layer->set("type", MS_LAYER_POINT);
> $point_layer->set("status", MS_DEFAULT);
> // create a class and style for this layer
> $point_class = ms_newClassObj($point_layer);
> $point_style = ms_newStyleObj($point_class);
> $point_symbol = $map->getSymbolByName("cpoint");
> $point_style->set("symbol", $point_symbol);
> $point_style->set("size", 20);
> // draw our image without the points
> $ref = $map->drawreferencemap();
> $image = $map->draw();
> // initialize our point and add it to the map
> $point = ms_newPointObj();
> $longitude=$lon;// comes from select queries from mysql as a result
> $latitude=$lat;// comes from select queries from mysql as a result
> $point->setXY($longitude, $latitude);
> $point->draw($map, $point_layer, $image, 0, "");
> $ref_url = $ref->saveWebImage();
> On Mon, 25 Sep 2006 07:50:09 -0400, Charlton Purvis wrote
>> > $point=ms_newPointObj($lat, $lon);
>> Perhaps try reversing the parameters,
>> $point=ms_newPointObj($lon, $lat);
>> This message has been scanned for viruses and
>> dangerous content by MailScanner, and is
>> believed to be clean.
> Open WebMail Project (http://openwebmail.org)
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
More information about the mapserver-users