[OpenLayers-Users] Another Dumb Question?

Bill Thoen bthoen at gisnet.com
Mon Sep 1 14:41:52 EDT 2008


In the example 
http://openlayers.org/dev/examples/custom-control-point.html, the line 
that says:

map = new OpenLayers.Map( $('map') );

I suppose this must return a reference to a div named 'map' but why wrap 
it in such a weird function? Wouldn't

map = new OpenLayers.Map( "map" );

work just as well?

I'm still pretty new to JavaScript and OpenLayers but I can't find a 
reference to the function $()  in my 5 lb JavaScript book (it's amazing 
what's NOT in the Rhino book!) nor can I find it in the OpenLayers docs. 
And Google seems to have a mental block against searching for anything 
that looks like punctuation even if I try "$()".

I'm especially curious because I also saw a reference to "library 
dependence on $" in the recent discussion about OpenLayers and jQuery, 
and don't know what it means.

So would somebody kindly clue me in on this one too?






More information about the Users mailing list