Dynamic Point

riteshambastha ritesh.linux at GMAIL.COM
Wed Jan 23 16:36:15 EST 2008


Dear friend, 

Follow this: 

Add this layer in your map file:

LAYER
  NAME selpoint
  TYPE POINT
  TRANSPARENCY 0
  STATUS DEFAULT
  PROJECTION
    "init=epsg:4326" #lon/latwgs84
  END
 
  CLASS
    NAME "selpoint"
    STYLE
      SYMBOL '/ms4w/apps/partners/images/bubble.png' #path where you will
keep the marker image
    END
    LABEL #defines the font, colors etc. of the text
		      FONT vera
		      TYPE TRUETYPE
		      SIZE 8
		      BUFFER 1
		      COLOR 178 34 34
		      POSITION AUTO
		     BACKGROUNDSHADOWCOLOR 41 41 41
		     BACKGROUNDSHADOWSIZE 3 3 
		    END
  END
END 


Add this in your php file: 

$layer_name = "selpoint"; //layer name, in above snippet layer name is
'selpoint'
$point = ms_newPointObj();
$point->setXY($longitude,$latitude);
$line = ms_newLineObj();
$line->add($point);
$feature = ms_newShapeObj(0);
$feature->set('text', 'abcd');
$feature->add($line);
$layer = $map->getLayerByName($layer_name);
$layer->addFeature($feature);
$layer->set("transparency", 1000);

This is all ! You are done !

Cheers,
Ritz


tamajayus wrote:
> 
> i want to add some in my map, this point can be added by user in php and
> store in database....
> i'm using phpmapscipt to create my map.. is there any way that i could add
> point in my map????
> i've tried used pointObj() but i still can't used it..
> 

-- 
View this message in context: http://www.nabble.com/Dynamic-Point-tp14916276p15053161.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list