[OpenLayers-Users] map not accept html element

Samuel M. Smith smithsm at samuelsmith.org
Sun Jun 5 12:31:55 EDT 2011


I just wanted to let you know that it did not work as documented and that it should either be fixed or the documentation changed.
Since you have to know the ID to use getElementById its always possible to just use the ID.This however precludes getting an element reference by ID once and then reusing for multiple calls.

On 01 Jun 2011, at 18:33 , Nathan Gerber wrote:

> Looking over the documentation it seems that he would be correct in assuming that the results of getElementById should work for the constructor. I've never personally used this method for OpenLayers and the work around seems easy enough in that you can simply pass the id of the element in question.
> 
> http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.OpenLayers.Map
> --
> Nathan Gerber
> 
> 
> On Wed, Jun 1, 2011 at 6:04 PM, Ricardo Bayley <ricardo.bayley at gmail.com> wrote:
> Hi
> 
> My understanding is that the getElementById returns the actual Element, not its ID.
> 
> 
> 
> 2011/6/1 Samuel M. Smith <smithsm at samuelsmith.org>
> document.getElementById("map")
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

**********************************************************************
Samuel M. Smith Ph.D.
242 East 600 North, Lindon Utah 84042-1662 USA
801-768-2768 voice
801-768-2769 fax

**********************************************************************
"The greatest source of failure and unhappiness in the world is 
giving up what we want most for what we want at the moment"
**********************************************************************






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110605/8b26d4d8/attachment.html


More information about the Users mailing list