Opened 20 years ago

Closed 17 years ago

#774 closed defect (fixed)

Merge msDrawMap() and msDrawQueryMap()?

Reported by: dmorissette Owned by: mapserverbugs
Priority: high Milestone: 4.6 release
Component: MapServer C Library Version: 4.3
Severity: normal Keywords:
Cc: sgillies@…, mapserver@…

Description

I spent several hours today trying to reproduce/isolate/debug the problem
described in bug 773.  It turns out at the end that this bug is probbaly caused
by some things that aren't properly initialized in msDrawQueryMap() and that
were implemented only in msDrawMap().

When I look at both functions, it seems that it would really make sense to merge
them into a single function with a querymode true/false flag. The only
difference between the two should be that in one case we hilight the layers that
have query results and in the other case we don't, correct?  At the moment the
two functions are completely out of sync with respect to WMS, WFS, and other
custom rendering stuff that's been added only to one of the two, I think that's
just a source of potential bugs.

Does anyone know of any reason why both functions could not be merged into a
single function?  For backwards compatibility we would maintain the same
separate calls in MapScript. We would only change the core functions.

Change History (11)

comment:1 by sdlime, 20 years ago

I would actually like to do away with the QUERYMAP object altogether. It was and
still is a kludge. Rather I would like to be able define some sort of a drawing
"state" like NORMAL/SELECTED/HILITE and tie that "state" to specific STYLEs.
That way a developer could define one set of STYLEs for a state=SELECTED and
another for state=NORMAL or whatever. That would allow a great deal more
flexability in displaying the results of a query. This change would probably not
be more difficult than merging, but would be a big change for the end user,
although a change for the better.

Steve

comment:2 by dmorissette, 20 years ago

I like the idea, but does this mean that there would have to be multiple styles
for every class that's queryable? In most cases all we want to do is hilight
selected shapes in red, so it would be a pain if we had to repeat the same
hilite style with "COLOR 255 0 0" everywhere in the mapfile. 

Could there still be a default behavior (using a default style somewhere) for
the cases where there is no explicit style set?

comment:3 by sgillies@…, 20 years ago

Default styles: i second that.

And couldn't selected/highlighted states be built-in classes for queryable
layers?  I think this could help to collapse the map and query map into
one object.



comment:4 by sdlime, 20 years ago

Built in styles, not built in classes.

comment:5 by dmorissette, 19 years ago

*** Bug 1078 has been marked as a duplicate of this bug. ***

comment:6 by dmorissette, 19 years ago

Milestone: 4.6 release
Copying comment from Steve in bug 1078:

> I'm thinking we may want to abandon msDrawQueryMap and just use the presence or 
> absence of search results to trigger query map production in msDrawMap. 
> Wouldn't be too hard.
> 
> Steve

Note that it's too late for this in 4.4, but that should be a priority for 4.6

comment:7 by mapserver@…, 19 years ago

Cc: mapserver@… added

comment:8 by dmorissette, 19 years ago

blocked: 1458

comment:9 by dmorissette, 17 years ago

blocked: 2017

comment:10 by dmorissette, 17 years ago

blocked: 1630

comment:11 by sdlime, 17 years ago

Resolution: fixed
Status: newclosed
Fixed in 5.0... There still may be other merging to do, or better optimization 
but that can be tracked with new bugs.

Steve
Note: See TracTickets for help on using tickets.