[OpenLayers-Dev] Cannot set ID of a control

Stephen Irons stephen.irons at clear.net.nz
Wed Jul 2 23:45:45 EDT 2008


---------- Forwarded message ----------
From: Stephen Irons <stephen.irons at gmail.com>
Date: 2008/7/3
Subject: Cannot set ID of a control
To: dev at openlayers.org


I want to have two mouse position controls on a map (for two different
coordinate systems), but by default they appear on top of each other. I
thought I would specify an ID for each control then, in the stylesheet, I
could position them independantly.

This did not work: the mouse position control ignored the 'id' attribute.

In OpenLayers/Control.js, around lines 170--180, the id is set as the last
thing in init() function -- after applying the options passed in by the
caller.

I think that the line of code

this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");

should be moved to before

OpenLayers.Util.extend(this, options);


This applies to the 2.6 stable release as well as svn7462

Stephen Irons
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20080703/46e8789f/attachment.html


More information about the Dev mailing list