[OpenLayers-Dev] The dot in the ID name difficults jQuery integration

Fernando Norte fernando at globalgeo.com.br
Mon Apr 16 13:33:24 EDT 2012


Hi,

I have been through a difficult time to integrate jQuery with OpenLayers,
it's because I was trying to relate the elements created by OpenLayers and
the jQuery to get values as position or to use features like Dialog (jquery
UI) or qTIP, or other things.

The problem I'd realized was in the name of the ID used by OpenLayers in
web elements (like <div> or <svg>), there is dots in the id name, but for
jQuery (and generaly others frameworks who threat like CSS) the dot in the
ID is a separation, that means the class used with the ID. So, I have to
create a scape to the dots.

Some example:

The openLayers create the id <circle id="OpenLayers.Geometry.Point_188">
$("#OpenLayers.Geometry.Point_188") <- this is like search this element:
<tag id="OpenLayers" class="Geometry Point_188">

So I have to create a scape to the dot :
$("#OpenLayers\.Geometry\.Point_188")

A simple line to a var in javascript solve this problem:
var featID = "#" + f.geometry.id.replace(/\./g,'\\.');
$(featID);

I'm noticing this and wanna know, if this is a bug or just a suggestion to
better the software, or nothing?
And how is the best way to report this?

My regards,

Fernando Norte
Developer at http://Globalgeo.com.br
Nova Lima - MG - Brazil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20120416/2ed007c7/attachment.html


More information about the Dev mailing list