[MAPSERVER-USERS] insertLayer()
Hans Castorp
hanscastorp76 at yahoo.es
Tue Jul 1 02:29:04 PDT 2008
Hi Guillaume, thanks for your help,
This is the code I'm using in order to create a new points layer (with only one point):
$oMap = ms_newMapObj($szMapFile);
$oPuntoSeleccionado= ms_newLayerObj($oMap);
$oPuntoSeleccionado->set("name", "EMPRESAS_ALT");
$oPuntoSeleccionado->set("type", MS_LAYER_POINT);
$oPuntoSeleccionado->set("status", MS_ON);
$oCoordenadas=ms_newLineObj();
$oShapePuntos=ms_newShapeObj(MS_SHAPE_POINT);
$oCoordenadas->addXY($x, $y);
$oShapePuntos->add($oCoordenadas);
$oPuntoSeleccionado->addFeature($oShapePuntos);
$oClase=ms_newClassObj($oPuntoSeleccionado);
$oEstiloPunto=ms_newStyleObj($oClase);
$oEstiloPunto->set("symbolname", "MARKER_EMPRESA_ALT");
$oEstiloPunto->set("text", "");
But I have no results. No errors but no success too.
P.S. I'm trying to add this funcionallity to a Ka-map based application.
Thanks in advance.
-----Mensaje original-----
De: Guillaume Sueur [mailto:guillaume.sueur at neogeo-online.net]
Enviado el: martes, 01 de julio de 2008 10:16
Para: Hans Castorp
CC: mapserver-users at lists.osgeo.org
Asunto: Re: [MAPSERVER-USERS] insertLayer()
I guess you just need a new LayerObj, as described in the
mapscript
documentation
(http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class)
:
Layer Objects can be returned by the MapObj class, or can
be created
using:
layerObj
ms_newLayerObj(MapObj map [, layerObj layer])
A second
optional argument can be given to ms_newLayerObj() to create
the new layer
as a copy of an existing layer. If a layer is given as
argument then
all members of a this layer will be copied in the new
layer created.
You can then play with :
boolean moveLayerUp(int layerindex)
Move layer
up in the hierarcy of drawing.
boolean
moveLayerDown(int layerindex)
Move layer
down in the hierarcy of drawing.
array getlayersdrawingorder()
Return an
array containing layer's index in the order which they
are drawn.
boolean setlayersdrawingorder(array layeryindex)
Set the
layer's order array. The argument passed must be a valid
array with
all the layer's index.
Return
TRUE on success or else FALSE.
to set your layer's correct place into the map.
Hope that helps,
Guillaume
Hans Castorp a écrit :
> Hi to all,
>
> If map->insertLayer() isn't available in php
mapscript, how can I insert
> a runtime created layer using php mapscript???
>
> Thanks in advance.
>
> Hans Castorp.
>
>
>
------------------------------------------------------------------------
>
> Enviado desde Correo Yahoo!
> <http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52431/*http://es.docs.yahoo.com/mail/overview/index.html>
> La bandeja de entrada más inteligente.
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
>
http://lists.osgeo.org/mailman/listinfo/mapserver-users
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 270.4.3/1527 - Release
Date: 30/06/2008 18:07
______________________________________________
Enviado desde Correo Yahoo! La bandeja de entrada más inteligente.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080701/e28adeb5/attachment.htm>
More information about the MapServer-users
mailing list