[Mapserver-users] Need Urgent Help on PHP/MapScript >> ms_newPointObj()

Merlos merlos at tsc.uvigo.es
Mon Jul 19 13:51:55 PDT 2004


Try this. It works for me.

<?php

$my_map= ms_newMapObj('data/test2.map');

$pt = ms_newPointObj();
$pt-> setXY(5,5);
$img = $my_map->draw();
//Inline is a POINT layer.
$layer = $my_map->getLayerByName('INLINE');
$pt->draw($my_map, $layer, $img, 0 ,'yuhuu');


$url = $img->saveWebImage();

echo "<img src=\"$url\" alt=\"Yuhuu!\" />";

?>

Regards. Merlos.


On Monday 19 July 2004 17:52, Ishrar Hussain wrote:
> Please give me an example code showing how to use
> PointObj class, i.e. ms_newPointObj(), to dynamically
> draw a point over an already created instance of
> MapObj, which have been instantiated with a static
> .map file.
>
> Using Maplab, I have created my web mapping
> application, which successfully published my shape
> files in 4 layers. The map is now static. And over
> this map, I need to draw with PHP/MapScript a new
> layer that will hold one dynamic point, whose
> coordinates I will be retrieving from a database using
> PHP. (I am editing the drawmap.php file in the wrapper
> folder for this.)
>
> Note that, I don't want to have this new layer
> definition in my map file, which will make the layer
> static. I also cannot use any database connection in
> the mapfile (postgis or postgre or mygis). Thus,
> PHP/MapScript's PointObj is my only choice.
>
> So, if possible, let me know whether PointObj can be
> used to dynamically draw a point like this over a
> MapObj, which is already instantiated with a map file
> having 4 layer definitions.
>
> Any detailed example code showing how to use PointObj
> will do.
> Thank you.
>
> - Ishrar
>
>
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Vote for the stars of Yahoo!'s next ad campaign!
> http://advision.webevents.yahoo.com/yahoo/votelifeengine/
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

-- 
--
http://www.merlos.biz



More information about the MapServer-users mailing list