On Wed, Dec 8, 2010 at 12:02, Nandan Bagchee <[email protected]> wrote:
>> > using YUI.Get (or similar) to load an external script resource in the
>> > page head. Put all calls to OpenLayers inside the fn. that is called
>> > by YUI.Get *after* the OpenLayers script object is available.
>>
>> I've come across YUI when I was looking through the weblocks examples
>> and contrib. Could you tell me what are the advantages of using this
>> compared to "pure weblocks"?
>>
>
> It's not YUI per se that you need, rather you need a way of dynamically
> loading openlayers.js when your map widget is displayed.
> yui has a Get utility that accomplishes this, but similar things are
> possible via jquery or handcoded js -- it involves creating a script element
> in the page head with an appropriate src attribute. This is necessary imho
> because the way weblocks loads js code for dependencies does not always mesh
> well with how external widgets expect to work. YMMV, but that was my
> experience with simile.mit.edu and google maps.

I'm not sure if I understand this correctly.

At the moment, I have an setup where weblocks loads openlayers.js for
every page it should open, in the definition of the application
package that I am trying to develop (in defwebapp). So, the
openlayers.js in that case is available to all of the pages. Perhaps
it's not quite a "good practice" but it works for now.

What you're saying is that YUI will help, or make it easier to load my
JS code snippets for certain widgets that will be using openlayers.js?

BTW, I've seen in several JS examples that weblocks widgets send to JS
code widget ID and some arrays and similar stuff. I'm not sure at the
moment what exactly, it was a bit confusing. Where can I see what and
in what way will the widget send to JS?

There is an step that I am missing in all of the examples, or I am
perhaps unable to see it because of beeing unexpirienced. I haven't
done much CL or web programming.

-- 
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en.

Reply via email to