[jQuery] Help: Trying to write my first plugin and its not trivial

[jQuery] Help: Trying to write my first plugin and its not trivial

Hi all,
I'm trying to write my first plugin and I'm having some conceptual
problems on how to organize stuff and getting my head wrapped around
this. The plugin will be for turning a div into an interactive mapping
application. So, I will start with something like this:
$(document).ready(function(){
$("#map").Resizable(
{
onStop: function(dir) {
this.Map.resized();
},
...
}
).Map(
{ // initialize a bunch of stuff
cgi: "/cgi-bin/mapserv",
fullExtent: [-160.0, -60.0, 15.0, 75.0],
toolPosition: "right",
tools: ["zoomExt", "zoomWin", "zoomIn", "zoomOut"],
onDblClick: function() { ... },
...
resized: function() {
width = parseInt(jQuery(this).css('width'));
height = parseInt(jQuery(this).css('height'));
...
},
reCenter: function(x, y, dxy) {
// recenter the map
}
}
);
});
Ok, so here are the questions:
I'm not sure how the Map() and the Resizable() interact or if they can?
How do I get the onStop of the Resizable package to propagate to the Map
package?
In general, the Map package will run based on events that happen in the
"#map" div, but what I can't figure out is how to to effect changes in
the map when the user interacts with other controls on the page.
Oh, I think I get it, if I add the reCenter function above, then can I
later access it via:
$("#map").Map.reCenter(x, y, dxy);
Is this right? That initial call binds the Map() to the DOM object and
later I can access it like this?
-Steve
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/