[OpenLayers-Users] Styling OpenLayer.Control.AgsQueryTask
Frank
eucloid at gmail.com
Tue Aug 17 19:30:51 EDT 2010
Hi,
Problem mostly solved... I finded out where it gets drawed:
AgsControl.js, line 457:
if(this.displayResults === true) {
this.showResults();
}
then it does
this.layer.addFeature(this._resultFeatures);
So I guess the solution if I wanted custom style would be to add a styleMap
to this.layer? (in my case I'll just set displayResults = false).
Thanks,
Francois
On Tue, Aug 17, 2010 at 6:50 PM, Frank <eucloid at gmail.com> wrote:
> Hi,
>
> I'm already able to style a layer, using the styleMap.
>
> But what I really want to do is when I do a esri query for all STATES (in
> United States), to just get the list of features in the callback and do any
> drawing myself. What it does right now is that it draws by default a
> semi-opaque orange layer over all the returned features (states), and I
> don't know where this comes from.
>
> The AgsQueryTask comes from august's sandbox, but I guess there already
> exists a solution to style an OpenLayer.Control query result.
>
> So that's my question! Example and code is below:
>
> My work area if you want to see some js code is:
> http://oligny.com/unitedstates_rev3.php
>
> And the code in which I want to modify the style would be line 214
> g_agsQueryTask = new OpenLayers.Control.AgsQueryTask("
> http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/2",
> null,
> [
> statesCallback
> ],
> {} // <-- I already tried a styleMap in there.. .no changes.
> );
> map.addControl(g_agsQueryTask);
> g_agsQueryTask.activate();
>
> Click on the button "statesExecute" that will trigger
> g_agsQueryTask.execute("all, ..., ...), then wait a few seconds and it will
> draw a default-color orange layer on all states (where does this layer comes
> from and how can I style it?!?). BTW I've modified the AgsQueryTask class to
> be able to return all features instead of just matching a geometry (areas
> and points).
>
> Thanks,
> Francois
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100817/cf6f2912/attachment.html
More information about the Users
mailing list