[Geomoose-users] Best way to refresh in GM?
Brent Fraser
bfraser at geoanalytic.com
Wed Oct 31 14:33:55 PDT 2012
Bob,
Your code won't do anything; it sets the FILTER for that execution of
PHP, sends some XML, then exits. Whatever you get PHP to do is not
persistent between executions (unless it writes a file).
It depends on your intended workflow, etc...
Best Regards,
Brent Fraser
On 10/31/2012 3:12 PM, Bistrais, Bob wrote:
>
> Thanks Brent,
>
> I looked at the documentation and tried to incorporate this, but not
> getting the filter to work. Maybe it will help if I include code.
> Some of it is hard coded for testing (for instance, town name is hard
> coded now). The Filteritem is defined in the .map file as "TOWN",
> it's an ESRI File GDB. The town I want to select is Acton:
>
> $layerName = "parcels";
>
> //Reset the parcel layers definition query to only the chosen town
>
> $file = $CONFIGURATION['root']."parcelsSql.map";
>
> $map = ms_newMapObj($file);
>
> $pLayer = $map->getLayerByName($layerName);
>
> //$pLayer->setFilter('[TOWN]' == 'Acton');
>
> $pLayer->setFilter('Acton');
>
> header('Content-type: text/xml');
>
> print "<results>";
>
> print "<script><![CDATA[
>
> GeoMOOSE.refreshLayers('parcels/parcels');
>
> alert('I also made an alert!');
>
> ]]></script>";
>
> print "<html><![CDATA[";
>
> print '<body>';
>
> print '<h3> you selected:</h3>';
>
> print $town;
>
> print '<br/>';
>
> print '</body>';
>
> print "]]></html>";
>
> print "</results>";
>
> *From:*Brent Fraser [mailto:bfraser at geoanalytic.com]
> *Sent:* Wednesday, October 31, 2012 4:50 PM
> *To:* Bistrais, Bob
> *Cc:* geomoose-users at lists.osgeo.org
> *Subject:* Re: [Geomoose-users] Best way to refresh in GM?
>
> Bob,
>
> Have a look at the delivered PHP scripts in your Geomoose htdocs/php
> directory (especially the end of select.php), and at
> http://www.geomoose.org/docs/services.html
>
> Basically you have your PHP send GeoMOOSE API calls (as JavaScript),
> wrapped in the very excellent GeoMOOSE Service Communication
> Protocol, specifically a
>
> GeoMOOSE.refreshLayers("my_mapsource/mylayer")
>
> I can't seem to find a link to the API on the GeoMoose site, but you
> can have a look at
> http://www.geomoose.org/trunk/api/files/geomoose-js.html
>
>
> Best Regards,
> Brent Fraser
>
> On 10/31/2012 2:05 PM, Bistrais, Bob wrote:
>
> I'm putting together a service in which I hope to dynamically
> filter a MapServer layer. I think I've got the PHP code set so I
> can set the filter on the layer. Question is, what's the best way
> to command a redraw so that my filtered layer shows up properly?
>
>
>
>
> _______________________________________________
>
> Geomoose-users mailing list
>
> Geomoose-users at lists.osgeo.org <mailto:Geomoose-users at lists.osgeo.org>
>
> http://lists.osgeo.org/mailman/listinfo/geomoose-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20121031/1bafc285/attachment-0001.html>
More information about the Geomoose-users
mailing list