[fusion-trac] #390: Legend: layer's legend icon cannot be loaded if the layer's name contains brackets

Fusion trac_fusion at osgeo.org
Tue Apr 6 01:54:27 EDT 2010


#390: Legend: layer's legend icon cannot be loaded if the layer's name contains
brackets
---------------------+------------------------------------------------------
 Reporter:  liuar    |         Owner:  madair          
     Type:  defect   |        Status:  new             
 Priority:  P2       |     Milestone:  2.0             
Component:  Widgets  |       Version:  2.0.0-RC1       
 Severity:  Major    |    Resolution:                  
 Keywords:           |   External_id:  1313948         
    State:  New      |       Browser:  Firefox 3 (beta)
       Os:  All      |  
---------------------+------------------------------------------------------
Comment (by liuar):

 In Legend.js line 936,[[BR]]

 {{{
 this.domImg.style.backgroundImage = "url("+this.options.image+")";
 }}}
 [[BR]]
 If this.options.image contains brackets in its value, the assignment will
 fail in FF, Chrome and Safari. So if the layer name contains brackets, its
 legend icon will not display in the legend.[[BR]]
 [[BR]]
 To resolve this problem, we can encode the image url by updating
 MapGuide.js line 1226,[[BR]]
 From:[[BR]]
 {{{
 url += "&LAYERDEFINITION=" + encodeURIComponent(layer.resourceId);
 }}}
 [[BR]]
 To:[[BR]]

 {{{
 op = /\(/g; cp = /\)/g;
 url += "&LAYERDEFINITION=" +
 encodeURIComponent(layer.resourceId).replace(op, "%28").replace(cp,
 "%29");
 }}}
 [[BR]]
 replace "(" and ")" with valid url components "%28" and "%29".

-- 
Ticket URL: <http://trac.osgeo.org/fusion/ticket/390#comment:1>
Fusion <http://trac.osgeo.org/fusion>
Fusion is a web-mapping application development framework for MapServer and MapGuide OS.


More information about the fusion-trac mailing list