Ticket #3597 (closed bug: invalid)
OpenLayers.Layer.WMS options - id field
| Reported by: | fvigetti | Owned by: | euzuro |
|---|---|---|---|
| Priority: | blocker | Milestone: | 2.11 Release |
| Component: | Layer.WMS | Version: | 2.11 |
| Keywords: | options | Cc: | |
| State: | Commit |
Description
I need to use the id field of the options object when I add a layer, to easily retrive the layer object through the API getLayer, but I verified with Firebug that this id is not effectively stored anywhere. The test of this is that when I call getLayer using this id, I receive a null object. Similarly to this, when I use OpenLayers.Layer.WMS.Post to add a layer, setting the id field in the options object gives me in runtime the following error:
Uncaught TypeError: Cannot call method 'addEventType' of null OpenLayers.Layer.Grid.OpenLayers.Class.initializeOpenLayers.js:1059 OpenLayers.Layer.WMS.OpenLayers.Class.initializeOpenLayers.js:1583 OpenLayers.Layer.WMS.Post.OpenLayers.Class.initializeOpenLayers.js:2689 addLayerfao-widgets-map-js-0.1.js:185 initMapindex.html:32 dispatchEventfao-commons-0.1.js:46 loadfao-widgets-map-js-0.1.js:76 initindex.html:21 (anonymous function)index.html:71 onload
Could you please give me some clarifications for this behaviour? And if I do something wrong? Thanks in advance
Francesca
