[mapserver-users] PHP-Mapscript - clusterObj ?
Chris Green
chris.green at ibstv.co.uk
Mon Jun 20 12:47:09 PDT 2011
Hi Jeff
Thanks. Fame at last...!
However I am still struggling with the combination of clustering and regex filtering. What I can say for sure is that clustering works if no regex filter is applied, and filtering works (using a regex filter in the form "/target/") with no clustering. But I have so far failed to make the two work together.
This is where I am currently (which does not work for me):
$map = ms_newMapobj("/var/www/vhosts/mysite/httpdocs/test.map");
$layer1=$map->getLayerByName("test1");
$layer1->cluster;
$layer1->set("filteritem", "attribute 1");
$layer1->setFilter("/target/");
Any ideas?
Chris
-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jeff McKenna
Sent: 20 June 2011 20:31
To: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] PHP-Mapscript - clusterObj ?
Hi Chris,
I've added your PHP MapScript example to the mapfile's CLUSTER page:
http://www.mapserver.org/mapfile/cluster.html
Thanks!
-jeff
--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/
On 11-06-20 12:58 PM, Chris Green wrote:
> Daniel
>
>
> This works....
>
> $map = ms_newMapobj("/var/www/vhosts/mysite/httpdocs/test.map");
> $layer1=$map->getLayerByName("test1");
> $layer1->cluster;
>
>
> Thanks very much for the help!
>
>
> Chris
>
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Daniel Morissette
> Sent: 20 June 2011 15:26
> To: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] PHP-Mapscript - clusterObj ?
>
> On 11-06-20 10:22 AM, Daniel Morissette wrote:
>> On 11-06-20 10:02 AM, Chris Green wrote:
>>> Hi Tamas
>>>
>>> Thanks for your comment. My first thought was that it should be
>>> available from layerObj, and I spent quite a while trying variations
>>> like:
>>>
>>> $map = ms_newMapobj("/var/www/vhosts/mysite/httpdocs/test.map");
>>>
>>> $layer1=$map->getLayerByName("test1");
>>>
>>> $cluster1=$layer1->getClusterByName(“cluster1”);
>>>
>>> But unfortunately I couldn’t make anything like that work. Anyone know
>>> how this clusterObj works in php-Mapscript?
>>>
>>
>>
>> AFAIK there is only one cluster object per layer, and according to the
>> PHP MapScript source, you should be able to reach it as
>> $layer1->cluster. The same methods as in SWIG MapScript seem to be
>> implemented for the clusterObj in PHP MapScript. If that doesn't work
>> then please let us know and we'll look deeper.
>>
>
> ... and I see that clusterObj is documented in:
>
> http://mapserver.org/mapscript/php/index.html#clusterobj
>
> ... and the ref to the clusterObj in the layerObj is listed in:
>
> http://mapserver.org/mapscript/php/index.html#layerobj
>
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list