Andrew, Along these lines, I have had to overload some OL methods to get the behavior I wanted. So mostly I have not patched OL for my own purposes.
You can see this on my geofence editor (a work in progress) at http://imaptools.com/~woodbri/edit/index26.php?extent=-129,19+-60,60 I am using svn at the moment because it has a lot of features and fixes in feature editing code that I am referencing. Of course working in svn has some risks I have found it to be very stable. An the only changes I have had to workaround are bug fixes and small changes the link page above. For my two cents, I love the idea of plugins. I believe that if you build a plugin and later change OL version, you should be reasonably protected but now 100%. Like if the plugin uses from core features of OL that have been totally rewritten or replaced. I yo have lots of application code that is dependent on some given version of OL, then you can give each a unique name like: /js/OpenLayers/2.4/OpenLayers.js /js/OpenLayers/2.5/OpenLayers.js /js/OpenLayers/2.5p1/OpenLayers.js // patched version of OL2.5 /js/OpenLayers/svn/2008-03-12/OpenLayers.js And then load the appropriate on in you HTML. -Steve W Andrew de Klerk wrote: > Chris > > Thanks for the insightful reply. If I am hearing you correctly, I could > include, for example, the enhanced layer switcher through an additional > script tag. Would this override the existing layer switcher?, or would I > need to compile openlayers with the layer switcher excluded. This is > essentially what I was referring to, but you have answered my question. > > The problem I was trying to get to, is if you replace controls etc within > the main openlayers script, and a new release comes out, you would need to > keep track Of what you have modified and apply that to the new version - I > would like to keep away from that. A classic example is the styling of the > map tools etc - we have changed their colours, and I currently have > commented placeholders in the code so that when new versions come out, I can > go and modify them again (although I realize that this is due to be moved to > the stylesheet) > > I was unaware of the addin section and will read through that to educate > myself a bit more. > > .....looking forward to 2.6! > > Thanks > Andrew > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Christopher Schmidt > Sent: 12 March 2008 03:01 PM > To: [email protected] > Subject: Re: [OpenLayers-Users] Google Summer of Code 2008 > > On Tue, Mar 11, 2008 at 11:45:43PM -0700, Andrew de klerk wrote: >> Hi all >> >> I have had a look at the trac for this cited on the dev mailing list, and > am >> not sure if this is the appropriate place for this suggestion, but here >> goes. >> >> Linda Rawson suggested to include plugin development for openlayers as > part >> of te summer of code. I was reminded of this when I saw the post by Jachym >> Cepicky about his customised layerswitcher. In many cases as users, we > would >> like to use the most stable release eg 2.5, but sometimes need/want to use >> enhancements such as this layerswitcher, or a scalebar etc. Currently the >> only way is to download from trunk etc and essentially create your own >> custom version of openlayers. > > I'm not sure that this is true? Certainly, if code would work with 2.5, > you can simply include an additional script tag in your page (one for > OL, one for your extra code). > > This is essentially the design of the 'Addins' program we've set up. > http://trac.openlayers.org/wiki/Addins tells more about this, and you > can see that there is already the ScaleBar addin. > >> I forsee this being a problem when future >> release are released. > > I'm not sure I see the problem. Can you explain? > >> I would like to see the development of a core base >> with the ability to "plugin" these great enhancements. As it stands I > would >> already plugin the scalebar and the enhanced popups. > > The new popups belong in trunk, because in order to work, they need to > work at a lower level. In general, I believe that Controls are most > likely the case where 'Addins' is most appropriate, becasue they provide > functionality that is dependent, but not *inter-*depenednet, on the > core. (In other words: they depend on core, core doesn't depend on > them.) It's unfortunate that the new popups have taken so long, but > that doesn't mean that they're really a good fit for living outside of > trunk. > >> I have resisted trying >> to create my own custom version in fear of breaking something. > > Sure, understandably. That's part of the point of addins: you have a > clear 'line' between what is trunk and what isn't, and although you can > build a single file build with addins, it's not really neccesary. > > http://dev.openlayers.org/addins/scalebar/trunk/examples/scalebar.html > > is an example: clearly, it works with trunk, but that doesn't mean it > has to be *in* the build to work. > > Regards, _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
