Ticket #82 (closed defect: fixed)
Reference to non-existing this.oMap in Fusion.Maps.MapServer.showGroup(..) and ...hideGroup(..)
| Reported by: | schneiderei | Owned by: | madair |
|---|---|---|---|
| Priority: | P2 | Milestone: | 1.1 |
| Component: | MapServer | Version: | 1.0.6 |
| Severity: | Major | Keywords: | MapServer, Legend, Groups, Layers |
| Cc: | External ID: | ||
| state: | New | Browser: | All |
| Operating System: | All |
Description
Writing a Fusion application based on MapServer 5.0.2, I experienced some incorrect behaviour in the legend. Often, if I click a group, the map is not redrawn. With other groups, redrawing was triggered as expected. I was not able to identify a logic behind this that could help reproducing the error. However, I found something that I think is a bug in MapServer/MapServer?.js. Fixing this issue also fixed the incorrect behaviour in the legend.
In the methods Fusion.Maps.MapServer.showGroup(..) and Fusion.Maps.MapServer.hideGroup(..), there are calls to this.oMap. I am not sure, but I think that the MapServer object does not have such a field. However, another object in the two methods, namely group, does have a field oMap. Thus, I suspect that there is a bug stemming from a typo or from some unfinished copy/paste.
I suggest changing the lines as follows:
this.oMap.showLayer(group.layers[i].layerName);
should become
this.showLayer(group.layers[i].layerName);
and
this.oMap.hideLayer(group.layers[i].layerName);
should become
this.hideLayer(group.layers[i].layerName);
It works in my application. Perhaps someone knowledgable should have a look at this and determine if this is indeed something that needs to be fixed.
