[OpenLayers-Users] OpenLayers with Rico and Prototype

Jim Freeby jfreeby at globexplorer.com
Fri Dec 8 11:46:51 EST 2006


Hi Jon,

I did something similar, but instead of removing the var Rico from Corner.js, I inserted an if statement in Corner.js to see if var Rico exists.

if( !Rico ){
  var Rico = new Object();
}

Although it works for my situation, this solution is not really robust, because it only works if rico.js is loaded before the OpenLayers code.  If OpenLayers is loaded first and rico.js is loaded second, then we still have naming conflicts.  Additionally, if we load rico.js first, Rico.Corner and Rico.Color will always be the OpenLayers versions of the objects, because we have loaded them second.

I think a reasonable solution is to rename the OpenLayers var Rico to something like RicoOL.  This implies updating any OpenLayers source that uses the Rico object.  This also removes naming conflicts with Rico.Color and Rico.Corner.

There are only a handful of places where Rico.Corner or Rico.Color are used in the OpenLayers source, so this type of change should not be too complex.  I shared my thoughts to Christopher and he is considering my suggestion.

Thanks for sharing your information :)

Jim

-----Original Message-----
From: jon.blower at gmail.com [mailto:jon.blower at gmail.com]On Behalf Of Jon
Blower
Sent: Thursday, December 07, 2006 11:49 PM
To: Jim Freeby
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] OpenLayers with Rico and Prototype


Hi Jim (and list),

I had this problem (the Rico issue) with version 2.1 as well - my fix
is documented at
http://www.resc.rdg.ac.uk/trac/ncWMS/wiki/OpenLayersChanges.  I don't
know whether this also works in 2.2.  I don't know about the
unloadCache issue.

Hope this helps,
Jon

On 07/12/06, Jim Freeby <jfreeby at globexplorer.com> wrote:
> As of version 2.2, OpenLayers cannot be used with Rico and Prototype on the same page.  The object "Rico" is declared in both rico.js and OpenLayer's Rico\Corner.js.
>
> Additionally, there are issues related to the function "unloadCache" found in both OpenLayers\Events.js and prototype.js, where the code attempts to remove event listeners twice, resulting in null pointer exceptions.
>
> Are there plans to update OpenLayers so that it can be used with Rico/Prototype?
>
> For the short term, I made customizations to OpenLayers\Events.js and Rico\Corner.js to avoid the above conflicts.
>
> If I am sending to the wrong list, please let me know where I should post.
>
> Thanks for any help.
>
>
> Jim
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>


-- 
--------------------------------------------------------------
Dr Jon Blower              Tel: +44 118 378 5213 (direct line)
Technical Director         Tel: +44 118 378 8741 (ESSC)
Reading e-Science Centre   Fax: +44 118 378 6413
ESSC                       Email: jdb at mail.nerc-essc.ac.uk
University of Reading
3 Earley Gate
Reading RG6 6AL, UK
--------------------------------------------------------------


-------------------------------------------------------
Click link below if it is SPAM jfreeby at globexplorer.com
"https://mailscanner.globexplorer.com/dspam/dspam.cgi?signatureID=4579189480221276534746&user=jfreeby@globexplorer.com&retrain=spam&template=history&history_page=1"
!DSPAM:4579189480221276534746!
-------------------------------------------------------





More information about the Users mailing list