[OpenLayers-Dev] The dot in the ID name difficults jQuery
tschaub at opengeo.org
Tue Apr 17 12:08:44 EDT 2012
I agree this is something that should be addressed. The dots in
element ids has bugged me for a long time as well. Here's a commit
that is a first step toward correcting things:
I'll issue a pull request when I make some time to address a couple
remaining test failures.
I am curious why you'd be trying to access the dom element used to
render a feature though. This is something I'd consider unsupported
(it won't work with the renderer abstraction in a cross-browser way).
Depending on your use case, there's likely a better way to handle
interaction or rendered feature access.
On Mon, Apr 16, 2012 at 1:33 PM, Fernando Norte
<fernando at globalgeo.com.br> wrote:
> 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 :
> var featID = "#" + f.geometry.id.replace(/\./g,'\\.');
> 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
> Dev mailing list
> Dev at lists.osgeo.org
Expert service straight from the developers.
More information about the Dev