[Cartoweb-users] Queries on layers using mapoverlay
Fabio D'Ovidio
fabiodovidio at gmail.com
Thu Mar 20 12:00:37 EDT 2008
I've read here: /plugins/mapOverlay/common/MapOverlay.php
I can't set "template" parameter for my layer dinamically .... but I've
set it in my project map file....
/**
* LayerOverlay
* @package Plugins
*/
class LayerOverlay extends BasicOverlay {
/**
* @var array array of ClassOverlay
*/
public $classes;
/**
* @var string
*/
public $connection;
/**
* @var string
*/
public $connectionType;
/**
* @var string
*/
public $copyName;
/**
* @var string
*/
public $data;
/**
* @var string
*/
public $filter;
/**
* @var string
*/
public $filteritem;
/**
* @var string
*/
public $maxScale;
/**
* @var array array of MetadataOverlay
*/
public $metadatas;
/**
* @var string
*/
public $minScale;
/**
* @var string
*/
public $name;
/**
* @var int
*/
public $transparency;
/**
* @var string
*/
public $type;
/**
* @see CwSerializable::unserialize()
*/
public function unserialize($struct) {
$this->classes = self::unserializeArray($struct, 'classes',
'ClassOverlay');
$this->connection = self::unserializeValue($struct,
'connection');
$this->connectionType = self::unserializeValue($struct,
'connectionType');
$this->copyName = self::unserializeValue($struct, 'copyName');
$this->data = self::unserializeValue($struct, 'data');
$this->filter = self::unserializeValue($struct, 'filter');
$this->filteritem = self::unserializeValue($struct,
'filteritem');
$this->maxScale = self::unserializeValue($struct, 'maxScale');
$this->metadatas = self::unserializeObjectMap($struct,
'metadatas',
'MetadataOverlay');
$this->minScale = self::unserializeValue($struct, 'minScale');
$this->name = self::unserializeValue($struct, 'name');
$this->transparency = self::unserializeValue($struct,
'transparency',
'int');
$this->type = self::unserializeValue($struct, 'type');
parent::unserialize($struct);
}
}
Oliver Christen ha scritto:
> well, the layer should be queryable during the time of a session,
> meaning until the user close his browser. I see no reason why it
> wouldnt be queryable, unless you forgot to set a
> TEMPLATE='ttt_or_whatever' in the layer definition
>
> if you wany to keep the added from one session to another, you need to
> modify your plugin to store the added layers in database or someting
> like that add reload theses layer automaticaly if they dont already
> exist.
>
>> Hi!
>> I've update dinamically one layer using mapoverlay as described here:
>>
>>
>> 3.2.3. Filter data
>>
>> $layer = new LayerOverlay();
>> $layer->name = "field";
>> $layer->data = "geom FROM (SELECT gid, geom, name FROM fields WHERE
>> farm_id = {$farmId}) " .
>> "AS foo USING UNIQUE gid USING SRID=-1";
>> $mapOverlay =
>> $this->serverContext->getPluginManager()->mapOverlay;
>> $mapOverlay->updateMap($layer);
>>
>>
>>
>> Now, i want to query this layer and display the result.
>> Query doesn't work because the modification are not saved in the
>> project's mapfile: the result of the mapfile modifications are
>> specific to a session.
>> My debug map file is debug.map.
>>
>> $pluginManager = $this->serverContext->getPluginManager();
>> if (empty($pluginManager->mapOverlay))
>> throw new CartoserverException("mapOverlay plugin not
>> loaded, "
>> . "and needed to draw
>> the new element");
>> $pluginManager->mapOverlay->updateMap($layer);
>> $this->serverContext->getMapObj()->save('C:/debug.map');
>>
>>
>>
>>
>> How can I do to query my updated layer?
>>
>>
>> Thanks
>>
>> --
>> Ing. Fabio D'Ovidio
>>
>> iQuadro - Informatica e Innovazione s.r.l.
>> Via C. Pisacane 23, Aversa (CE) - 81031
>> Web : www.ii2.it
>> Tel.: 081 197 57 600
>> mail: fabiodovidio at gmail.com
>>
>> _______________________________________________
>> Cartoweb-users mailing list
>> Cartoweb-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>
>
>
--
Ing. Fabio D'Ovidio
iQuadro - Informatica e Innovazione s.r.l.
Via C. Pisacane 23, Aversa (CE) - 81031
Web : www.ii2.it
Tel.: 081 197 57 600
mail: fabiodovidio at gmail.com
More information about the Cartoweb-users
mailing list