Opened 21 years ago
Closed 21 years ago
#396 closed defect (fixed)
Double labeling in querymap
Reported by: | dmorissette | Owned by: | sdlime |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapServer C Library | Version: | 4.1 |
Severity: | normal | Keywords: | |
Cc: |
Description
This was reported on mapserver-users, but I noticed the same myself in 3.6 and 4.0, but never took time to investigate (duh!). I'm filing this here so that we don't forget. ---------- > From: Fawcett, David[SMTP:David.Fawcett@state.mn.us] > Sent: Monday, August 04, 2003 4:27 PM > To: 'mapserver-users@lists.gis.umn.edu' > Subject: [Mapserver-users] Double labeling in querymap? > > I am not sure if this is a bug or PIBCAK* > > Version 4.0 beta2 (7/11/03) > > When I query a point feature, the querymap puts two identical labels on the selected point feature, but correctly places only one label on the other point features on the map. > > The point layer only exists once in the MAP file, so I am not querying two overlaying instances of the same point. > > Am I getting a cached label showing up? I really only need to label each facility once. > > Thanks, > > David. Fawcett, David wrote: > This occurs when the STYLE property of the QUERYMAP object is set to HILITE, but does not occurr when I change it to SELECTED. > > David. >
Change History (3)
comment:2 by , 21 years ago
Status: | new → assigned |
---|
The best solution would be to remove dups somehow from within the cache. This would only have to be done once (for each label in the result set) in the function that draws a query map, and then only when style equals hilite and the cache is on. I'd propose adding a function called something like msLabelIsDuplicate() that takes the cache and a label and returns success if it's a duplicate and failure if not. If not a duplicate then msAddLabel() is called and all is well. Shouldn't add much overhead since HILITE result sets tend to be very small. In cases when the cache is off, or it's post label cache there is no autoplacement so the labels would just write over one another.
comment:3 by , 21 years ago
op_sys: | Windows XP → All |
---|---|
rep_platform: | PC → All |
Resolution: | → fixed |
Status: | assigned → closed |
I don't think there is a perfect solution, especially if layers are drawn outside of the labelcache. However, I don't believe that will be much of a problem. Layers labeled without the cache cannot take advantage of AUTO placement so in that case the label would simply be drawn twice but exactly on top of each other. My solution was to mimic the workaround I mentioned. In cases where style is HILITE we cache the old MINDISTANCE value and set a temporary value. This way we use the normal mechanism in the cache processor. I expect querymaps to change at some point (to query specific styles for example) and this would have to change then too, but for now it should work fine.
Note:
See TracTickets
for help on using tickets.